diff --git a/builds/respec-aom.js b/builds/respec-aom.js index e3e87ce797..ad65098fef 100644 --- a/builds/respec-aom.js +++ b/builds/respec-aom.js @@ -1,6 +1,6 @@ -window.respecVersion="35.1.2",function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=!!window.require;if(!t){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function n(e,n){t||(window.require.modules[e]=n)}const r=new EventTarget;function o(e,t){if(r.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const n=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function s(e,t,n={once:!1}){r.addEventListener(e,(e=>t(e.detail)),n)}n("core/pubsubhub",{sub:s});const i=["githubToken","githubUser"];const a=document.documentElement;a?.hasAttribute("lang")||(a.lang="en",a.hasAttribute("dir")||(a.dir="ltr"));const c={},l=a?.lang??"en";var u=Object.freeze({__proto__:null,l10n:c,lang:l,name:"core/l10n",run:function(e){e.l10n=c[l]||c.en}});const d=(e,t)=>t.some((t=>e instanceof t));let p,f;const h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return x(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function y(e){b=e(b)}function w(e){return(f||(f=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(k(this),t),x(this.request)}:function(...t){return x(e.apply(k(this),t))}}function v(e){return"function"==typeof e?w(e):(e instanceof IDBTransaction&&function(e){if(h.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)}));h.set(e,t)}(e),d(e,p||(p=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,b):e)}function x(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(x(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)}));return g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=v(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const k=e=>g.get(e);const $=["get","getKey","getAll","getAllKeys","count"],E=["put","add","delete","clear"],_=new Map;function C(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=E.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!$.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let i=s.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),o&&s.done]))[0]};return _.set(t,s),s}y((e=>({...e,get:(t,n,r)=>C(t,n)||e.get(t,n,r),has:(t,n)=>!!C(t,n)||e.has(t,n)})));const S=["continue","continuePrimaryKey","advance"],A={},L=new WeakMap,T=new WeakMap,R={get(e,t){if(!S.includes(t))return e[t];let n=A[t];return n||(n=A[t]=function(...e){L.set(this,T.get(this)[t](...e))}),n}};async function*N(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,R);for(T.set(n,t),g.set(n,k(t));t;)yield n,t=await(L.get(n)||t.continue()),L.delete(n)}function O(e,t){return t===Symbol.asyncIterator&&d(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&d(e,[IDBIndex,IDBObjectStore])}y((e=>({...e,get:(t,n,r)=>O(t,n)?N:e.get(t,n,r),has:(t,n)=>O(t,n)||e.has(t,n)})));var I=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),x(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=x(i);return r&&i.addEventListener("upgradeneeded",(e=>{r(x(i.result),e.oldVersion,e.newVersion,x(i.transaction),e)})),n&&i.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{s&&e.addEventListener("close",(()=>s())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:k,wrap:x});const P=/^[!#$%&'*+-.^`|~\w]+$/,D=/[\u000A\u000D\u0009\u0020]/u,j=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function z(e,t,n){(t&&""!==t&&!e.has(t)&&j.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function M(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let q={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function F(e){q=e}const B=/[&<>"']/,H=new RegExp(B.source,"g"),W=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,U=new RegExp(W.source,"g"),V={"&":"&","<":"<",">":">",'"':""","'":"'"},Z=e=>V[e];function Y(e,t){if(t){if(B.test(e))return e.replace(H,Z)}else if(W.test(e))return e.replace(U,Z);return e}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function K(e){return e.replace(G,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Q=/(^|[^\[])\^/g;function X(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(Q,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}function J(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const ee={exec:()=>null};function te(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ne(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=ne(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");e=ne(e.replace(/^ *>[ \t]?/gm,""),"\n");const n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const s=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let i="",a="",c=!1;for(;e;){let n=!1;if(!(t=s.exec(e)))break;if(this.rules.block.hr.test(e))break;i=t[0],e=e.substring(i.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),l=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=r.slice(u),u+=t[1].length);let d=!1;if(!r&&/^ *$/.test(l)&&(i+=l+"\n",e=e.substring(l.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const c=e.split("\n",1)[0];if(l=c,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),o.test(l))break;if(s.test(l))break;if(t.test(l))break;if(n.test(e))break;if(l.search(/[^ ]/)>=u||!l.trim())a+="\n"+l.slice(u);else{if(d)break;if(r.search(/[^ ]/)>=4)break;if(o.test(r))break;if(s.test(r))break;if(n.test(r))break;a+="\n"+l}d||l.trim()||(d=!0),i+=c+"\n",e=e.substring(c.length+1),r=l.slice(u)}}o.loose||(c?o.loose=!0:/\n *\n *$/.test(i)&&(c=!0));let p,f=null;this.options.gfm&&(f=/^\[[ xX]\] /.exec(a),f&&(p="[ ] "!==f[0],a=a.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:i,task:!!f,checked:p,loose:!1,text:a,tokens:[]}),o.raw+=i}o.items[o.items.length-1].raw=i.trimEnd(),o.items[o.items.length-1].text=a.trimEnd(),o.raw=o.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));o.loose=n}if(o.loose)for(let e=0;e$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=te(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),o=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?s.align.push("right"):/^ *:-+: *$/.test(e)?s.align.push("center"):/^ *:-+ *$/.test(e)?s.align.push("left"):s.align.push(null);for(const e of n)s.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of o)s.rows.push(te(e,s.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Y(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=ne(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),re(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return re(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let o,s,i=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(s=[...o].length,r[3]||r[4]){i+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){a+=s;continue}if(i-=s,i>0)continue;s=Math.min(s,s+i+a);const t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+s);if(Math.min(n,s)%2){const e=c.slice(1,-1);return{type:"em",raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}const l=c.slice(2,-2);return{type:"strong",raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=Y(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=Y(t[1]),n="mailto:"+e):(e=Y(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=Y(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=Y(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:Y(t[0]),{type:"text",raw:t[0],text:e}}}}const se=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ie=/(?:[*+-]|\d{1,9}[.)])/,ae=X(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ie).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),ce=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,le=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ue=X(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",le).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),de=X(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ie).getRegex(),pe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",fe=/|$))/,he=X("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",fe).replace("tag",pe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),me=X(ce).replace("hr",se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex(),ge={blockquote:X(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",me).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:ue,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:se,html:he,lheading:ae,list:de,newline:/^(?: *(?:\n|$))+/,paragraph:me,table:ee,text:/^[^\n]+/},be=X("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex(),ye={...ge,table:be,paragraph:X(ce).replace("hr",se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",be).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex()},we={...ge,html:X("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",fe).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ee,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:X(ce).replace("hr",se).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ae).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ve=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xe=/^( {2,}|\\)\n(?!\s*$)/,ke="\\p{P}\\p{S}",$e=X(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,ke).getRegex(),Ee=X(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,ke).getRegex(),_e=X("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,ke).getRegex(),Ce=X("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,ke).getRegex(),Se=X(/\\([punct])/,"gu").replace(/punct/g,ke).getRegex(),Ae=X(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Le=X(fe).replace("(?:--\x3e|$)","--\x3e").getRegex(),Te=X("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Le).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Re=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ne=X(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Re).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Oe=X(/^!?\[(label)\]\[(ref)\]/).replace("label",Re).replace("ref",le).getRegex(),Ie=X(/^!?\[(ref)\](?:\[\])?/).replace("ref",le).getRegex(),Pe={_backpedal:ee,anyPunctuation:Se,autolink:Ae,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:xe,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:ee,emStrongLDelim:Ee,emStrongRDelimAst:_e,emStrongRDelimUnd:Ce,escape:ve,link:Ne,nolink:Ie,punctuation:$e,reflink:Oe,reflinkSearch:X("reflink|nolink(?!\\()","g").replace("reflink",Oe).replace("nolink",Ie).getRegex(),tag:Te,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],s&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),s=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,s,i,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(c));)c=c.slice(0,s.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class Be{options;constructor(e){this.options=e||q}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'
'+(n?e:Y(e,!0))+"
\n":"
"+(n?e:Y(e,!0))+"
\n"}blockquote(e){return`
\n${e}
\n`}html(e,t){return e}heading(e,t,n){return`${e}\n`}hr(){return"
\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e,t,n){return`
  • ${e}
  • \n`}checkbox(e){return"'}paragraph(e){return`

    ${e}

    \n`}table(e,t){return t&&(t=`${t}`),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return`\n${e}\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`\n`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return"
    "}del(e){return`${e}`}link(e,t,n){const r=J(e);if(null===r)return n;let o='
    ",o}image(e,t,n){const r=J(e);if(null===r)return n;let o=`${n}0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(n.tokens,s),i+=this.renderer.listitem(a,o,!!r)}n+=this.renderer.list(i,t,r);continue}case"html":{const e=o;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=o;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let s=o,i=s.tokens?this.parseInline(s.tokens):s.text;for(;r+1{const o=e[r].flat(1/0);n=n.concat(this.walkTokens(o,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new Be(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const r=n,o=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new oe(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,o=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new Ue;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,o=e.hooks[r],s=t[r];Ue.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(o.call(t,e)).then((e=>s.call(t,e)));const n=o.call(t,e);return s.call(t,n)}:t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Fe.lex(e,t??this.defaults)}parser(e,t){return We.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const o={...r},s={...this.defaults,...o};!0===this.defaults.async&&!1===o.async&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const i=this.#t(!!s.silent,!!s.async);if(null==n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then((t=>e(t,s))).then((e=>s.hooks?s.hooks.processAllTokens(e):e)).then((e=>s.walkTokens?Promise.all(this.walkTokens(e,s.walkTokens)).then((()=>e)):e)).then((e=>t(e,s))).then((e=>s.hooks?s.hooks.postprocess(e):e)).catch(i);try{s.hooks&&(n=s.hooks.preprocess(n));let r=e(n,s);s.hooks&&(r=s.hooks.processAllTokens(r)),s.walkTokens&&this.walkTokens(r,s.walkTokens);let o=t(r,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(e){return i(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+Y(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Ze(e,t){return Ve.parse(e,t)}Ze.options=Ze.setOptions=function(e){return Ve.setOptions(e),Ze.defaults=Ve.defaults,F(Ze.defaults),Ze},Ze.getDefaults=M,Ze.defaults=q,Ze.use=function(...e){return Ve.use(...e),Ze.defaults=Ve.defaults,F(Ze.defaults),Ze},Ze.walkTokens=function(e,t){return Ve.walkTokens(e,t)},Ze.parseInline=Ve.parseInline,Ze.Parser=We,Ze.parser=We.parse,Ze.Renderer=Be,Ze.TextRenderer=He,Ze.Lexer=Fe,Ze.lexer=Fe.lex,Ze.Tokenizer=oe,Ze.Hooks=Ue,Ze.parse=Ze,Ze.options,Ze.setOptions,Ze.use,Ze.walkTokens,Ze.parseInline,We.parse,Fe.lex;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Ye(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ge,Ke={exports:{}};Ge=Ke,function(e,t){Ge.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function s(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(t[0],(function(n,r){var o,s,a=(o=t[1],s=arguments,o.replace(/\$(\d{1,2})/g,(function(e,t){return s[t]||""})));return i(""===n?e[r-1]:n,a)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var s=r[o];if(s[0].test(t))return a(t,s)}return t}function l(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?i(r,o):e.hasOwnProperty(o)?i(r,e[o]):c(o,r,n)}}function u(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(o,o,n)===o}}function d(e,t,n){return(n?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=l(o,r,e),d.isPlural=u(o,r,e),d.singular=l(r,o,t),d.isSingular=u(r,o,t),d.addPluralRule=function(t,n){e.push([s(t),n])},d.addSingularRule=function(e,n){t.push([s(e),n])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},d.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),o[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return d.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return d.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return d.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eƩ]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d}));var Qe=Ye(Ke.exports),Xe=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=s.prototype;return o.delete=function(e){return this.has(e)&&delete e[this._]},o.get=function(e){return this.has(e)?e[this._]:void 0},o.has=function(e){return r.call(e,this._)},o.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},s;function s(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(i,this)}function i(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=o.prototype;function o(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=o}(Math.random(),Object.defineProperty)}function o(e,t,n,r,o,s){for(var i=("selectedIndex"in t),a=i;r>>0;ni;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var v=w.newi,x=w.oldi;v"+e+"",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=z(C),n=z("div");return n.innerHTML=''+e+"",j(t,n.firstChild.childNodes),t}:A)(e)});function j(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===C?_.createDocumentFragment():_.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,F,B,H,W,U,V,Z,Y=(q="appendChild",F="cloneNode",B="createTextNode",W=(H="importNode")in(M=e),(U=M.createDocumentFragment())[q](M[B]("g")),U[q](M[B]("")),(W?M[H](U,!0):U[F](!0)).childNodes.length<2?function e(t,n){for(var r=t[F](),o=t.childNodes||[],s=o.length,i=0;n&&i

    ',V.content.childNodes[0].getAttribute(Z)==K)||(K="_dt: "+K.slice(1,-1)+";",Q=!0)}catch(u){}var X="\x3c!--"+K+"--\x3e",J=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,oe=" \\f\\n\\r\\t",se="[^"+oe+"\\/>\"'=]+",ie="["+oe+"]+"+se,ae="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ce="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+se.replace("\\/","")+"))?)",le=new RegExp(ae+ie+ce+"+)(["+oe+"]*/?>)","g"),ue=new RegExp(ae+ie+ce+"*)(["+oe+"]*/>)","g"),de=new RegExp("("+ie+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function pe(e,t,n,r){return"<"+t+n.replace(de,fe)+r}function fe(e,t,n){return t+(n||'"')+K+(n||'"')}function he(e,t,n){return re.test(t)?e:"<"+t+n+">"}var me=Q?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function ge(t,n,r,o){for(var s=t.childNodes,i=s.length,a=0;a{e.remove()}))}function dt(e,t="long"){const n=new Intl.ListFormat(l,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:o})=>"element"===n&&t?t(o,r++,e):o))}}const pt=dt("conjunction"),ft=dt("disjunction");function ht(e,t){return pt(e,t).join("")}function mt(e){return e.trim().replace(/\s+/g," ")}function gt(e,t=l){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=function(e,t,n=l){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function bt(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){Ot(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function yt(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>Je`${e}, `));return Je`${r}${n[n.length-1]}`}function wt(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=r?n:n.toLowerCase();if(o=o.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),o?!/\.$/.test(o)&&/^[a-z]/i.test(t||o)||(o=`x${o}`):o="generatedID",t&&(o=`${t}-${o}`),e.ownerDocument.getElementById(o)){let t=0,n=`${o}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${o}-${t}`;o=n}return e.id=o,o}function vt(e){const t=new Set,n="ltNodefault"in e.dataset?"":mt(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>mt(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(mt(e))))}return[...t]}function xt(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function kt(e,t){const n=t.closest(ct);let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function $t(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Et(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function _t(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class Ct extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function St(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{xt(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),At(t),t}function At(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Lt(t)])e.remove()}function*Lt(e){for(;e.nextNode();)yield e.currentNode}class Tt extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class Rt extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||wt(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:s,title:i,details:a}=this;return{message:e,name:t,plugin:r,hint:o,elements:s,title:i,details:a,stack:n}}}function Nt(e,t,n={}){const r={...n,isWarning:!1};o("error",new Rt(e,t,r))}function Ot(e,t,n={}){const r={...n,isWarning:!0};o("warn",new Rt(e,t,r))}function It(e){return{showError:(t,n)=>Nt(t,e,n),showWarning:(t,n)=>Ot(t,e,n)}}function Pt(e){return e?`\`${e}\``:""}function Dt(e,{quotes:t}={quotes:!1}){return ft(e,t?e=>{return Pt((t=e,String(t)?`"${t}"`:""));var t}:Pt).join("")}function jt(e,...t){return zt(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,s]=r.slice(1,-1).split("|");if(s){return`${e}[${o}](${new URL(s,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`})).join(""))}function zt(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter((e=>e.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}const Mt=new Map([["text/html","html"],["application/xml","xml"]]);function qt(e,t=document){const n=Mt.get(e);if(!n){const t=[...Mt.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Ft(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Ft(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;At(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),ut(r);const s=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&s.appendChild(i);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=Je``);s.appendChild(a);const c=`ReSpec ${window.respecVersion||"Developer Channel"}`,l=Je` - - `;s.appendChild(l),t.prepend(s),o("beforesave",r)}(n);let r="";if("xml"===e)r=(new XMLSerializer).serializeToString(n);else!function(e){e.querySelectorAll("style").forEach((e=>{e.innerHTML=`\n${e.innerHTML}\n`})),e.querySelectorAll("head > *").forEach((e=>{e.outerHTML=`\n${e.outerHTML}`}))}(n),n.doctype&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML;return r}n("core/exporter",{rsDocToDataURL:qt});class Bt{constructor(){this._respecDonePromise=new Promise((e=>{s("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],s("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),s("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return Ft("html",document)}}const Ht="core/post-process";const Wt="core/pre-process";const Ut="core/base-runner";async function Vt(e){!function(){const e=new Bt;Object.defineProperty(document,"respec",{value:e})}(),o("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),s("amend-user-config",n),s("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of i)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)}))}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter((([e,t])=>!!e&&!!t)).map((([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let o;try{o=JSON.parse(r)}catch{o=r}return[n,o]})),r=Object.fromEntries(n);Object.assign(e,r),o("amend-user-config",r)}(respecConfig),performance.mark(`${Ut}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Nt("Every item in `preProcess` must be a JS function.",Wt),t})).map((async(t,n)=>{const r=It(`${Wt}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){Nt(`Function ${t.name} threw an error during \`preProcess\`.`,Wt,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}}(respecConfig);const t=e.filter((e=>{return(t=e)&&(t.run||t.Plugin);var t}));t.forEach((e=>!e.name&&console.warn("Plugin lacks name:",e))),await async function(e,t){for(const n of e.filter((e=>e.prepare)))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise((async(r,o)=>{const s=setTimeout((()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),o(new Error(t))}),15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){o(e)}finally{clearTimeout(s),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}}))}catch(e){console.error(e)}}}(t,respecConfig),o("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter((e=>{const t="function"==typeof e;return t||Nt("Every item in `postProcess` must be a JS function.",Ht),t})).map((async(t,n)=>{const r=It(`${Ht}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){Nt(`Function ${t.name} threw an error during \`postProcess\`.`,Ht,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),o("end-all"),ut(document),performance.mark(`${Ut}-end`),performance.measure(Ut,`${Ut}-start`,`${Ut}-end`)}var Zt=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} +window.respecVersion="35.2.0",function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=!!window.require;if(!t){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function n(e,n){t||(window.require.modules[e]=n)}const r=document.documentElement;r?.hasAttribute("lang")||(r.lang="en",r.hasAttribute("dir")||(r.dir="ltr"));const o={},s=r?.lang??"en";var i=Object.freeze({__proto__:null,l10n:o,lang:s,name:"core/l10n",run:function(e){e.l10n=o[s]||o.en}});const a=(e,t)=>t.some((t=>e instanceof t));let c,l;const u=new WeakMap,d=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return b(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){f=e(f)}function m(e){return(l||(l=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(y(this),t),b(this.request)}:function(...t){return b(e.apply(y(this),t))}}function g(e){return"function"==typeof e?m(e):(e instanceof IDBTransaction&&function(e){if(u.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)}));u.set(e,t)}(e),a(e,c||(c=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,f):e)}function b(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(b(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)}));return p.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=g(e);return t!==e&&(d.set(e,t),p.set(t,e)),t}const y=e=>p.get(e);const w=["get","getKey","getAll","getAllKeys","count"],v=["put","add","delete","clear"],x=new Map;function k(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(x.get(t))return x.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=v.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!w.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let i=s.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),o&&s.done]))[0]};return x.set(t,s),s}h((e=>({...e,get:(t,n,r)=>k(t,n)||e.get(t,n,r),has:(t,n)=>!!k(t,n)||e.has(t,n)})));const $=["continue","continuePrimaryKey","advance"],E={},_=new WeakMap,C=new WeakMap,S={get(e,t){if(!$.includes(t))return e[t];let n=E[t];return n||(n=E[t]=function(...e){_.set(this,C.get(this)[t](...e))}),n}};async function*A(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,S);for(C.set(n,t),p.set(n,y(t));t;)yield n,t=await(_.get(n)||t.continue()),_.delete(n)}function L(e,t){return t===Symbol.asyncIterator&&a(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&a(e,[IDBIndex,IDBObjectStore])}h((e=>({...e,get:(t,n,r)=>L(t,n)?A:e.get(t,n,r),has:(t,n)=>L(t,n)||e.has(t,n)})));var T=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),b(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=b(i);return r&&i.addEventListener("upgradeneeded",(e=>{r(b(i.result),e.oldVersion,e.newVersion,b(i.transaction),e)})),n&&i.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{s&&e.addEventListener("close",(()=>s())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:y,wrap:b});const R=/^[!#$%&'*+-.^`|~\w]+$/,N=/[\u000A\u000D\u0009\u0020]/u,O=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function I(e,t,n){(t&&""!==t&&!e.has(t)&&O.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function P(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let D={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function j(e){D=e}const z=/[&<>"']/,M=new RegExp(z.source,"g"),q=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,F=new RegExp(q.source,"g"),B={"&":"&","<":"<",">":">",'"':""","'":"'"},H=e=>B[e];function W(e,t){if(t){if(z.test(e))return e.replace(M,H)}else if(q.test(e))return e.replace(F,H);return e}const U=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function V(e){return e.replace(U,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Z=/(^|[^\[])\^/g;function Y(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(Z,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}function G(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const K={exec:()=>null};function Q(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:X(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=X(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");e=X(e.replace(/^ *>[ \t]?/gm,""),"\n");const n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const s=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let i="",a="",c=!1;for(;e;){let n=!1;if(!(t=s.exec(e)))break;if(this.rules.block.hr.test(e))break;i=t[0],e=e.substring(i.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),l=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=r.slice(u),u+=t[1].length);let d=!1;if(!r&&/^ *$/.test(l)&&(i+=l+"\n",e=e.substring(l.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const c=e.split("\n",1)[0];if(l=c,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),o.test(l))break;if(s.test(l))break;if(t.test(l))break;if(n.test(e))break;if(l.search(/[^ ]/)>=u||!l.trim())a+="\n"+l.slice(u);else{if(d)break;if(r.search(/[^ ]/)>=4)break;if(o.test(r))break;if(s.test(r))break;if(n.test(r))break;a+="\n"+l}d||l.trim()||(d=!0),i+=c+"\n",e=e.substring(c.length+1),r=l.slice(u)}}o.loose||(c?o.loose=!0:/\n *\n *$/.test(i)&&(c=!0));let p,f=null;this.options.gfm&&(f=/^\[[ xX]\] /.exec(a),f&&(p="[ ] "!==f[0],a=a.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:i,task:!!f,checked:p,loose:!1,text:a,tokens:[]}),o.raw+=i}o.items[o.items.length-1].raw=i.trimEnd(),o.items[o.items.length-1].text=a.trimEnd(),o.raw=o.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));o.loose=n}if(o.loose)for(let e=0;e$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=Q(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),o=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?s.align.push("right"):/^ *:-+: *$/.test(e)?s.align.push("center"):/^ *:-+ *$/.test(e)?s.align.push("left"):s.align.push(null);for(const e of n)s.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of o)s.rows.push(Q(e,s.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:W(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^
    /i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=X(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),J(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return J(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let o,s,i=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(s=[...o].length,r[3]||r[4]){i+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){a+=s;continue}if(i-=s,i>0)continue;s=Math.min(s,s+i+a);const t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+s);if(Math.min(n,s)%2){const e=c.slice(1,-1);return{type:"em",raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}const l=c.slice(2,-2);return{type:"strong",raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=W(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=W(t[1]),n="mailto:"+e):(e=W(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=W(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=W(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:W(t[0]),{type:"text",raw:t[0],text:e}}}}const te=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ne=/(?:[*+-]|\d{1,9}[.)])/,re=Y(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ne).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),oe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,se=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ie=Y(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",se).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ae=Y(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ne).getRegex(),ce="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",le=/|$))/,ue=Y("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",le).replace("tag",ce).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),de=Y(oe).replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ce).getRegex(),pe={blockquote:Y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",de).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:ie,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:te,html:ue,lheading:re,list:ae,newline:/^(?: *(?:\n|$))+/,paragraph:de,table:K,text:/^[^\n]+/},fe=Y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ce).getRegex(),he={...pe,table:fe,paragraph:Y(oe).replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",fe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ce).getRegex()},me={...pe,html:Y("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",le).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:K,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Y(oe).replace("hr",te).replace("heading"," *#{1,6} *[^\n]").replace("lheading",re).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ge=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,be=/^( {2,}|\\)\n(?!\s*$)/,ye="\\p{P}\\p{S}",we=Y(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,ye).getRegex(),ve=Y(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,ye).getRegex(),xe=Y("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,ye).getRegex(),ke=Y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,ye).getRegex(),$e=Y(/\\([punct])/,"gu").replace(/punct/g,ye).getRegex(),Ee=Y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),_e=Y(le).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ce=Y("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",_e).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Se=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ae=Y(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Se).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Le=Y(/^!?\[(label)\]\[(ref)\]/).replace("label",Se).replace("ref",se).getRegex(),Te=Y(/^!?\[(ref)\](?:\[\])?/).replace("ref",se).getRegex(),Re={_backpedal:K,anyPunctuation:$e,autolink:Ee,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:be,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:K,emStrongLDelim:ve,emStrongRDelimAst:xe,emStrongRDelimUnd:ke,escape:ge,link:Ae,nolink:Te,punctuation:we,reflink:Le,reflinkSearch:Y("reflink|nolink(?!\\()","g").replace("reflink",Le).replace("nolink",Te).getRegex(),tag:Ce,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],s&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),s=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,s,i,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(c));)c=c.slice(0,s.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class ze{options;constructor(e){this.options=e||D}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'
    '+(n?e:W(e,!0))+"
    \n":"
    "+(n?e:W(e,!0))+"
    \n"}blockquote(e){return`
    \n${e}
    \n`}html(e,t){return e}heading(e,t,n){return`${e}\n`}hr(){return"
    \n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e,t,n){return`
  • ${e}
  • \n`}checkbox(e){return"'}paragraph(e){return`

    ${e}

    \n`}table(e,t){return t&&(t=`${t}`),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return`\n${e}\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`\n`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return"
    "}del(e){return`${e}`}link(e,t,n){const r=G(e);if(null===r)return n;let o='
    ",o}image(e,t,n){const r=G(e);if(null===r)return n;let o=`${n}0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(n.tokens,s),i+=this.renderer.listitem(a,o,!!r)}n+=this.renderer.list(i,t,r);continue}case"html":{const e=o;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=o;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let s=o,i=s.tokens?this.parseInline(s.tokens):s.text;for(;r+1{const o=e[r].flat(1/0);n=n.concat(this.walkTokens(o,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new ze(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const r=n,o=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new ee(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,o=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new Fe;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,o=e.hooks[r],s=t[r];Fe.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(o.call(t,e)).then((e=>s.call(t,e)));const n=o.call(t,e);return s.call(t,n)}:t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return je.lex(e,t??this.defaults)}parser(e,t){return qe.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const o={...r},s={...this.defaults,...o};!0===this.defaults.async&&!1===o.async&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const i=this.#t(!!s.silent,!!s.async);if(null==n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then((t=>e(t,s))).then((e=>s.hooks?s.hooks.processAllTokens(e):e)).then((e=>s.walkTokens?Promise.all(this.walkTokens(e,s.walkTokens)).then((()=>e)):e)).then((e=>t(e,s))).then((e=>s.hooks?s.hooks.postprocess(e):e)).catch(i);try{s.hooks&&(n=s.hooks.preprocess(n));let r=e(n,s);s.hooks&&(r=s.hooks.processAllTokens(r)),s.walkTokens&&this.walkTokens(r,s.walkTokens);let o=t(r,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(e){return i(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+W(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function He(e,t){return Be.parse(e,t)}function We(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}He.options=He.setOptions=function(e){return Be.setOptions(e),He.defaults=Be.defaults,j(He.defaults),He},He.getDefaults=P,He.defaults=D,He.use=function(...e){return Be.use(...e),He.defaults=Be.defaults,j(He.defaults),He},He.walkTokens=function(e,t){return Be.walkTokens(e,t)},He.parseInline=Be.parseInline,He.Parser=qe,He.parser=qe.parse,He.Renderer=ze,He.TextRenderer=Me,He.Lexer=je,He.lexer=je.lex,He.Tokenizer=ee,He.Hooks=Fe,He.parse=He,He.options,He.setOptions,He.use,He.walkTokens,He.parseInline,qe.parse,je.lex;var Ue,Ve={exports:{}};var Ze,Ye=(Ue||(Ue=1,Ze=Ve,function(e,t){Ze.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function s(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(t[0],(function(n,r){var o,s,a=(o=t[1],s=arguments,o.replace(/\$(\d{1,2})/g,(function(e,t){return s[t]||""})));return i(""===n?e[r-1]:n,a)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var s=r[o];if(s[0].test(t))return a(t,s)}return t}function l(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?i(r,o):e.hasOwnProperty(o)?i(r,e[o]):c(o,r,n)}}function u(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(o,o,n)===o}}function d(e,t,n){return(n?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=l(o,r,e),d.isPlural=u(o,r,e),d.singular=l(r,o,t),d.isSingular=u(r,o,t),d.addPluralRule=function(t,n){e.push([s(t),n])},d.addSingularRule=function(e,n){t.push([s(e),n])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},d.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),o[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return d.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return d.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return d.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eƩ]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d}))),Ve.exports),Ge=We(Ye),Ke=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=s.prototype;return o.delete=function(e){return this.has(e)&&delete e[this._]},o.get=function(e){return this.has(e)?e[this._]:void 0},o.has=function(e){return r.call(e,this._)},o.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},s;function s(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(i,this)}function i(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=o.prototype;function o(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=o}(Math.random(),Object.defineProperty)}function o(e,t,n,r,o,s){for(var i=("selectedIndex"in t),a=i;r>>0;ni;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var v=w.newi,x=w.oldi;v"+e+"",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=z(C),n=z("div");return n.innerHTML=''+e+"",j(t,n.firstChild.childNodes),t}:A)(e)});function j(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===C?_.createDocumentFragment():_.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,F,B,H,W,U,V,Z,Y=(q="appendChild",F="cloneNode",B="createTextNode",W=(H="importNode")in(M=e),(U=M.createDocumentFragment())[q](M[B]("g")),U[q](M[B]("")),(W?M[H](U,!0):U[F](!0)).childNodes.length<2?function e(t,n){for(var r=t[F](),o=t.childNodes||[],s=o.length,i=0;n&&i

    ',V.content.childNodes[0].getAttribute(Z)==K)||(K="_dt: "+K.slice(1,-1)+";",Q=!0)}catch(u){}var X="\x3c!--"+K+"--\x3e",J=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,oe=" \\f\\n\\r\\t",se="[^"+oe+"\\/>\"'=]+",ie="["+oe+"]+"+se,ae="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ce="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+se.replace("\\/","")+"))?)",le=new RegExp(ae+ie+ce+"+)(["+oe+"]*/?>)","g"),ue=new RegExp(ae+ie+ce+"*)(["+oe+"]*/>)","g"),de=new RegExp("("+ie+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function pe(e,t,n,r){return"<"+t+n.replace(de,fe)+r}function fe(e,t,n){return t+(n||'"')+K+(n||'"')}function he(e,t,n){return re.test(t)?e:"<"+t+n+">"}var me=Q?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function ge(t,n,r,o){for(var s=t.childNodes,i=s.length,a=0;a{e.remove()}))}function lt(e,t="long"){const n=new Intl.ListFormat(s,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:o})=>"element"===n&&t?t(o,r++,e):o))}}const ut=lt("conjunction"),dt=lt("disjunction");function pt(e,t){return ut(e,t).join("")}function ft(e){return e.trim().replace(/\s+/g," ")}function ht(e,t=s){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=function(e,t,n=s){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function mt(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){Rt(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace.",cause:e})}}}return e}function gt(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>Qe`${e}, `));return Qe`${r}${n[n.length-1]}`}function bt(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=r?n:n.toLowerCase();if(o=o.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),o?!/\.$/.test(o)&&/^[a-z]/i.test(t||o)||(o=`x${o}`):o="generatedID",t&&(o=`${t}-${o}`),e.ownerDocument.getElementById(o)){let t=0,n=`${o}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${o}-${t}`;o=n}return e.id=o,o}function yt(e){const t=new Set,n="ltNodefault"in e.dataset?"":ft(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>ft(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(ft(e))))}return[...t]}function wt(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function vt(e,t){const n=t.closest(it);let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function xt(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function kt(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function $t(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class Et extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function _t(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{wt(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),Ct(t),t}function Ct(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...St(t)])e.remove()}function*St(e){for(;e.nextNode();)yield e.currentNode}class At extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class Lt extends Error{constructor(e,t,n){super(e,{...n.cause&&{cause:n.cause}});const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||bt(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:s,title:i,details:a}=this;return{message:e,name:t,plugin:r,hint:o,elements:s,title:i,details:a,stack:n,...this.cause instanceof Error&&{cause:{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}}}}}function Tt(e,t,n={}){const r={...n,isWarning:!1};zt("error",new Lt(e,t,r))}function Rt(e,t,n={}){const r={...n,isWarning:!0};zt("warn",new Lt(e,t,r))}function Nt(e){return{showError:(t,n)=>Tt(t,e,n),showWarning:(t,n)=>Rt(t,e,n)}}function Ot(e){return e?`\`${e}\``:""}function It(e,{quotes:t}={quotes:!1}){return dt(e,t?e=>{return Ot((t=e,String(t)?`"${t}"`:""));var t}:Ot).join("")}function Pt(e,...t){return Dt(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,s]=r.slice(1,-1).split("|");if(s){return`${e}[${o}](${new URL(s,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`})).join(""))}function Dt(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter((e=>e.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}const jt=new EventTarget;function zt(e,t){if(jt.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const n=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function Mt(e,t,n={once:!1}){jt.addEventListener(e,(async n=>{try{await t(n.detail)}catch(t){Tt(`Error in handler for topic "${e}": ${t.message}`,`sub:${e}`,{cause:t})}}),n)}n("core/pubsubhub",{sub:Mt});const qt=["githubToken","githubUser"];const Ft=new Map([["text/html","html"],["application/xml","xml"]]);function Bt(e,t=document){const n=Ft.get(e);if(!n){const t=[...Ft.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Ht(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Ht(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;Ct(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),ct(r);const o=e.createDocumentFragment(),s=e.querySelector("meta[name='viewport']");s&&t.firstChild!==s&&o.appendChild(s);let i=e.querySelector("meta[charset], meta[content*='charset=']");i||(i=Qe``);o.appendChild(i);const a=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=Qe` + + `;o.appendChild(c),t.prepend(o),zt("beforesave",r)}(n);let r="";if("xml"===e)r=(new XMLSerializer).serializeToString(n);else!function(e){e.querySelectorAll("style").forEach((e=>{e.innerHTML=`\n${e.innerHTML}\n`})),e.querySelectorAll("head > *").forEach((e=>{e.outerHTML=`\n${e.outerHTML}`}))}(n),n.doctype&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML;return r}n("core/exporter",{rsDocToDataURL:Bt});class Wt{constructor(){this._respecDonePromise=new Promise((e=>{Mt("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],Mt("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),Mt("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return Ht("html",document)}}const Ut="core/post-process";const Vt="core/pre-process";const Zt="core/base-runner";async function Yt(e){!function(){const e=new Wt;Object.defineProperty(document,"respec",{value:e})}(),zt("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),Mt("amend-user-config",n),Mt("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of qt)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)}))}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter((([e,t])=>!!e&&!!t)).map((([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let o;try{o=JSON.parse(r)}catch{o=r}return[n,o]})),r=Object.fromEntries(n);Object.assign(e,r),zt("amend-user-config",r)}(respecConfig),performance.mark(`${Zt}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Tt("Every item in `preProcess` must be a JS function.",Vt),t})).map((async(t,n)=>{const r=Nt(`${Vt}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){Tt(`Function ${t.name} threw an error during \`preProcess\`.`,Vt,{hint:"See developer console.",cause:e})}}));await Promise.all(t)}}(respecConfig);const t=e.filter((e=>{return(t=e)&&(t.run||t.Plugin);var t}));t.forEach((e=>!e.name&&console.warn("Plugin lacks name:",e))),await async function(e,t){for(const n of e.filter((e=>e.prepare)))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise((async(r,o)=>{const s=setTimeout((()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),o(new Error(t))}),15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){o(e)}finally{clearTimeout(s),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}}))}catch(e){console.error(e)}}}(t,respecConfig),zt("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter((e=>{const t="function"==typeof e;return t||Tt("Every item in `postProcess` must be a JS function.",Ut),t})).map((async(t,n)=>{const r=Nt(`${Ut}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){Tt(`Function ${t.name} threw an error during \`postProcess\`.`,Ut,{hint:"See developer console.",cause:e})}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),zt("end-all"),ct(document),performance.mark(`${Zt}-end`),performance.measure(Zt,`${Zt}-start`,`${Zt}-end`)}var Gt=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} #respec-ui{position:fixed;display:flex;flex-direction:row-reverse;top:20px;right:20px;width:202px;text-align:right;z-index:9000} #respec-pill,.respec-info-button{height:2.4em;background:#fff;background:var(--bg,#fff);color:#787878;color:var(--tocnav-normal-text,#787878);border:1px solid #ccc;box-shadow:1px 1px 8px 0 rgba(100,100,100,.5);box-shadow:1px 1px 8px 0 var(--tocsidebar-shadow,rgba(100,100,100,.5));padding:.2em 0} .respec-info-button{border:none;opacity:.75;border-radius:2em;margin-right:1em;min-width:3.5em;will-change:opacity} @@ -64,37 +64,37 @@ to{margin-top:0;border:1px solid #ccc;border-radius:0;box-shadow:1px 1px 8px 0 r .respec-iframe:not(.ready){background:url(https://respec.org/xref/loader.gif) no-repeat center} .respec-iframe+a[href]{font-size:.9rem;float:right;margin:0 .5em .5em;border-bottom-width:1px} p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} -.respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const Yt=/>/gm,Gt=/&/gm;class Kt extends tt.Renderer{code(e,t,n){const{language:r,...o}=Kt.parseInfoString(t);if(/(^webidl$)/i.test(r))return`
    ${e}
    `;const s=super.code(e,r,n).replace('class="language-','class="'),{example:i,illegalExample:a}=o;if(!i&&!a)return s;const c=i||a,l=`${r} ${i?"example":"illegal-example"}`;return s.replace("
    ",`
    `)}image(e,t,n){if(!t)return super.image(e,t,n);return String.raw`
    +.respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const Kt=/>/gm,Qt=/&/gm;class Xt extends Je.Renderer{code(e,t,n){const{language:r,...o}=Xt.parseInfoString(t);if(/(^webidl$)/i.test(r))return`
    ${e}
    `;const s=super.code(e,r,n).replace('class="language-','class="'),{example:i,illegalExample:a}=o;if(!i&&!a)return s;const c=i||a,l=`${r} ${i?"example":"illegal-example"}`;return s.replace("
    ",`
    `)}image(e,t,n){if(!t)return super.image(e,t,n);return String.raw`
           
    ${n}
    ${t}
    - `}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let o;if(r)try{o=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...o}}heading(e,t,n){const r=/(.+)\s+{#([\w-]+)}$/;if(r.test(e)){const[,n,o]=e.match(r);return`${n}`}return super.heading(e,t,n)}}const Qt={gfm:!0,renderer:new Kt};function Xt(e,t={inline:!1}){const n=zt(e).replace(Yt,">").replace(Gt,"&");return t.inline?tt.parseInline(n,Qt):tt.parse(n,Qt)}function Jt(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=Xt(e.innerHTML)}const en=(tn="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(tn);return t.forEach(Jt),Array.from(t)});var tn;var nn=Object.freeze({__proto__:null,markdownToHtml:Xt,name:"core/markdown",run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void en(document.body);const r=document.getElementById("respec-ui");r.remove();const o=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),o=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),o.trim()){const t=_t(e);e.append(`\n\n${t}`)}}}(o,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),Jt(o),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(o.querySelectorAll(".nolinks a[href]")),o.append(r),document.body.replaceWith(o)}});function rn(e,t){e&&Array.from(t).forEach((([t,n])=>{e.setAttribute(`aria-${t}`,n)}))}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=Zt,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const on=Je``,sn=Je`
      ${n}`}return super.heading(e,t,n)}}const Jt={gfm:!0,renderer:new Xt};function en(e,t={inline:!1}){const n=Dt(e).replace(Kt,">").replace(Qt,"&");return t.inline?Je.parseInline(n,Jt):Je.parse(n,Jt)}function tn(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=en(e.innerHTML)}const nn=(rn="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(rn);return t.forEach(tn),Array.from(t)});var rn;var on=Object.freeze({__proto__:null,markdownToHtml:en,name:"core/markdown",run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void nn(document.body);const r=document.getElementById("respec-ui");r.remove();const o=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),o=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),o.trim()){const t=$t(e);e.append(`\n\n${t}`)}}}(o,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),tn(o),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(o.querySelectorAll(".nolinks a[href]")),o.append(r),document.body.replaceWith(o)}});function sn(e,t){e&&Array.from(t).forEach((([t,n])=>{e.setAttribute(`aria-${t}`,n)}))}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=Gt,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const an=Qe``,cn=Qe``,an=Je`
    `,ln=Qe``;let cn,ln;window.addEventListener("load",(()=>mn(sn)));const un=[],dn=[],pn={};s("start-all",(()=>document.body.prepend(on)),{once:!0}),s("end-all",(()=>document.body.prepend(on)),{once:!0});const fn=Je``;function hn(){sn.classList.toggle("respec-hidden"),sn.classList.toggle("respec-visible"),sn.hidden=!sn.hidden}function mn(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",(e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))}))}on.appendChild(fn),fn.addEventListener("click",(e=>{e.stopPropagation(),fn.setAttribute("aria-expanded",String(sn.hidden)),hn(),sn.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{sn.hidden||hn()})),on.appendChild(sn),sn.addEventListener("keydown",(e=>{"Escape"!==e.key||sn.hidden||(fn.setAttribute("aria-expanded",String(sn.hidden)),hn(),fn.focus())}));const gn=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function bn(e,t,n,r){t.push(e),pn.hasOwnProperty(n)||(pn[n]=function(e,t,n){const r=`respec-pill-${e}`,o=Je``;function gn(){cn.classList.toggle("respec-hidden"),cn.classList.toggle("respec-visible"),cn.hidden=!cn.hidden}function bn(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",(e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))}))}an.appendChild(mn),mn.addEventListener("click",(e=>{e.stopPropagation(),mn.setAttribute("aria-expanded",String(cn.hidden)),gn(),cn.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{cn.hidden||gn()})),an.appendChild(cn),cn.addEventListener("keydown",(e=>{"Escape"!==e.key||cn.hidden||(mn.setAttribute("aria-expanded",String(cn.hidden)),gn(),mn.focus())}));const yn=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function wn(e,t,n,r){t.push(e),hn.hasOwnProperty(n)||(hn[n]=function(e,t,n){const r=`respec-pill-${e}`,o=Qe``;o.addEventListener("click",(()=>{o.setAttribute("aria-expanded","true");const r=Je`
      `;for(const e of t){const t=document.createRange().createContextualFragment(wn(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),r.appendChild(n)}yn.freshModal(n,r,o)}));const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return rn(o,s),o}(n,t,r),on.appendChild(pn[n]));const o=pn[n];o.textContent=t.length;const s=1===t.length?rt.singular(r):r;rn(o,new Map([["label",`${t.length} ${s}`]]))}rn(fn,gn);const yn={show(){try{on.hidden=!1}catch(e){console.error(e)}},hide(){on.hidden=!0},enable(){fn.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,s=Je``;o.addEventListener("click",(()=>{o.setAttribute("aria-expanded","true");const r=Qe`
        `;for(const e of t){const t=document.createRange().createContextualFragment(xn(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),r.appendChild(n)}vn.freshModal(n,r,o)}));const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return sn(o,s),o}(n,t,r),an.appendChild(hn[n]));const o=hn[n];o.textContent=t.length;const s=1===t.length?tt.singular(r):r;sn(o,new Map([["label",`${t.length} ${s}`]]))}sn(mn,yn);const vn={show(){try{an.hidden=!1}catch(e){console.error(e)}},hide(){an.hidden=!0},enable(){mn.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,s=Qe``,i=Je`
      1. ${s}
      2. `;return i.addEventListener("click",t),sn.appendChild(i),s},error(e){bn(e,un,"error","ReSpec Errors")},warning(e){bn(e,dn,"warning","ReSpec Warnings")},closeModal(e){ln&&(ln.classList.remove("respec-show-overlay"),ln.classList.add("respec-hide-overlay"),ln.addEventListener("transitionend",(()=>{ln.remove(),ln=null}))),e&&e.setAttribute("aria-expanded","false"),cn&&(cn.remove(),cn=null,fn.focus())},freshModal(e,t,n){cn&&cn.remove(),ln&&ln.remove(),ln=Je`
        `;const r=`${n.id}-modal`,o=`${r}-heading`;cn=Je`
        `,i=Qe`
      3. ${s}
      4. `;return i.addEventListener("click",t),cn.appendChild(i),s},error(e){wn(e,pn,"error","ReSpec Errors")},warning(e){wn(e,fn,"warning","ReSpec Warnings")},closeModal(e){dn&&(dn.classList.remove("respec-show-overlay"),dn.classList.add("respec-hide-overlay"),dn.addEventListener("transitionend",(()=>{dn.remove(),dn=null}))),e&&e.setAttribute("aria-expanded","false"),un&&(un.remove(),un=null,mn.focus())},freshModal(e,t,n){un&&un.remove(),dn&&dn.remove(),dn=Qe`
        `;const r=`${n.id}-modal`,o=`${r}-heading`;un=Qe``;const s=new Map([["labelledby",o]]);rn(cn,s),document.body.append(ln,cn),ln.addEventListener("click",(()=>this.closeModal(n))),ln.classList.toggle("respec-show-overlay"),cn.hidden=!1,mn(cn)}};function wn(e){if("string"==typeof e)return e;const t=e.plugin?`

        (plugin: "${e.plugin}")

        `:"",n=e.hint?`\n${Xt(`

        How to fix: ${zt(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`

        Occurred ${e.elements.length} times at:

        \n ${Xt(e.elements.map(vn).join("\n"))}`:"",o=e.details?`\n\n
        \n${e.details}\n
        \n`:"";var s;return`${Xt(`**${s=e.message,s.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/\`](#${e.id}) element`}async function xn(e){try{yn.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await Vt(e)}finally{yn.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&yn.closeModal()})),window.respecUI=yn,s("error",(e=>yn.error(e))),s("warn",(e=>yn.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const kn=[Promise.resolve().then((function(){return $n})),Promise.resolve().then((function(){return u})),Promise.resolve().then((function(){return Sn})),Promise.resolve().then((function(){return Tn})),Promise.resolve().then((function(){return On})),Promise.resolve().then((function(){return Fn})),Promise.resolve().then((function(){return nn})),Promise.resolve().then((function(){return Bn})),Promise.resolve().then((function(){return Un})),Promise.resolve().then((function(){return ir})),Promise.resolve().then((function(){return lr})),Promise.resolve().then((function(){return ur})),Promise.resolve().then((function(){return fr})),Promise.resolve().then((function(){return $o})),Promise.resolve().then((function(){return So})),Promise.resolve().then((function(){return jo})),Promise.resolve().then((function(){return zo})),Promise.resolve().then((function(){return Bo})),Promise.resolve().then((function(){return Zo})),Promise.resolve().then((function(){return Xo})),Promise.resolve().then((function(){return ts})),Promise.resolve().then((function(){return Hr})),Promise.resolve().then((function(){return xs})),Promise.resolve().then((function(){return ds})),Promise.resolve().then((function(){return eo})),Promise.resolve().then((function(){return $s})),Promise.resolve().then((function(){return jn})),Promise.resolve().then((function(){return Es})),Promise.resolve().then((function(){return Ns})),Promise.resolve().then((function(){return Is})),Promise.resolve().then((function(){return Ds})),Promise.resolve().then((function(){return Fs})),Promise.resolve().then((function(){return Zs})),Promise.resolve().then((function(){return Ys})),Promise.resolve().then((function(){return ti})),Promise.resolve().then((function(){return ii})),Promise.resolve().then((function(){return pi})),Promise.resolve().then((function(){return hi})),Promise.resolve().then((function(){return gi})),Promise.resolve().then((function(){return Ei})),Promise.resolve().then((function(){return Si})),Promise.resolve().then((function(){return Oi})),Promise.resolve().then((function(){return Ii})),Promise.resolve().then((function(){return ji})),Promise.resolve().then((function(){return Fi})),Promise.resolve().then((function(){return Ui})),Promise.resolve().then((function(){return Yi})),Promise.resolve().then((function(){return Qi})),Promise.resolve().then((function(){return ea})),Promise.resolve().then((function(){return ra}))];Promise.all(kn).then((e=>xn(e))).catch((e=>console.error(e)));var $n=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){window.location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(window.location.hash).slice(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}window.location.hash=`#${e}`}))}});const En={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},_n=new Map([["aom",{name:"Alliance for Open Media License",short:"AOM",url:"http://aomedia.org/license/"}]]),Cn={format:"markdown",logos:[{src:"https://aomedia.org/assets/images/aomedia-icon-only.png",alt:"AOM",id:"AOM",height:170,width:170,url:"https://aomedia.org/"}],license:"aom"};var Sn=Object.freeze({__proto__:null,name:"aom/defaults",run:function(e){const t=!1!==e.lint&&{...En.lint,...Cn.lint,...e.lint};Object.assign(e,{...En,...Cn,...e,lint:t}),Object.assign(e,function(e){return{licenseInfo:_n.get(e.license)}}(e))}});var An=String.raw`@keyframes pop{ +
        `;const s=new Map([["labelledby",o]]);sn(un,s),document.body.append(dn,un),dn.addEventListener("click",(()=>this.closeModal(n))),dn.classList.toggle("respec-show-overlay"),un.hidden=!1,bn(un)}};function xn(e){if("string"==typeof e)return e;const t=e.plugin?`

        (plugin: "${e.plugin}")

        `:"",n=e.hint?`\n${en(`

        How to fix: ${Dt(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`

        Occurred ${e.elements.length} times at:

        \n ${en(e.elements.map(kn).join("\n"))}`:"",o=e.details?`\n\n
        \n${e.details}\n
        \n`:"";var s;return`${en(`**${s=e.message,s.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/\`](#${e.id}) element`}async function $n(e){try{vn.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await Yt(e)}finally{vn.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&vn.closeModal()})),window.respecUI=vn,Mt("error",(e=>vn.error(e))),Mt("warn",(e=>vn.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const En=[Promise.resolve().then((function(){return _n})),Promise.resolve().then((function(){return i})),Promise.resolve().then((function(){return Ln})),Promise.resolve().then((function(){return Nn})),Promise.resolve().then((function(){return Pn})),Promise.resolve().then((function(){return Hn})),Promise.resolve().then((function(){return on})),Promise.resolve().then((function(){return Wn})),Promise.resolve().then((function(){return Zn})),Promise.resolve().then((function(){return cr})),Promise.resolve().then((function(){return dr})),Promise.resolve().then((function(){return pr})),Promise.resolve().then((function(){return mr})),Promise.resolve().then((function(){return _o})),Promise.resolve().then((function(){return Lo})),Promise.resolve().then((function(){return Mo})),Promise.resolve().then((function(){return qo})),Promise.resolve().then((function(){return Wo})),Promise.resolve().then((function(){return Go})),Promise.resolve().then((function(){return es})),Promise.resolve().then((function(){return rs})),Promise.resolve().then((function(){return Ur})),Promise.resolve().then((function(){return $s})),Promise.resolve().then((function(){return fs})),Promise.resolve().then((function(){return no})),Promise.resolve().then((function(){return _s})),Promise.resolve().then((function(){return Mn})),Promise.resolve().then((function(){return Cs})),Promise.resolve().then((function(){return Is})),Promise.resolve().then((function(){return Ds})),Promise.resolve().then((function(){return zs})),Promise.resolve().then((function(){return Hs})),Promise.resolve().then((function(){return Gs})),Promise.resolve().then((function(){return Ks})),Promise.resolve().then((function(){return ri})),Promise.resolve().then((function(){return ci})),Promise.resolve().then((function(){return hi})),Promise.resolve().then((function(){return gi})),Promise.resolve().then((function(){return yi})),Promise.resolve().then((function(){return Ci})),Promise.resolve().then((function(){return Li})),Promise.resolve().then((function(){return Pi})),Promise.resolve().then((function(){return Di})),Promise.resolve().then((function(){return Mi})),Promise.resolve().then((function(){return Hi})),Promise.resolve().then((function(){return Zi})),Promise.resolve().then((function(){return Ki})),Promise.resolve().then((function(){return Ji})),Promise.resolve().then((function(){return na})),Promise.resolve().then((function(){return sa}))];Promise.all(En).then((e=>$n(e))).catch((e=>console.error(e)));var _n=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){window.location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(window.location.hash).slice(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}window.location.hash=`#${e}`}))}});const Cn={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},Sn=new Map([["aom",{name:"Alliance for Open Media License",short:"AOM",url:"http://aomedia.org/license/"}]]),An={format:"markdown",logos:[{src:"https://aomedia.org/assets/images/aomedia-icon-only.png",alt:"AOM",id:"AOM",height:170,width:170,url:"https://aomedia.org/"}],license:"aom"};var Ln=Object.freeze({__proto__:null,name:"aom/defaults",run:function(e){const t=!1!==e.lint&&{...Cn.lint,...An.lint,...e.lint};Object.assign(e,{...Cn,...An,...e,lint:t}),Object.assign(e,function(e){return{licenseInfo:Sn.get(e.license)}}(e))}});var Tn=String.raw`@keyframes pop{ 0%{transform:scale(1,1)} 25%{transform:scale(1.25,1.25);opacity:.75} 100%{transform:scale(1,1)} @@ -135,14 +135,14 @@ dd{margin-left:0} } @media print{ .removeOnSave{display:none} -}`;const Ln=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=An,document.head.appendChild(e),e}();var Tn=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Ln.remove()}});const Rn="aom/style";const Nn=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2016/fixup.js",as:"script"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2016/base.css",as:"style"}],t=document.createDocumentFragment();for(const n of e.map(lt))t.appendChild(n);return t}();Nn.appendChild(function(){const e=document.createElement("link");return e.rel="stylesheet",e.href="https://www.w3.org/StyleSheets/TR/2016/base.css",e.classList.add("removeOnSave"),e}()),document.head.querySelector("meta[name=viewport]")||Nn.prepend(function(){const e=document.createElement("meta");return e.name="viewport",e.content=function(e,t=", ",n="="){return Array.from(Object.entries(e)).map((([e,t])=>`${e}${n}${JSON.stringify(t)}`)).join(t)}({width:"device-width","initial-scale":"1","shrink-to-fit":"no"}).replace(/"/g,""),e}()),document.head.prepend(Nn);var On=Object.freeze({__proto__:null,name:Rn,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",Ot(t,Rn)}let t="";if("PD"===e.specStatus.toUpperCase())t="W3C-UD";else t="base.css";e.noToc||s("end-all",(()=>{!function(e,t){const n=e.createElement("script");location.hash&&n.addEventListener("load",(()=>{window.location.href=location.hash}),{once:!0}),n.src=`https://www.w3.org/scripts/TR/${t}/fixup.js`,e.body.appendChild(n)}(document,"2016")}),{once:!0});const n=`https://www.w3.org/StyleSheets/TR/2016/${t}`;var r;!function(e,t){const n=[].concat(t).map((t=>{const n=e.createElement("link");return n.rel="stylesheet",n.href=t,n})).reduce(((e,t)=>(e.appendChild(t),e)),e.createDocumentFragment());e.head.appendChild(n)}(document,n),s("beforesave",(r=n,e=>{const t=e.querySelector(`head link[href="${r}"]`);e.querySelector("head").append(t)}))}});class In{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(Pn(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function Pn(e){const t=new In(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function Dn(e){const t=Pn(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var jn=Object.freeze({__proto__:null,name:"core/sections",restructure:Dn,run:function(){Dn(document.body)}});const zn="core/data-include";function Mn(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=bt(e,r.dataset.oninclude,n),s="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let o=t;"markdown"===r&&(o=Xt(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&Dn(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:s}),s||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function qn(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const o=await fetch(n);Mn(await o.text(),r,n),t<3&&await qn(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),Nt(r,zn,{elements:[e]})}}));await Promise.all(r)}var Fn=Object.freeze({__proto__:null,name:zn,run:async function(){await qn(document,1)}});var Bn=Object.freeze({__proto__:null,name:"core/reindent",run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=zt(e.innerHTML)}});const Hn="core/title",Wn=gt({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"ę— ę ‡é¢˜"}});var Un=Object.freeze({__proto__:null,name:Hn,run:function(e){const t=document.querySelector("h1#title")||Je`

        `;if(t.isConnected&&""===t.textContent.trim()){Nt('The document is missing a title, so using a default title. To fix this, please give your document a ``. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',Hn,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||`${Wn.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=mt(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:o}=Je` +}`;const Rn=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Tn,document.head.appendChild(e),e}();var Nn=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Rn.remove()}});const On="aom/style";const In=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2016/fixup.js",as:"script"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2016/base.css",as:"style"}],t=document.createDocumentFragment();for(const n of e.map(at))t.appendChild(n);return t}();In.appendChild(function(){const e=document.createElement("link");return e.rel="stylesheet",e.href="https://www.w3.org/StyleSheets/TR/2016/base.css",e.classList.add("removeOnSave"),e}()),document.head.querySelector("meta[name=viewport]")||In.prepend(function(){const e=document.createElement("meta");return e.name="viewport",e.content=function(e,t=", ",n="="){return Array.from(Object.entries(e)).map((([e,t])=>`${e}${n}${JSON.stringify(t)}`)).join(t)}({width:"device-width","initial-scale":"1","shrink-to-fit":"no"}).replace(/"/g,""),e}()),document.head.prepend(In);var Pn=Object.freeze({__proto__:null,name:On,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",Rt(t,On)}let t="";if("PD"===e.specStatus.toUpperCase())t="W3C-UD";else t="base.css";e.noToc||Mt("end-all",(()=>{!function(e,t){const n=e.createElement("script");location.hash&&n.addEventListener("load",(()=>{window.location.href=location.hash}),{once:!0}),n.src=`https://www.w3.org/scripts/TR/${t}/fixup.js`,e.body.appendChild(n)}(document,"2016")}),{once:!0});const n=`https://www.w3.org/StyleSheets/TR/2016/${t}`;var r;!function(e,t){const n=[].concat(t).map((t=>{const n=e.createElement("link");return n.rel="stylesheet",n.href=t,n})).reduce(((e,t)=>(e.appendChild(t),e)),e.createDocumentFragment());e.head.appendChild(n)}(document,n),Mt("beforesave",(r=n,e=>{const t=e.querySelector(`head link[href="${r}"]`);e.querySelector("head").append(t)}))}});class Dn{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(jn(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function jn(e){const t=new Dn(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function zn(e){const t=jn(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var Mn=Object.freeze({__proto__:null,name:"core/sections",restructure:zn,run:function(){zn(document.body)}});const qn="core/data-include";function Fn(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=mt(e,r.dataset.oninclude,n),s="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let o=t;"markdown"===r&&(o=en(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&zn(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:s}),s||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function Bn(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const o=await fetch(n);Fn(await o.text(),r,n),t<3&&await Bn(e,t+1)}catch(t){Tt(`\`data-include\` failed: \`${n}\` (${t.message}).`,qn,{elements:[e],cause:t})}}));await Promise.all(r)}var Hn=Object.freeze({__proto__:null,name:qn,run:async function(){await Bn(document,1)}});var Wn=Object.freeze({__proto__:null,name:"core/reindent",run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Dt(e.innerHTML)}});const Un="core/title",Vn=ht({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"ę— ę ‡é¢˜"}});var Zn=Object.freeze({__proto__:null,name:Un,run:function(e){const t=document.querySelector("h1#title")||Qe`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){Tt('The document is missing a title, so using a default title. To fix this, please give your document a `<title>`. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',Un,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||`${Vn.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=ft(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:o}=Qe` Preview of PR <a href="${n}">#${e.prNumber}</a>: - `;t.prepend(...o),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});function Vn(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return Ot(t,"core/templates/show-link"),void console.warn(t,e)}return Je` + `;t.prepend(...o),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});function Yn(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return Rt(t,"core/templates/show-link"),void console.warn(t,e)}return Qe` <dt class="${e.class?e.class:null}">${e.key}</dt> - ${e.data?e.data.map(Zn):Zn(e)} - `}function Zn(e){return Je`<dd class="${e.class?e.class:null}"> - ${e.href?Je`<a href="${e.href}">${e.value||e.href}</a>`:e.value} - </dd>`}const Yn="core/templates/show-logo";function Gn(e,t){const n=Je`<a href="${e.url||null}" class="logo" + ${e.data?e.data.map(Gn):Gn(e)} + `}function Gn(e){return Qe`<dd class="${e.class?e.class:null}"> + ${e.href?Qe`<a href="${e.href}">${e.value||e.href}</a>`:e.value} + </dd>`}const Kn="core/templates/show-logo";function Qn(e,t){const n=Qe`<a href="${e.url||null}" class="logo" ><img alt="${e.alt||null}" crossorigin @@ -151,7 +151,7 @@ dd{margin-left:0} src="${e.src||null}" width="${e.width||null}" /> - </a>`;if(!e.alt){const r=jt`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;Nt(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,Yn,{hint:r,elements:[n]})}if(!e.src){const e=jt`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;Nt(`Logo at index ${t} is missing "\`src\`" property.`,Yn,{hint:e,elements:[n]})}return n}const Kn="core/templates/show-people",Qn=gt({en:{until:e=>Je` Until ${e} `},es:{until:e=>Je` Hasta ${e} `},ko:{until:e=>Je` ${e} ģ“ģ „ `},ja:{until:e=>Je` ${e} 仄前 `},de:{until:e=>Je` bis ${e} `},zh:{until:e=>Je` ē›“到 ${e} `}}),Xn=()=>Je`<svg + </a>`;if(!e.alt){const r=Pt`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;Tt(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,Kn,{hint:r,elements:[n]})}if(!e.src){const e=Pt`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;Tt(`Logo at index ${t} is missing "\`src\`" property.`,Kn,{hint:e,elements:[n]})}return n}const Xn="core/templates/show-people",Jn=ht({en:{until:e=>Qe` Until ${e} `},es:{until:e=>Qe` Hasta ${e} `},ko:{until:e=>Qe` ${e} ģ“ģ „ `},ja:{until:e=>Qe` ${e} 仄前 `},de:{until:e=>Qe` bis ${e} `},zh:{until:e=>Qe` ē›“到 ${e} `}}),er=()=>Qe`<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" @@ -170,15 +170,15 @@ dd{margin-left:0} class="st1" d="M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z" /> - </svg>`;function Jn(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(o=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,s=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${o}\`](${n}#${o})" configuration option.`;if(!e.name)return Nt(`${s} Missing required property \`"name"\`.`,Kn,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${s} ORCID "${e.orcid}" at index ${t} is invalid.`,o=`The origin should be "https://orcid.org", not "${r.origin}".`;return Nt(n,Kn,{hint:o}),!1}const o=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(o))return Nt(`${s} ORCID "${o}" has wrong format.`,Kn,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=e.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0),r=(12-n%11)%11,o=10===r?"X":String(r);return t===o}(n))return Nt(`${s} ORCID "${n}" failed checksum check.`,Kn,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(i=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(i)?new Date(i):"Invalid Date").toString())?(Nt(`${s} The property "\`retiredDate\`" is not a valid date.`,Kn,{hint:`The expected format is YYYY-MM-DD. ${r}`}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every(((e,r)=>{switch(!0){case"object"!=typeof e:return Nt(`${n}. Member "extra" at index ${r} is not an object.`,Kn,{hint:t}),!1;case!e.hasOwnProperty("name"):return Nt(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,Kn,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return Nt(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,Kn,{hint:t}),!1}return!0})):(Nt(`${n}. A person's "extras" member must be an array.`,Kn,{hint:t}),!1)}(e.extras,r,s))&&(e.url&&e.mailto&&Ot(`${s} Has both "url" and "mailto" property.`,Kn,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&Ot(`${s} Has a "\`companyURL\`" property but no "\`company\`" property.`,Kn,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var i});var o;return n.filter(r).map(er)}function er(e){const t=[e.name],n=[e.company],r=e.w3cid||null,o=[];if(e.mailto&&(e.url=`mailto:${e.mailto}`),e.url){const n="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";o.push(Je`<a class="${n}" href="${e.url}">${t}</a>`)}else o.push(Je`<span class="p-name fn">${t}</span>`);if(e.orcid&&o.push(Je`<a class="p-name orcid" href="${e.orcid}">${Xn()}</a>`),e.company){const t="p-org org h-org",r=e.companyURL?Je`<a class="${t}" href="${e.companyURL}">${n}</a>`:Je`<span class="${t}">${n}</span>`;o.push(Je` (${r})`)}e.note&&o.push(document.createTextNode(` (${e.note})`)),e.extras&&o.push(...e.extras.map((e=>Je`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?Je`<a href="${r}" class="${t}">${n}</a>`:Je`<span class="${t}">${n}</span>`}(e)}`)));const{retiredDate:s}=e;if(e.retiredDate){const e=Je`<time datetime="${s}" - >${at.format(new Date(s))}</time - >`;o.push(Je` - ${Qn.until(e)} `)}return Je`<dd + </svg>`;function tr(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(o=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,s=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${o}\`](${n}#${o})" configuration option.`;if(!e.name)return Tt(`${s} Missing required property \`"name"\`.`,Xn,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${s} ORCID "${e.orcid}" at index ${t} is invalid.`,o=`The origin should be "https://orcid.org", not "${r.origin}".`;return Tt(n,Xn,{hint:o}),!1}const o=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(o))return Tt(`${s} ORCID "${o}" has wrong format.`,Xn,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=e.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0),r=(12-n%11)%11,o=10===r?"X":String(r);return t===o}(n))return Tt(`${s} ORCID "${n}" failed checksum check.`,Xn,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(i=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(i)?new Date(i):"Invalid Date").toString())?(Tt(`${s} The property "\`retiredDate\`" is not a valid date.`,Xn,{hint:`The expected format is YYYY-MM-DD. ${r}`}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every(((e,r)=>{switch(!0){case"object"!=typeof e:return Tt(`${n}. Member "extra" at index ${r} is not an object.`,Xn,{hint:t}),!1;case!e.hasOwnProperty("name"):return Tt(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,Xn,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return Tt(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,Xn,{hint:t}),!1}return!0})):(Tt(`${n}. A person's "extras" member must be an array.`,Xn,{hint:t}),!1)}(e.extras,r,s))&&(e.url&&e.mailto&&Rt(`${s} Has both "url" and "mailto" property.`,Xn,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&Rt(`${s} Has a "\`companyURL\`" property but no "\`company\`" property.`,Xn,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var i});var o;return n.filter(r).map(nr)}function nr(e){const t=[e.name],n=[e.company],r=e.w3cid||null,o=[];if(e.mailto&&(e.url=`mailto:${e.mailto}`),e.url){const n="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";o.push(Qe`<a class="${n}" href="${e.url}">${t}</a>`)}else o.push(Qe`<span class="p-name fn">${t}</span>`);if(e.orcid&&o.push(Qe`<a class="p-name orcid" href="${e.orcid}">${er()}</a>`),e.company){const t="p-org org h-org",r=e.companyURL?Qe`<a class="${t}" href="${e.companyURL}">${n}</a>`:Qe`<span class="${t}">${n}</span>`;o.push(Qe` (${r})`)}e.note&&o.push(document.createTextNode(` (${e.note})`)),e.extras&&o.push(...e.extras.map((e=>Qe`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?Qe`<a href="${r}" class="${t}">${n}</a>`:Qe`<span class="${t}">${n}</span>`}(e)}`)));const{retiredDate:s}=e;if(e.retiredDate){const e=Qe`<time datetime="${s}" + >${st.format(new Date(s))}</time + >`;o.push(Qe` - ${Jn.until(e)} `)}return Qe`<dd class="editor p-author h-card vcard" data-editor-id="${r}" > ${o} - </dd>`}const tr=gt({en:{author:"Author:",authors:"Authors:",editor:"Editor:",editors:"Editors:",former_editor:"Former editor:",former_editors:"Former editors:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest approved version:",this_version:"This version:",issue_tracker:"Issue Tracker:"}});var nr=e=>Je`<div class="head"> - ${"PD"!==e.specStatus?e.logos.map(Gn):""} + </dd>`}const rr=ht({en:{author:"Author:",authors:"Authors:",editor:"Editor:",editors:"Editors:",former_editor:"Former editor:",former_editors:"Former editors:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest approved version:",this_version:"This version:",issue_tracker:"Issue Tracker:"}});var or=e=>Qe`<div class="head"> + ${"PD"!==e.specStatus?e.logos.map(Qn):""} ${document.querySelector("h1#title")} ${function(e){let t=document.querySelector("h2#subtitle");return t&&t.parentElement?(t.remove(),e.subtitle=t.textContent.trim()):e.subtitle&&(t=document.createElement("h2"),t.textContent=e.subtitle,t.id="subtitle"),t&&t.classList.add("subtitle"),t}(e)} <h2> ${e.textStatus} - @@ -187,29 +187,29 @@ dd{margin-left:0} > </h2> <dl> - <dt>${tr.this_version}</dt> + <dt>${rr.this_version}</dt> <dd> <a class="u-url" href="${e.thisVersion}">${e.thisVersion}</a> </dd> - <dt>${tr.issue_tracker}</dt> + <dt>${rr.issue_tracker}</dt> <dd> <a class="u-url" href="${e.issueTracker}">${e.issueTracker}</a> </dd> - <dt>${e.multipleEditors?tr.editors:tr.editor}</dt> - ${Jn(e,"editors")} - ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?Je` + <dt>${e.multipleEditors?rr.editors:rr.editor}</dt> + ${tr(e,"editors")} + ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?Qe` <dt> - ${e.multipleFormerEditors?tr.former_editors:tr.former_editor} + ${e.multipleFormerEditors?rr.former_editors:rr.former_editor} </dt> - ${Jn(e,"formerEditors")} + ${tr(e,"formerEditors")} `:""} - ${e.authors?Je` - <dt>${e.multipleAuthors?tr.authors:tr.author}</dt> - ${Jn(e,"authors")} + ${e.authors?Qe` + <dt>${e.multipleAuthors?rr.authors:rr.author}</dt> + ${tr(e,"authors")} `:""} - ${e.otherLinks?e.otherLinks.map(Vn):""} + ${e.otherLinks?e.otherLinks.map(Yn):""} </dl> - ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;return Je`<p class="copyright"> + ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;return Qe`<p class="copyright"> Copyright ${e.publishYear}, <a href="https://www.w3.org/" ><abbr title="The Alliance for Open Media">AOM</abbr></a @@ -230,62 +230,62 @@ dd{margin-left:0} DAMAGE. </p>`}(e)} <hr /> - </div>`;const rr="aom/headers",or={PD:"Pre-Draft",WGD:"AOM Work Group Draft",WGA:"AOM Working Group Approved Draft",FD:"AOM Final Deliverable"},sr=new Intl.DateTimeFormat(["en-US"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"});var ir=Object.freeze({__proto__:null,name:rr,run:function(e){if(!e.specStatus){Nt("Missing required configuration: `specStatus`",rr)}e.title=document.title||"No title",e.subtitle||(e.subtitle=""),e.publishDate=function(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=st.format(r);return new Date(e)}return Nt(`[\`${t}\`](https://github.com/speced/respec/wiki/${t}) is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,rr),new Date(st.format(new Date))}(e,"publishDate",document.lastModified),e.thisVersion=`https://aomediacodec.github.io/${e.shortName}/`,e.issueTracker=`https://github.com/AOMediaCodec/${e.shortName}/issues/`,e.publishYear=e.publishDate.getUTCFullYear(),e.publishHumanDate=sr.format(e.publishDate);const t=function(e){if(!e.name){Nt("All authors and editors must have a name.",rr)}};if(e.formerEditors||(e.formerEditors=[]),e.editors){e.editors.forEach(t);for(let t=0;t<e.editors.length;t++){const n=e.editors[t];"retiredDate"in n&&(e.formerEditors.push(n),e.editors.splice(t--,1))}}if(!e.editors||0===e.editors.length){Nt("At least one editor is required",rr)}e.formerEditors.length&&e.formerEditors.forEach(t),e.authors&&e.authors.forEach(t),e.multipleEditors=e.editors&&e.editors.length>1,e.multipleFormerEditors=e.formerEditors.length>1,e.multipleAuthors=e.authors&&e.authors.length>1,e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.textStatus=or[e.specStatus],e.dashDate=st.format(e.publishDate),e.publishISODate=e.publishDate.toISOString();const n=nr(e);document.body.prepend(n),document.body.classList.add("h-entry"),o("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const ar="aom/abstract",cr=gt({en:{abstract:"Abstract"}});var lr=Object.freeze({__proto__:null,name:ar,run:async function(){const e=document.getElementById("abstract");if(!e){return void Nt('Document must have one element with `id="abstract"',ar)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=cr.abstract,e.prepend(t))}});var ur=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=bt(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const dr="core/dfn-abbr";function pr(e){const t=(n=e).dataset.abbr?n.dataset.abbr:n.textContent.match(/\b([a-z])/gi).join("").toUpperCase();var n;const r=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${r}">${t}</abbr>)`);const o=e.dataset.lt||"";e.dataset.lt=o.split("|").filter((e=>e.trim())).concat(t).join("|")}var fr=Object.freeze({__proto__:null,name:dr,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)pr(t);else{Nt(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,dr,{elements:[t],title:"Error: unsupported."})}}}});const hr=/^[a-z]+(\s+[a-z]+)+\??$/,mr=/\B"([^"]*)"\B/,gr=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,br=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,yr=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,wr=/^(?:\w+)\??$/,vr=/^(\w+)\["([\w- ]*)"\]$/,xr=/\.?(\w+\(.*\)$)/,kr=/\/(.+)/,$r=/\[\[.+\]\]/;function Er(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Je`<a + </div>`;const sr="aom/headers",ir={PD:"Pre-Draft",WGD:"AOM Work Group Draft",WGA:"AOM Working Group Approved Draft",FD:"AOM Final Deliverable"},ar=new Intl.DateTimeFormat(["en-US"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"});var cr=Object.freeze({__proto__:null,name:sr,run:function(e){if(!e.specStatus){Tt("Missing required configuration: `specStatus`",sr)}e.title=document.title||"No title",e.subtitle||(e.subtitle=""),e.publishDate=function(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=rt.format(r);return new Date(e)}return Tt(`[\`${t}\`](https://github.com/speced/respec/wiki/${t}) is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,sr),new Date(rt.format(new Date))}(e,"publishDate",document.lastModified),e.thisVersion=`https://aomediacodec.github.io/${e.shortName}/`,e.issueTracker=`https://github.com/AOMediaCodec/${e.shortName}/issues/`,e.publishYear=e.publishDate.getUTCFullYear(),e.publishHumanDate=ar.format(e.publishDate);const t=function(e){if(!e.name){Tt("All authors and editors must have a name.",sr)}};if(e.formerEditors||(e.formerEditors=[]),e.editors){e.editors.forEach(t);for(let t=0;t<e.editors.length;t++){const n=e.editors[t];"retiredDate"in n&&(e.formerEditors.push(n),e.editors.splice(t--,1))}}if(!e.editors||0===e.editors.length){Tt("At least one editor is required",sr)}e.formerEditors.length&&e.formerEditors.forEach(t),e.authors&&e.authors.forEach(t),e.multipleEditors=e.editors&&e.editors.length>1,e.multipleFormerEditors=e.formerEditors.length>1,e.multipleAuthors=e.authors&&e.authors.length>1,e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.textStatus=ir[e.specStatus],e.dashDate=rt.format(e.publishDate),e.publishISODate=e.publishDate.toISOString();const n=or(e);document.body.prepend(n),document.body.classList.add("h-entry"),zt("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const lr="aom/abstract",ur=ht({en:{abstract:"Abstract"}});var dr=Object.freeze({__proto__:null,name:lr,run:async function(){const e=document.getElementById("abstract");if(!e){return void Tt('Document must have one element with `id="abstract"',lr)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=ur.abstract,e.prepend(t))}});var pr=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=mt(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const fr="core/dfn-abbr";function hr(e){const t=(n=e).dataset.abbr?n.dataset.abbr:n.textContent.match(/\b([a-z])/gi).join("").toUpperCase();var n;const r=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${r}">${t}</abbr>)`);const o=e.dataset.lt||"";e.dataset.lt=o.split("|").filter((e=>e.trim())).concat(t).join("|")}var mr=Object.freeze({__proto__:null,name:fr,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)hr(t);else{Tt(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,fr,{elements:[t],title:"Error: unsupported."})}}}});const gr=/^[a-z]+(\s+[a-z]+)+\??$/,br=/\B"([^"]*)"\B/,yr=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,wr=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,vr=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,xr=/^(?:\w+)\??$/,kr=/^(\w+)\["([\w- ]*)"\]$/,$r=/\.?(\w+\(.*\)$)/,Er=/\/(.+)/,_r=/\[\[.+\]\]/;function Cr(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Qe`<a data-xref-type="_IDL_" data-link-type="idl" data-lt="${t}" ><code>${t+(r?"?":"")}</code></a - >`}function _r(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:s}=e,{identifier:i}=n||{},a="method"===r,c=a?Je`(${yt(s,Cr)})`:null,l=a?`(${s.join(", ")})`:"";return Je`${n&&o?".":""}<a + >`}function Sr(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:s}=e,{identifier:i}=n||{},a="method"===r,c=a?Qe`(${gt(s,Ar)})`:null,l=a?`(${s.join(", ")})`:"";return Qe`${n&&o?".":""}<a data-xref-type="${r}" data-link-type="${r}" data-link-for="${i}" data-xref-for="${i}" data-lt="${`[[${t}]]${l}`}" ><code>[[${t}]]${c}</code></a - >`}function Cr(e,t,n){if(t<n.length-1)return Je`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,s=o?r[2]:r[0];return Je`${o?"...":null}<var>${s}</var>`}function Sr(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return Je`${r?".":""}<a + >`}function Ar(e,t,n){if(t<n.length-1)return Qe`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,s=o?r[2]:r[0];return Qe`${o?"...":null}<var>${s}</var>`}function Lr(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return Qe`${r?".":""}<a data-link-type="idl" data-xref-type="attribute|dict-member|const" data-link-for="${o}" data-xref-for="${o}" ><code>${n}</code></a - >`}function Ar(e){const{args:t,identifier:n,type:r,parent:o,renderParent:s}=e,{renderText:i,renderArgs:a}=e,{identifier:c}=o||{},l=yt(a||t,Cr),u=`${n}(${t.join(", ")})`;return Je`${o&&s?".":""}<a + >`}function Tr(e){const{args:t,identifier:n,type:r,parent:o,renderParent:s}=e,{renderText:i,renderArgs:a}=e,{identifier:c}=o||{},l=gt(a||t,Ar),u=`${n}(${t.join(", ")})`;return Qe`${o&&s?".":""}<a data-link-type="idl" data-xref-type="${r}" data-link-for="${c}" data-xref-for="${c}" data-lt="${u}" ><code>${i||n}</code></a - >${!i||a?Je`<code>(${l})</code>`:""}`}function Lr(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return Je`"<a + >${!i||a?Qe`<code>(${l})</code>`:""}`}function Rr(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return Qe`"<a data-link-type="idl" data-xref-type="enum-value" data-link-for="${o}" data-xref-for="${o}" data-lt="${n?null:"the-empty-string"}" ><code>${n}</code></a - >"`}function Tr(e){const{identifier:t}=e;return Je`"<a + >"`}function Nr(e){const{identifier:t}=e;return Qe`"<a data-link-type="idl" data-cite="webidl" data-xref-type="exception" ><code>${t}</code></a - >"`}function Rr(e){const{identifier:t,nullable:n}=e;return Je`<a + >"`}function Or(e){const{identifier:t,nullable:n}=e;return Qe`<a data-link-type="idl" data-cite="webidl" data-xref-type="interface" data-lt="${t}" ><code>${t+(n?"?":"")}</code></a - >`}function Nr(e){let t;try{t=function(e){const t=$r.test(e),n=t?kr:xr,[r,o]=e.split(n);if(t&&r&&!o)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const s=r.split(/[./]/).concat(o).filter((e=>e&&e.trim())).map((e=>e.trim())),i=!e.includes("/"),a=[];for(;s.length;){const t=s.pop();if(gr.test(t)){const[,e,n,r,o]=t.match(gr),s=n.split(/,\s*/).filter((e=>e)),c=r?.trim(),l=o?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:s,renderParent:i,renderText:c,renderArgs:l})}else if(vr.test(t)){const[,e,n]=t.match(vr);a.push({type:"enum",identifier:e,enumValue:n,renderParent:i})}else if(mr.test(t)){const[,e]=t.match(mr);i?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:i})}else if(br.test(t)){const[,e,n]=t.match(br),r=n?"method":"attribute",o=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:o,renderParent:i})}else if(yr.test(t)&&s.length){const[,e]=t.match(yr);a.push({type:"attribute",identifier:e,renderParent:i})}else if(hr.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(!wr.test(t)||0!==s.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=Je`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Nt(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=Je(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Er(e);t&&r.push(t);break}case"attribute":r.push(Sr(e));break;case"internal-slot":r.push(_r(e));break;case"method":r.push(Ar(e));break;case"enum":r.push(Lr(e));break;case"exception":r.push(Tr(e));break;case"idl-primitive":r.push(Rr(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Or=new Set(["alias","reference"]),Ir=async function(){const e=await et.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[...Or]){const r=e.transaction(n,"readwrite").store,o=IDBKeyRange.lowerBound(t);let s=await r.openCursor(o);for(;s?.value;){const e=s.value;(void 0===e.expires||e.expires<t)&&await r.delete(e.id),s=await s.continue()}}return e}();const Pr={get ready(){return Ir},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!Or.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:r},async get(e,t){if(!Or.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),o=await n.openCursor(r);return o?o.value:o},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const o={id:r,...e[r],expires:t};o.aliasOf?n.alias.push(o):n.reference.push(o)}const r=[...Or].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!Or.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){const o=await this.get(e,t.id);if(o?.expires<Date.now()){const{store:o}=n.transaction(e,"readwrite");await o.delete(t.id),r=!1}}const{store:o}=n.transaction(e,"readwrite");return r?await o.put(t):await o.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Or],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},Dr={},jr=new URL("https://api.specref.org/bibrefs?refs="),zr=lt({hint:"dns-prefetch",href:jr.origin});let Mr;document.head.appendChild(zr);const qr=new Promise((e=>{Mr=e}));async function Fr(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter((e=>e.trim()));if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(jr.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const o=await r.json(),s=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),s):s;await Pr.addAll(o,e)}catch(e){console.error(e)}return o}async function Br(e){const t=await qr;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await Br(n.aliasOf):n}var Hr=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map((e=>e.toLowerCase())));Array.from(this.conf.informativeReferences).filter((t=>e.has(t.toLowerCase()))).forEach((e=>this.conf.informativeReferences.delete(e)))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=Dr;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio[e].aliasOf)).filter((e=>!this.conf.localBiblio.hasOwnProperty(e)));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter((e=>!this.conf.localBiblio.hasOwnProperty(e))).concat(e).sort())),r=n.length?await async function(e){const t=[];try{await Pr.ready;const n=e.map((async e=>({id:e,data:await Pr.find(e)})));t.push(...await Promise.all(n))}catch(n){t.push(...e.map((e=>({id:e,data:null})))),console.warn(n)}return t}(n):[],o={hasData:[],noData:[]};r.forEach((e=>{(e.data?o.hasData:o.noData).push(e)})),o.hasData.forEach((e=>{Dr[e.id]=e.data}));const s=o.noData.map((e=>e.id));if(s.length){const e=await Fr(s,{forceUpdate:!0});Object.assign(Dr,e)}Object.assign(Dr,this.conf.localBiblio),(()=>{Mr(this.conf.biblio)})()}},biblio:Dr,name:"core/biblio",resolveRef:Br,updateFromNetwork:Fr});const Wr="core/render-biblio",Ur=gt({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"ģ°øģ”°"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},ja:{info_references:"参ē…§ē”Øå‚č€ƒę–‡ēŒ®",norm_references:"č¦ēƄēš„å‚č€ƒę–‡ēŒ®",references:"å‚č€ƒę–‡ēŒ®"},de:{info_references:"WeiterfĆ¼hrende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"éžč§„čŒƒę€§å¼•ē”Ø",norm_references:"č§„čŒƒę€§å¼•ē”Ø",references:"å‚č€ƒę–‡ēŒ®"}}),Vr=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]),Zr=(Yr=".",e=>{const t=e.trim();return!t||t.endsWith(Yr)?t:t+Yr});var Yr;function Gr(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(Kr)),o=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),s=o.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),i=Je`<section> + >`}function Ir(e){let t;try{t=function(e){const t=_r.test(e),n=t?Er:$r,[r,o]=e.split(n);if(t&&r&&!o)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const s=r.split(/[./]/).concat(o).filter((e=>e&&e.trim())).map((e=>e.trim())),i=!e.includes("/"),a=[];for(;s.length;){const t=s.pop();if(yr.test(t)){const[,e,n,r,o]=t.match(yr),s=n.split(/,\s*/).filter((e=>e)),c=r?.trim(),l=o?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:s,renderParent:i,renderText:c,renderArgs:l})}else if(kr.test(t)){const[,e,n]=t.match(kr);a.push({type:"enum",identifier:e,enumValue:n,renderParent:i})}else if(br.test(t)){const[,e]=t.match(br);i?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:i})}else if(wr.test(t)){const[,e,n]=t.match(wr),r=n?"method":"attribute",o=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:o,renderParent:i})}else if(vr.test(t)&&s.length){const[,e]=t.match(vr);a.push({type:"attribute",identifier:e,renderParent:i})}else if(gr.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(!xr.test(t)||0!==s.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=Qe`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Tt(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=Qe(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Cr(e);t&&r.push(t);break}case"attribute":r.push(Lr(e));break;case"internal-slot":r.push(Sr(e));break;case"method":r.push(Tr(e));break;case"enum":r.push(Rr(e));break;case"exception":r.push(Nr(e));break;case"idl-primitive":r.push(Or(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Pr=new Set(["alias","reference"]),Dr=async function(){const e=await Xe.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[...Pr]){const r=e.transaction(n,"readwrite").store,o=IDBKeyRange.lowerBound(t);let s=await r.openCursor(o);for(;s?.value;){const e=s.value;(void 0===e.expires||e.expires<t)&&await r.delete(e.id),s=await s.continue()}}return e}();const jr={get ready(){return Dr},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!Pr.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:r},async get(e,t){if(!Pr.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),o=await n.openCursor(r);return o?o.value:o},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const o={id:r,...e[r],expires:t};o.aliasOf?n.alias.push(o):n.reference.push(o)}const r=[...Pr].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!Pr.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){const o=await this.get(e,t.id);if(o?.expires<Date.now()){const{store:o}=n.transaction(e,"readwrite");await o.delete(t.id),r=!1}}const{store:o}=n.transaction(e,"readwrite");return r?await o.put(t):await o.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Pr],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},zr={},Mr=new URL("https://api.specref.org/bibrefs?refs="),qr=at({hint:"dns-prefetch",href:Mr.origin});let Fr;document.head.appendChild(qr);const Br=new Promise((e=>{Fr=e}));async function Hr(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter((e=>e.trim()));if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(Mr.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const o=await r.json(),s=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),s):s;await jr.addAll(o,e)}catch(e){console.error(e)}return o}async function Wr(e){const t=await Br;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await Wr(n.aliasOf):n}var Ur=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map((e=>e.toLowerCase())));Array.from(this.conf.informativeReferences).filter((t=>e.has(t.toLowerCase()))).forEach((e=>this.conf.informativeReferences.delete(e)))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=zr;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio[e].aliasOf)).filter((e=>!this.conf.localBiblio.hasOwnProperty(e)));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter((e=>!this.conf.localBiblio.hasOwnProperty(e))).concat(e).sort())),r=n.length?await async function(e){const t=[];try{await jr.ready;const n=e.map((async e=>({id:e,data:await jr.find(e)})));t.push(...await Promise.all(n))}catch(n){t.push(...e.map((e=>({id:e,data:null})))),console.warn(n)}return t}(n):[],o={hasData:[],noData:[]};r.forEach((e=>{(e.data?o.hasData:o.noData).push(e)})),o.hasData.forEach((e=>{zr[e.id]=e.data}));const s=o.noData.map((e=>e.id));if(s.length){const e=await Hr(s,{forceUpdate:!0});Object.assign(zr,e)}Object.assign(zr,this.conf.localBiblio),(()=>{Fr(this.conf.biblio)})()}},biblio:zr,name:"core/biblio",resolveRef:Wr,updateFromNetwork:Hr});const Vr="core/render-biblio",Zr=ht({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"ģ°øģ”°"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},ja:{info_references:"参ē…§ē”Øå‚č€ƒę–‡ēŒ®",norm_references:"č¦ēƄēš„å‚č€ƒę–‡ēŒ®",references:"å‚č€ƒę–‡ēŒ®"},de:{info_references:"WeiterfĆ¼hrende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"éžč§„čŒƒę€§å¼•ē”Ø",norm_references:"č§„čŒƒę€§å¼•ē”Ø",references:"å‚č€ƒę–‡ēŒ®"}}),Yr=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]),Gr=(Kr=".",e=>{const t=e.trim();return!t||t.endsWith(Kr)?t:t+Kr});var Kr;function Qr(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(Xr)),o=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),s=o.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),i=Qe`<section> <h3>${t}</h3> - <dl class="bibliography">${s.map(Xr)}</dl> - </section>`;wt(i,"",t);const a=function(e){return e.reduce(((e,t)=>{const n=t.refcontent.id;return(e.has(n)?e.get(n):e.set(n,[]).get(n)).push(t.ref),e}),new Map)}(n);return function(e,t){e.map((({ref:e,refcontent:n})=>{const r=`#bib-${e.toLowerCase()}`,o=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(o),refcontent:n}})).forEach((({refUrl:e,elems:t,refcontent:n})=>{t.forEach((t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"}))}))}(o,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#bib-${t.toLowerCase()}"]`)].filter((({textContent:e})=>e.toLowerCase()===t.toLowerCase()));Nt(`Reference "[${t}]" not found.`,Wr,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),i}function Kr(e){let t=Dr[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Nt(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,Wr)}else n=t.aliasOf,t=Dr[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function Qr(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,o=Je`<cite + <dl class="bibliography">${s.map(eo)}</dl> + </section>`;bt(i,"",t);const a=function(e){return e.reduce(((e,t)=>{const n=t.refcontent.id;return(e.has(n)?e.get(n):e.set(n,[]).get(n)).push(t.ref),e}),new Map)}(n);return function(e,t){e.map((({ref:e,refcontent:n})=>{const r=`#bib-${e.toLowerCase()}`,o=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(o),refcontent:n}})).forEach((({refUrl:e,elems:t,refcontent:n})=>{t.forEach((t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"}))}))}(o,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#bib-${t.toLowerCase()}"]`)].filter((({textContent:e})=>e.toLowerCase()===t.toLowerCase()));Tt(`Reference "[${t}]" not found.`,Vr,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),i}function Xr(e){let t=zr[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Tt(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,Vr)}else n=t.aliasOf,t=zr[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function Jr(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,o=Qe`<cite ><a class="bibref" href="${r}" data-link-type="biblio">${t||n}</a></cite - >`;return t?o:Je`[${o}]`}function Xr(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return Je` + >`;return t?o:Qe`[${o}]`}function eo(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return Qe` <dt id="${r}">[${t}]</dt> <dd> - ${n?{html:Jr(n)}:Je`<em class="respec-offending-element" - >${Ur.reference_not_found}</em + ${n?{html:to(n)}:Qe`<em class="respec-offending-element" + >${Zr.reference_not_found}</em >`} </dd> - `}function Jr(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${Zr(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${Vr.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var eo=Object.freeze({__proto__:null,name:Wr,renderInlineCitation:Qr,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")||Je`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(Je`<h1>${Ur.references}</h1>`),r.classList.add("appendix"),n.length){const e=Gr(n,Ur.norm_references);r.appendChild(e)}if(t.length){const e=Gr(t,Ur.info_references);r.appendChild(e)}document.body.appendChild(r)}});const to="core/inlines",no={},ro=e=>new RegExp(e.map((e=>e.source)).join("|")),oo=gt({en:{rfc2119Keywords:()=>ro([/\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:()=>ro([/\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/])}}),so=/(?:`[^`]+`)(?!`)/,io=/(?:{{[^}]+\?*}})/,ao=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,co=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,lo=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,uo=/(?:\[=[^=]+=\])/,po=/(?:\[\^[^^]+\^\])/;function fo(e){const t=e.slice(2,-2).trim(),[n,r,o]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[s,i,a]=t.startsWith("/")?["element-attr",null,n]:o?["attr-value",`${n}/${r}`,o]:r?["element-attr",n,r]:["element",null,n];return Je`<code + `}function to(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t.endsWith(".")||(t+=". ")),e.publisher&&(t=`${t} ${Gr(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${Yr.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var no=Object.freeze({__proto__:null,name:Vr,renderInlineCitation:Jr,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")||Qe`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(Qe`<h1>${Zr.references}</h1>`),r.classList.add("appendix"),n.length){const e=Qr(n,Zr.norm_references);r.appendChild(e)}if(t.length){const e=Qr(t,Zr.info_references);r.appendChild(e)}document.body.appendChild(r)}});const ro="core/inlines",oo={},so=e=>new RegExp(e.map((e=>e.source)).join("|")),io=ht({en:{rfc2119Keywords:()=>so([/\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:()=>so([/\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/])}}),ao=/(?:`[^`]+`)(?!`)/,co=/(?:{{[^}]+\?*}})/,lo=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,uo=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,po=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,fo=/(?:\[=[^=]+=\])/,ho=/(?:\[\^[^^]+\^\])/;function mo(e){const t=e.slice(2,-2).trim(),[n,r,o]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[s,i,a]=t.startsWith("/")?["element-attr",null,n]:o?["attr-value",`${n}/${r}`,o]:r?["element-attr",n,r]:["element",null,n];return Qe`<code ><a data-xref-type="${s}" data-xref-for="${i}" @@ -293,34 +293,34 @@ dd{margin-left:0} data-link-for="${i}" >${a}</a ></code - >`}function ho(e){const t=mt(e),n=Je`<em class="rfc2119">${t}</em>`;return no[t]=!0,n}function mo(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?Je`<a href="${t}" data-matched-text="${e}"></a>`:Je`<a data-cite="${t}" data-matched-text="${e}"></a>`}function go(e,t){const n=mt(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=Nr(n);return!!t.parentElement.closest("dfn,a")?xo(`\`${r.textContent}\``):r}function bo(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,s]=r.split("|").map(mt),{type:i,illegal:a}=kt(o,t.parentElement),c=Qr(o,s),l=o.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;Ot("Normative references in informative sections are not allowed. ",to,{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 yo(e,t,n){return"ABBR"===t.parentElement.tagName?e:Je`<abbr title="${n.get(e)}">${e}</abbr>`}function wo(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return Je`<var data-type="${r}">${n}</var>`}function vo(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(mt).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const o=n.substring(0,r),s=n.substring(r+1,n.length);return[t(o),t(s)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[o,s]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],i=ko(s),a=n?mt(n):null;return Je`<a + >`}function go(e){const t=ft(e),n=Qe`<em class="rfc2119">${t}</em>`;return oo[t]=!0,n}function bo(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?Qe`<a href="${t}" data-matched-text="${e}"></a>`:Qe`<a data-cite="${t}" data-matched-text="${e}"></a>`}function yo(e,t){const n=ft(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=Ir(n);return!!t.parentElement.closest("dfn,a")?$o(`\`${r.textContent}\``):r}function wo(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,s]=r.split("|").map(ft),{type:i,illegal:a}=vt(o,t.parentElement),c=Jr(o,s),l=o.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;Rt("Normative references in informative sections are not allowed. ",ro,{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 vo(e,t,n){return"ABBR"===t.parentElement.tagName?e:Qe`<abbr title="${n.get(e)}">${e}</abbr>`}function xo(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return Qe`<var data-type="${r}">${n}</var>`}function ko(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(ft).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const o=n.substring(0,r),s=n.substring(r+1,n.length);return[t(o),t(s)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[o,s]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],i=Eo(s),a=n?ft(n):null;return Qe`<a data-link-type="dfn|abstract-op" data-link-for="${a}" data-xref-for="${a}" data-lt="${o}" >${i}</a - >`}function xo(e){const t=e.slice(1,-1);return Je`<code>${t}</code>`}function ko(e){return so.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?xo(e):ko(e))):document.createTextNode(e)}var $o=Object.freeze({__proto__:null,name:to,rfc2119Usage:no,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new Ct,e.informativeReferences=new Ct,e.respecRFC2119||(e.respecRFC2119=no);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=mt(e),o=mt(r);t.set(n,o)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,o=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=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)),s=[];let i;for(;i=o.nextNode();)s.push(i);return s}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),s=oo.rfc2119Keywords(),i=new RegExp(`(${ro([s,io,ao,co,lo,uo,so,po,...r?[r]:[]]).source})`);for(const n of o){const r=n.data.split(i);if(1===r.length)continue;const o=document.createDocumentFragment();let a=!0;for(const i of r)if(a=!a,a)switch(!0){case i.startsWith("{{"):o.append(go(i,n));break;case i.startsWith("[[["):o.append(mo(i));break;case i.startsWith("[["):o.append(...bo(i,n,e));break;case i.startsWith("|"):o.append(wo(i));break;case i.startsWith("[="):o.append(vo(i));break;case i.startsWith("`"):o.append(xo(i));break;case i.startsWith("[^"):o.append(fo(i));break;case t.has(i):o.append(yo(i,n,t));break;case s.test(i):o.append(ho(i))}else o.append(i);n.replaceWith(o)}}});const Eo="aom/conformance",_o=gt({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)=>Je`<p> + >`}function $o(e){const t=e.slice(1,-1);return Qe`<code>${t}</code>`}function Eo(e){return ao.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?$o(e):Eo(e))):document.createTextNode(e)}var _o=Object.freeze({__proto__:null,name:ro,rfc2119Usage:oo,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new Et,e.informativeReferences=new Et,e.respecRFC2119||(e.respecRFC2119=oo);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=ft(e),o=ft(r);t.set(n,o)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,o=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=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)),s=[];let i;for(;i=o.nextNode();)s.push(i);return s}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),s=io.rfc2119Keywords(),i=new RegExp(`(${so([s,co,lo,uo,po,fo,ao,ho,...r?[r]:[]]).source})`);for(const n of o){const r=n.data.split(i);if(1===r.length)continue;const o=document.createDocumentFragment();let a=!0;for(const i of r)if(a=!a,a)switch(!0){case i.startsWith("{{"):o.append(yo(i,n));break;case i.startsWith("[[["):o.append(bo(i));break;case i.startsWith("[["):o.append(...wo(i,n,e));break;case i.startsWith("|"):o.append(xo(i));break;case i.startsWith("[="):o.append(ko(i));break;case i.startsWith("`"):o.append($o(i));break;case i.startsWith("[^"):o.append(mo(i));break;case t.has(i):o.append(vo(i,n,t));break;case s.test(i):o.append(go(i))}else o.append(i);n.replaceWith(o)}}});const Co="aom/conformance",So=ht({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)=>Qe`<p> The key word${t?"s":""} ${e} in this document ${t?"are":"is"} to be interpreted as described in <a href="https://datatracker.ietf.org/doc/html/bcp14">BCP 14</a> - ${Qr("RFC2119")} ${Qr("RFC8174")} + ${Jr("RFC2119")} ${Jr("RFC8174")} when, and only when, they appear in all capitals, as shown here. - </p>`}});function Co(e,t){const n=[...Object.keys(no)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=(o=n.sort(),[].concat(pt(o,(e=>Je`<em class="rfc2119">${e}</em>`))).map((e=>"string"==typeof e?Je`${e}`:e)));var o;const s=n.length>1,i=Je` - <h1>${_o.conformance}</h1> - <p>${_o.normativity}</p> - ${n.length?_o.keywordInterpretation(r,s):null} - `;e.prepend(...i.childNodes)}var So=Object.freeze({__proto__:null,name:Eo,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&Co(t,e),!t&&Object.keys(no).length){Ot("Document uses RFC2119 keywords but lacks a conformance section.",Eo,{hint:'Please add a `<section id="conformance">`.'})}}});function Ao(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){Nt(`Invalid ${t} name "${e}": ${o.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function Lo(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Nt(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const To=new Tt;function Ro(e,t){for(const n of t)To.has(n)||To.set(n,new Set),To.get(n).add(e)}const No="core/dfn",Oo=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Lo}],["element",{requiresFor:!1,validator:Ao}],["element-attr",{requiresFor:!1,validator:Ao}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Lo}],["event",{requiresFor:!1,validator:Lo}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new nt(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return Nt(`Invalid ${t} "${e}": ${o.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:Lo}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Lo(e.slice(1,-1),t,n,r):(Nt(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Io=[...Oo.keys()];function Po(e,t){let n="";switch(!0){case Io.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>Oo.has(e))),function(e,t,n){const r=Oo.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=jt`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,s=jt`Use a ${"[data-dfn-for]"} attribute to associate this with ${o}.`;Nt(e,No,{hint:s,elements:[n]})}r.validator&&r.validator(e,t,n,No)}(t,n,e);break;case br.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=jt`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Nt(`Internal slot "${e}" must be associated with a WebIDL interface.`,No,{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 o=["attribute","method"],{dfnType:s}=t.dataset;if(!o.includes(s)||r!==s){const n=jt`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,s=`The only allowed types are: ${Dt(o,{quotes:!0})}. The slot "${e}" seems to be a "${Pt(r)}"?`;return Nt(n,No,{hint:s,elements:[t]}),"dfn"}return s}(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 Do(e){switch(!0){case e.matches(".export.no-export"):Nt(jt`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,No,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Nt(jt`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,No,{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 jo=Object.freeze({__proto__:null,name:No,run:function(){for(const e of document.querySelectorAll("dfn")){const t=vt(e);if(Ro(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;Po(e,n),Do(e),1===t.length&&n===mt(e.textContent)||(e.dataset.lt=t.join("|"))}}});var zo=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=mt(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=mt(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=mt(n).toLowerCase(),o=rt.isSingular(r)?rt.plural(r):rt.singular(r);return e.has(o)&&!t.has(o)?o:""}}();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("|"),Ro(e,n)}}))}});var Mo=String.raw`span.example-title{text-transform:none} + </p>`}});function Ao(e,t){const n=[...Object.keys(oo)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=(o=n.sort(),[].concat(ut(o,(e=>Qe`<em class="rfc2119">${e}</em>`))).map((e=>"string"==typeof e?Qe`${e}`:e)));var o;const s=n.length>1,i=Qe` + <h1>${So.conformance}</h1> + <p>${So.normativity}</p> + ${n.length?So.keywordInterpretation(r,s):null} + `;e.prepend(...i.childNodes)}var Lo=Object.freeze({__proto__:null,name:Co,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&Ao(t,e),!t&&Object.keys(oo).length){Rt("Document uses RFC2119 keywords but lacks a conformance section.",Co,{hint:'Please add a `<section id="conformance">`.'})}}});function To(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){Tt(`Invalid ${t} name "${e}": ${o.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function Ro(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Tt(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const No=new At;function Oo(e,t){for(const n of t)No.has(n)||No.set(n,new Set),No.get(n).add(e)}const Io="core/dfn",Po=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Ro}],["element",{requiresFor:!1,validator:To}],["element-attr",{requiresFor:!1,validator:To}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Ro}],["event",{requiresFor:!1,validator:Ro}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new et(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return Tt(`Invalid ${t} "${e}": ${o.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:Ro}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Ro(e.slice(1,-1),t,n,r):(Tt(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Do=[...Po.keys()];function jo(e,t){let n="";switch(!0){case Do.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>Po.has(e))),function(e,t,n){const r=Po.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=Pt`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,s=Pt`Use a ${"[data-dfn-for]"} attribute to associate this with ${o}.`;Tt(e,Io,{hint:s,elements:[n]})}r.validator&&r.validator(e,t,n,Io)}(t,n,e);break;case wr.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=Pt`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Tt(`Internal slot "${e}" must be associated with a WebIDL interface.`,Io,{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 o=["attribute","method"],{dfnType:s}=t.dataset;if(!o.includes(s)||r!==s){const n=Pt`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,s=`The only allowed types are: ${It(o,{quotes:!0})}. The slot "${e}" seems to be a "${Ot(r)}"?`;return Tt(n,Io,{hint:s,elements:[t]}),"dfn"}return s}(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 zo(e){switch(!0){case e.matches(".export.no-export"):Tt(Pt`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Io,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Tt(Pt`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Io,{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 Mo=Object.freeze({__proto__:null,name:Io,run:function(){for(const e of document.querySelectorAll("dfn")){const t=yt(e);if(Oo(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;jo(e,n),zo(e),1===t.length&&n===ft(e.textContent)||(e.dataset.lt=t.join("|"))}}});var qo=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=ft(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=ft(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=ft(n).toLowerCase(),o=tt.isSingular(r)?tt.plural(r):tt.singular(r);return e.has(o)&&!t.has(o)?o:""}}();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("|"),Oo(e,n)}}))}});var Fo=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 qo=gt({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"ģ˜ˆģ‹œ"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function Fo(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?Je`<span class="example-title">: ${n.title}</span>`:"";return Je`<div class="marker"> - <a class="self-link">${qo.example}<bdi>${r}</bdi></a +aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff}`;const Bo=ht({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"ģ˜ˆģ‹œ"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function Ho(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?Qe`<span class="example-title">: ${n.title}</span>`:"";return Qe`<div class="marker"> + <a class="self-link">${Bo.example}<bdi>${r}</bdi></a >${o} - </div>`}var Bo=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(Je`<style> - ${Mo} - </style>`,document.querySelector("link"));let t=0;e.forEach((e=>{const n=e.classList.contains("illegal-example"),r={number:t,illegal:n},{title:o}=e;if("aside"===e.localName){++t;const n=Fo(e,t,r);e.prepend(n);const s=wt(e,"example",o||String(t));n.querySelector("a.self-link").href=`#${s}`}else{const n=!!e.closest("aside");n||++t,r.content=e.innerHTML,e.classList.remove("example","illegal-example");const s=e.id?e.id:null;s&&e.removeAttribute("id");const i=Fo(e,n?0:t,r),a=Je`<div class="example" id="${s}"> + </div>`}var Wo=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(Qe`<style> + ${Fo} + </style>`,document.querySelector("link"));let t=0;e.forEach((e=>{const n=e.classList.contains("illegal-example"),r={number:t,illegal:n},{title:o}=e;if("aside"===e.localName){++t;const n=Ho(e,t,r);e.prepend(n);const s=bt(e,"example",o||String(t));n.querySelector("a.self-link").href=`#${s}`}else{const n=!!e.closest("aside");n||++t,r.content=e.innerHTML,e.classList.remove("example","illegal-example");const s=e.id?e.id:null;s&&e.removeAttribute("id");const i=Ho(e,n?0:t,r),a=Qe`<div class="example" id="${s}"> ${i} ${e.cloneNode(!0)} - </div>`;wt(a,"example",o||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var Ho=String.raw`.issue-label{text-transform:initial} + </div>`;bt(a,"example",o||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var Uo=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} @@ -330,39 +330,39 @@ 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 Wo="core/issues-notes",Uo=gt({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:"č­¦å‘Š"}});function Vo(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}}(),o=document.createElement("ul");e.forEach((e=>{const{type:s,displayType:i,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),o=e.classList.contains("atrisk"),s=t?"issue":n?"warning":r?"ednote":"note",i=t?o?Uo.feature_at_risk:Uo.issue:n?Uo.warning:r?Uo.editors_note:Uo.note;return{type:s,displayType:i,isFeatureAtRisk:o}}(e),c="issue"===s,l="span"===e.localName,{number:u}=e.dataset,d={type:s,inline:l,title:e.title,number:r(e)};if(!l){const r=Je`<div class="${a?`${s} atrisk`:s}" role="${"note"===s?"note":null}"></div>`,l=document.createElement("span"),p=Je`<div role="heading" class="${`${s}-title marker`}">${l}</div>`;wt(p,"h",s);let f,h=i;if(e.id?(r.id=e.id,e.removeAttribute("id")):wt(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 Je`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return Je`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),f=t.get(u),!f){Ot(`Failed to fetch issue number ${u}.`,Wo)}f&&!d.title&&(d.title=f.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?Je`<span style="text-transform: none">: ${t.title}</span>`:"";return Je`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(Uo.issue,d,r.id))}if(l.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},o=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,o=new URL("./issues/",t);o.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const s=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[o,s,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*o+.7152*s+.0722*i>.179?"#000":"#fff"}(n),i=`background-color: #${n}; color: ${s}`,a=`GitHub label: ${r}`;return Je` <a +.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 Vo="core/issues-notes",Zo=ht({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:"č­¦å‘Š"}});function Yo(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}}(),o=document.createElement("ul");e.forEach((e=>{const{type:s,displayType:i,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),o=e.classList.contains("atrisk"),s=t?"issue":n?"warning":r?"ednote":"note",i=t?o?Zo.feature_at_risk:Zo.issue:n?Zo.warning:r?Zo.editors_note:Zo.note;return{type:s,displayType:i,isFeatureAtRisk:o}}(e),c="issue"===s,l="span"===e.localName,{number:u}=e.dataset,d={type:s,inline:l,title:e.title,number:r(e)};if(!l){const r=Qe`<div class="${a?`${s} atrisk`:s}" role="${"note"===s?"note":null}"></div>`,l=document.createElement("span"),p=Qe`<div role="heading" class="${`${s}-title marker`}">${l}</div>`;bt(p,"h",s);let f,h=i;if(e.id?(r.id=e.id,e.removeAttribute("id")):bt(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 Qe`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return Qe`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),f=t.get(u),!f){Rt(`Failed to fetch issue number ${u}.`,Vo)}f&&!d.title&&(d.title=f.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?Qe`<span style="text-transform: none">: ${t.title}</span>`:"";return Qe`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(Zo.issue,d,r.id))}if(l.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},o=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,o=new URL("./issues/",t);o.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const s=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[o,s,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*o+.7152*s+.0722*i>.179?"#000":"#fff"}(n),i=`background-color: #${n}; color: ${s}`,a=`GitHub label: ${r}`;return Qe` <a class="respec-gh-label" style="${i}" href="${o.href}" aria-label="${a}" >${r}</a - >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return Je`<span class="issue-label">: ${t}${r}</span>`}(o,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(s),m.removeAttribute("data-number"),f&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(f.bodyHTML)),r.append(p,m);const g=Et(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(Je`<p>${Uo.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${Uo.issue_summary}</h1>`)}(o)}var Zo=Object.freeze({__proto__:null,name:Wo,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 Nt(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,Wo),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github),{head:o}=document;o.insertBefore(Je`<style> - ${Ho} - </style>`,o.querySelector("link")),Vo(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const Yo="core/best-practices",Go={en:{best_practice:"Best Practice "},ja:{best_practice:"꜀č‰Æå®Ÿę–½ä¾‹ "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"ęœ€ä½³å®žč·µ "}},Ko=gt(Go),Qo=l in Go?l:"en";var Xo=Object.freeze({__proto__:null,name:Yo,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=wt(e,"bp"),o=Je`<a class="marker self-link" href="${`#${r}`}" - ><bdi lang="${Qo}">${Ko.best_practice}${t+1}</bdi></a - >`;if(n){const t=Je`<li>${o}: ${St(e)}</li>`;n.appendChild(t)}const s=e.closest("div");if(!s)return void e.classList.add("advisement");s.classList.add("advisement");const i=Je`${o.cloneNode(!0)}: ${e}`;s.prepend(...i.childNodes)})),e.length)t&&(t.appendChild(Je`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){Ot("Using best practices summary (#bp-summary) but no best practices found.",Yo),t.remove()}}});const Jo="core/figures",es=gt({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 ts=Object.freeze({__proto__:null,name:Jo,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;wt(e,"fig",r),$t(t,Je`<span class="fig-title"></span>`),t.prepend(Je`<a class="self-link" href="#${e.id}" - >${es.fig}<bdi class="figno">${n+1}</bdi></a - >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{xt(e,"span").removeAttribute("href")})),Je`<li class="tofline"> + >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return Qe`<span class="issue-label">: ${t}${r}</span>`}(o,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(s),m.removeAttribute("data-number"),f&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(f.bodyHTML)),r.append(p,m);const g=kt(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(Qe`<p>${Zo.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${Zo.issue_summary}</h1>`)}(o)}var Go=Object.freeze({__proto__:null,name:Vo,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 Tt(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,Vo),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github),{head:o}=document;o.insertBefore(Qe`<style> + ${Uo} + </style>`,o.querySelector("link")),Yo(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const Ko="core/best-practices",Qo={en:{best_practice:"Best Practice "},ja:{best_practice:"꜀č‰Æå®Ÿę–½ä¾‹ "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"ęœ€ä½³å®žč·µ "}},Xo=ht(Qo),Jo=s in Qo?s:"en";var es=Object.freeze({__proto__:null,name:Ko,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=bt(e,"bp"),o=Qe`<a class="marker self-link" href="${`#${r}`}" + ><bdi lang="${Jo}">${Xo.best_practice}${t+1}</bdi></a + >`;if(n){const t=Qe`<li>${o}: ${_t(e)}</li>`;n.appendChild(t)}const s=e.closest("div");if(!s)return void e.classList.add("advisement");s.classList.add("advisement");const i=Qe`${o.cloneNode(!0)}: ${e}`;s.prepend(...i.childNodes)})),e.length)t&&(t.appendChild(Qe`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){Rt("Using best practices summary (#bp-summary) but no best practices found.",Ko),t.remove()}}});const ts="core/figures",ns=ht({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 rs=Object.freeze({__proto__:null,name:ts,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;bt(e,"fig",r),xt(t,Qe`<span class="fig-title"></span>`),t.prepend(Qe`<a class="self-link" href="#${e.id}" + >${ns.fig}<bdi class="figno">${n+1}</bdi></a + >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{wt(e,"span").removeAttribute("href")})),Qe`<li class="tofline"> <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a> - </li>`}(t.id,r));else{Ot("Found a `<figure>` without a `<figcaption>`.",Jo,{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=function(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}(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(Je`<h1>${es.list_of_figures}</h1>`,Je`<ul class="tof"> + </li>`}(t.id,r));else{Rt("Found a `<figure>` without a `<figcaption>`.",ts,{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=function(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}(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(Qe`<h1>${ns.list_of_figures}</h1>`,Qe`<ul class="tof"> ${e} - </ul>`))}});const ns="core/data-cite",rs="__SPEC__";async function os(e){const{key:t,frag:n,path:r,href:o}=e;let s="",i="";if(t===rs)s=document.location.href;else{const e=await Br(t);if(!e)return null;s=e.href,i=e.title}if(o)s=o;else{if(r){const e=r.startsWith("/")?`.${r}`:r;s=new URL(e,s).href}n&&(s=new URL(n,s).href)}return{href:s,title:i}}function ss(e,t,n){const{href:r,title:o}=t,s=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=o),t.href=r,s){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?$t(e,t):(t.textContent=o,e.append(t)),s){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Nt("Exporting a linked external definition is not allowed.",ns,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function is(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const as=is("#"),cs=is("/");function ls(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:o,citeHref:s}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:o,isNormative:s}=r?ls(r):{key:rs,isNormative:!1};return t.cite=s?o:`?${o}`,t.citeFrag=n.replace("#",""),ls(e)}const i=r?`#${r}`:as(n),a=o||cs(n).split("#")[0],{type:c}=kt(n,e),l="normative"===c,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:i,path:a,href:s}}function us(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 ds=Object.freeze({__proto__:null,THIS_SPEC:rs,name:ns,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(ls).map((async e=>({entry:e,result:await Br(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await Fr(n);r&&Object.assign(Dr,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=ls(t),r=await os(n);if(r)ss(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),Ot(n,ns,{elements:[t]})}}s("beforesave",us)},toCiteDetails:ls});const ps="core/link-to-dfn",fs=[],hs={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:"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚"}},ms=gt(hs);function gs(e){const t=new Map,n=[];for(const r of To.get(e)){const{dfnType:o="dfn"}=r.dataset,s=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const i of s){if(t.has(i)&&t.get(i).has(o)){const e=t.get(i).get(o),s="dfn"===e.localName,a="dfn"===r.localName,c=o===(e.dataset.dfnType||"dfn"),l=!i&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(i);if(s&&a&&c&&l){n.push(r);continue}}t.has(i)||t.set(i,new Map),t.get(i).set(o,r),("idl"in r.dataset||"dfn"!==o)&&t.get(i).set("idl",r),wt(r,"dfn",e)}}return{result:t,duplicates:n}}function bs(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=vt(e).reduce(((e,r)=>{const o=r.split(".");return 2===o.length&&e.push({for:o[0],title:o[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 o=t.get(r.title).get(r.for),{linkType:s}=e.dataset;if(s){for(const e of s.split("|"))if(o.get(e))return o.get(e);return o.get("dfn")}{const e=r.for?"idl":"dfn";return o.get(e)||o.get("idl")}}function ys(e,t,n){let r=!1;const{linkFor:o}=e.dataset,{dfnFor:s}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(o&&!n.get(o)&&s&&!s.split(",").map((e=>e.trim())).includes(o))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"),o=ws(e)&&ws(t,n);r&&!o||$t(e,document.createElement("code"))}(e,t),!r}function ws(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 vs(e){e.forEach((e=>{Ot(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,ps,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var xs=Object.freeze({__proto__:null,name:ps,possibleExternalLinks:fs,run:async function(e){const t=function(){const e=new Tt;for(const t of To.keys()){const{result:n,duplicates:r}=gs(t);e.set(t,n),r.length>0&&Nt(ms.duplicateMsg(t),ps,{title:ms.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){fs.push(e);continue}const r=bs(e,t);if(r){ys(e,r,t)||fs.push(e)}else""===e.dataset.cite?n.push(e):fs.push(e)}vs(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${rs}$2`);const{key:r,isNormative:o}=ls(t);r!==rs&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||vs(fs)}});const ks="core/contrib";var $s=Object.freeze({__proto__:null,name:ks,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Nt(jt`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,ks)}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 o();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 Je(t)`${n.map((({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`))}`;const r=n.map((e=>e.name||e.login));t.textContent=ht(r)}(r,n):n.textContent="Failed to fetch contributors.";async function o(){const{href:n}=new URL("contributors",t);try{const t=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let o,s;if("caches"in window)try{if(o=await caches.open(r.origin),s=await o.match(n),s&&new Date(s.headers.get("Expires"))>new Date)return s}catch(e){console.error("Failed to use Cache API.",e)}const i=await fetch(n);if(!i.ok&&s)return console.warn(`Returning a stale cached response for ${r}`),s;if(o&&i.ok){const e=i.clone(),r=new Headers(i.headers),s=new Date(Date.now()+t);r.set("Expires",s.toISOString());const a=new Response(await e.blob(),{headers:r});await o.put(n,a).catch(console.error)}return i}(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 Nt("Error loading contributors from GitHub.",ks),console.error(e),null}}}(t,n)}});var Es=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);xt(e,`h${t}`)}))}});const _s=["h2","h3","h4","h5","h6"],Cs="core/structure",Ss=gt({en:{toc:"Table of Contents"},zh:{toc:"内容大ēŗ²"},ko:{toc:"ėŖ©ģ°Ø"},ja:{toc:"ē›®ę¬”"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function As(e,t,{prefix:n=""}={}){let r=!1,o=0,s=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const i=Je`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=s,r=!0);let e=a.isIntro?"":r?Ls(s-o+1):n+s;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(s+=1,a.header.prepend(Je`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=Rs(a.header,n),o=As(a.subsections,t,{prefix:e});o&&r.append(o),i.append(r)}}return i}function Ls(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Ts(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(!_s.includes(r.localName))continue;const o=r.textContent;wt(e,null,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Ts(e)})}return n}function Rs(e,t){const n=Je`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=xt(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{xt(e,"span").removeAttribute("id")})),Je`<li class="tocline">${n}</li>`}var Ns=Object.freeze({__proto__:null,name:Cs,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(Et(e,"section").length+1,6)}`;e.localName!==t&&xt(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)){Nt("`data-max-toc` must have a value between 0-6 (inclusive).",Cs,{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=As(Ts(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=Je`<nav id="toc"></nav>`,n=Je`<h2 class="introductory">${Ss.toc}</h2>`;wt(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 o=Je`<p role="navigation" id="back-to-top"> + </ul>`))}});const os="core/data-cite",ss="__SPEC__";async function is(e){const{key:t,frag:n,path:r,href:o}=e;let s="",i="";if(t===ss)s=document.location.href;else{const e=await Wr(t);if(!e)return null;s=e.href,i=e.title}if(o)s=o;else{if(r){const e=r.startsWith("/")?`.${r}`:r;s=new URL(e,s).href}n&&(s=new URL(n,s).href)}return{href:s,title:i}}function as(e,t,n){const{href:r,title:o}=t,s=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=o),t.href=r,s){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?xt(e,t):(t.textContent=o,e.append(t)),s){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Tt("Exporting a linked external definition is not allowed.",os,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function cs(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const ls=cs("#"),us=cs("/");function ds(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:o,citeHref:s}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:o,isNormative:s}=r?ds(r):{key:ss,isNormative:!1};return t.cite=s?o:`?${o}`,t.citeFrag=n.replace("#",""),ds(e)}const i=r?`#${r}`:ls(n),a=o||us(n).split("#")[0],{type:c}=vt(n,e),l="normative"===c,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:i,path:a,href:s}}function ps(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 fs=Object.freeze({__proto__:null,THIS_SPEC:ss,name:os,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(ds).map((async e=>({entry:e,result:await Wr(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await Hr(n);r&&Object.assign(zr,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=ds(t),r=await is(n);if(r)as(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),Rt(n,os,{elements:[t]})}}Mt("beforesave",ps)},toCiteDetails:ds});const hs="core/link-to-dfn",ms=[],gs={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:"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚"}},bs=ht(gs);function ys(e){const t=new Map,n=[];for(const r of No.get(e)){const{dfnType:o="dfn"}=r.dataset,s=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const i of s){if(t.has(i)&&t.get(i).has(o)){const e=t.get(i).get(o),s="dfn"===e.localName,a="dfn"===r.localName,c=o===(e.dataset.dfnType||"dfn"),l=!i&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(i);if(s&&a&&c&&l){n.push(r);continue}}t.has(i)||t.set(i,new Map),t.get(i).set(o,r),("idl"in r.dataset||"dfn"!==o)&&t.get(i).set("idl",r),bt(r,"dfn",e)}}return{result:t,duplicates:n}}function ws(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=yt(e).reduce(((e,r)=>{const o=r.split(".");return 2===o.length&&e.push({for:o[0],title:o[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 o=t.get(r.title).get(r.for),{linkType:s}=e.dataset;if(s){for(const e of s.split("|"))if(o.get(e))return o.get(e);return o.get("dfn")}{const e=r.for?"idl":"dfn";return o.get(e)||o.get("idl")}}function vs(e,t,n){let r=!1;const{linkFor:o}=e.dataset,{dfnFor:s}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(o&&!n.get(o)&&s&&!s.split(",").map((e=>e.trim())).includes(o))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"),o=xs(e)&&xs(t,n);r&&!o||xt(e,document.createElement("code"))}(e,t),!r}function xs(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 ks(e){e.forEach((e=>{Rt(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,hs,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var $s=Object.freeze({__proto__:null,name:hs,possibleExternalLinks:ms,run:async function(e){const t=function(){const e=new At;for(const t of No.keys()){const{result:n,duplicates:r}=ys(t);e.set(t,n),r.length>0&&Tt(bs.duplicateMsg(t),hs,{title:bs.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){ms.push(e);continue}const r=ws(e,t);if(r){vs(e,r,t)||ms.push(e)}else""===e.dataset.cite?n.push(e):ms.push(e)}ks(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${ss}$2`);const{key:r,isNormative:o}=ds(t);r!==ss&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||ks(ms)}});const Es="core/contrib";var _s=Object.freeze({__proto__:null,name:Es,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Tt(Pt`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Es)}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 o();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 Qe(t)`${n.map((({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`))}`;const r=n.map((e=>e.name||e.login));t.textContent=pt(r)}(r,n):n.textContent="Failed to fetch contributors.";async function o(){const{href:n}=new URL("contributors",t);try{const t=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let o,s;if("caches"in window)try{if(o=await caches.open(r.origin),s=await o.match(n),s&&new Date(s.headers.get("Expires"))>new Date)return s}catch(e){console.error("Failed to use Cache API.",e)}const i=await fetch(n);if(!i.ok&&s)return console.warn(`Returning a stale cached response for ${r}`),s;if(o&&i.ok){const e=i.clone(),r=new Headers(i.headers),s=new Date(Date.now()+t);r.set("Expires",s.toISOString());const a=new Response(await e.blob(),{headers:r});await o.put(n,a).catch(console.error)}return i}(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 Tt("Error loading contributors from GitHub.",Es,{cause:e}),null}}}(t,n)}});var Cs=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);wt(e,`h${t}`)}))}});const Ss=["h2","h3","h4","h5","h6"],As="core/structure",Ls=ht({en:{toc:"Table of Contents"},zh:{toc:"内容大ēŗ²"},ko:{toc:"ėŖ©ģ°Ø"},ja:{toc:"ē›®ę¬”"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Ts(e,t,{prefix:n=""}={}){let r=!1,o=0,s=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const i=Qe`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=s,r=!0);let e=a.isIntro?"":r?Rs(s-o+1):n+s;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(s+=1,a.header.prepend(Qe`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=Os(a.header,n),o=Ts(a.subsections,t,{prefix:e});o&&r.append(o),i.append(r)}}return i}function Rs(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Ns(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(!Ss.includes(r.localName))continue;const o=r.textContent;bt(e,null,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Ns(e)})}return n}function Os(e,t){const n=Qe`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=wt(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{wt(e,"span").removeAttribute("id")})),Qe`<li class="tocline">${n}</li>`}var Is=Object.freeze({__proto__:null,name:As,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(kt(e,"section").length+1,6)}`;e.localName!==t&&wt(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)){Tt("`data-max-toc` must have a value between 0-6 (inclusive).",As,{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=Ts(Ns(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=Qe`<nav id="toc"></nav>`,n=Qe`<h2 class="introductory">${Ls.toc}</h2>`;bt(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 o=Qe`<p role="navigation" id="back-to-top"> <a href="#title"><abbr title="Back to Top">↑</abbr></a> - </p>`;document.body.append(o)}(t)}o("toc")}});const Os=gt({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:"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚"}});var Is=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(Je`<p><em>${Os.informative}</em></p>`)}))}});const Ps=gt({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${mt(t.textContent)}`),n}}});var Ds=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||(wt(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=Ps.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=Je`<div class="header-wrapper"></div>`;n.replaceWith(o);const s=Je`<a + </p>`;document.body.append(o)}(t)}zt("toc")}});const Ps=ht({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:"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚"}});var Ds=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(Qe`<p><em>${Ps.informative}</em></p>`)}))}});const js=ht({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${ft(t.textContent)}`),n}}});var zs=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||(bt(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=js.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=Qe`<div class="header-wrapper"></div>`;n.replaceWith(o);const s=Qe`<a href="#${t}" class="self-link" aria-label="${r}" - ></a>`;o.append(n,s)}}});const js="ui/save-html",zs=gt({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"äæå­˜ć™ć‚‹"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"åƼå‡ŗ"}}),Ms=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return qt(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return qt(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}}];function qs(e,t){const{id:n,href:r,ext:o,title:s,type:i}=e,a=function(e,t=""){return st.format(e).replace(ot,t)}(t.publishDate||new Date),c=[t.specStatus,t.shortName||"spec",a].join("-");return Je`<a + ></a>`;o.append(n,s)}}});const Ms="ui/save-html",qs=ht({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"äæå­˜ć™ć‚‹"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"åƼå‡ŗ"}}),Fs=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return Bt(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return Bt(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}}];function Bs(e,t){const{id:n,href:r,ext:o,title:s,type:i}=e,a=function(e,t=""){return rt.format(e).replace(nt,t)}(t.publishDate||new Date),c=[t.specStatus,t.shortName||"spec",a].join("-");return Qe`<a href="${r}" id="${n}" download="${c}.${o}" type="${i}" class="respec-save-button" - onclick=${()=>yn.closeModal()} + onclick=${()=>vn.closeModal()} >${s}</a - >`}var Fs=Object.freeze({__proto__:null,exportDocument:function(e,t){return Ot("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",js,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),qt(t)},name:js,run:function(e){const t={async show(t){await document.respec.ready;const n=Je`<div class="respec-save-buttons"> - ${Ms.map((t=>qs(t,e)))} - </div>`;yn.freshModal(zs.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=yn.addCommand(zs.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","šŸ’¾"))}});const Bs=gt({en:{about_respec:"About"},zh:{about_respec:"关äŗŽ"},nl:{about_respec:"Over"},ja:{about_respec:"ć“ć‚Œć«ć¤ć„ć¦"},de:{about_respec:"Ɯber"}});window.respecVersion=window.respecVersion||"Developer Edition";const Hs=document.createElement("div"),Ws=Je.bind(Hs),Us=yn.addCommand(`${Bs.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(Vs).forEach((t=>{e.push(t)}));Ws` + >`}var Hs=Object.freeze({__proto__:null,exportDocument:function(e,t){return Rt("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",Ms,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),Bt(t)},name:Ms,run:function(e){const t={async show(t){await document.respec.ready;const n=Qe`<div class="respec-save-buttons"> + ${Fs.map((t=>Bs(t,e)))} + </div>`;vn.freshModal(qs.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=vn.addCommand(qs.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","šŸ’¾"))}});const Ws=ht({en:{about_respec:"About"},zh:{about_respec:"关äŗŽ"},nl:{about_respec:"Over"},ja:{about_respec:"ć“ć‚Œć«ć¤ć„ć¦"},de:{about_respec:"Ɯber"}});window.respecVersion=window.respecVersion||"Developer Edition";const Us=document.createElement("div"),Vs=Qe.bind(Us),Zs=vn.addCommand(`${Ws.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(Ys).forEach((t=>{e.push(t)}));Vs` <p> ReSpec is a document production toolchain, with a notable focus on W3C specifications. </p> @@ -386,15 +386,15 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} </thead> <tbody>${e}</tbody> </table> -`,yn.freshModal(`${Bs.about_respec} - ${window.respecVersion}`,Hs,Us)}),"Ctrl+Shift+Alt+A","ā„¹ļø");function Vs({name:e,duration:t}){return Je` +`,vn.freshModal(`${Ws.about_respec} - ${window.respecVersion}`,Us,Zs)}),"Ctrl+Shift+Alt+A","ā„¹ļø");function Ys({name:e,duration:t}){return Qe` <tr> <td><a href="${`https://github.com/speced/respec/blob/develop/src/${e}.js`}">${e}</a></td> <td>${t}</td> </tr> - `}var Zs=Object.freeze({__proto__:null});var Ys=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=Je`<meta + `}var Gs=Object.freeze({__proto__:null});var Ks=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=Qe`<meta name="revision" content="${e.gitRevision}" - />`;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)}});var Gs=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)}});var Qs=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} } @@ -409,9 +409,9 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} .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 Ks(t){const n=await fetch(new URL(`../../${t}`,e&&e.src||new URL("respec-aom.js",document.baseURI).href));return await n.text()}const Qs=lt({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(Qs);const Xs=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return oa}))).default}catch{return Ks("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();n("core/worker",Xs.then((e=>({worker:e}))));const Js=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function ei(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:Js(),languages:t},r=await Xs;return r.postMessage(n),new Promise(((e,t)=>{const o=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(s){const{data:{id:i,language:a,value:c}}=s;i===n.id&&(r.removeEventListener("message",t),clearTimeout(o),e({language:a,value:c}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:o,value:s}=r;switch(e.localName){case"pre":e.classList.remove(o),e.innerHTML=`<code class="hljs${o?` ${o}`:""}">${s}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=s,e.classList.add("hljs"),o&&e.classList.add(o)}e.setAttribute("aria-busy","false")}var ti=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(ei);document.head.appendChild(Je`<style> - ${Gs} - </style>`),await Promise.all(n)}});const ni="core/list-sorter";function ri(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function oi(e,t){return[...e.querySelectorAll(":scope > li")].sort(ri(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function si(e,t){return[...e.querySelectorAll(":scope > dt")].sort(ri(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,o=document.createDocumentFragment();let{nextSibling:s}=t;for(;s&&s.nextSibling;){o.appendChild(s.cloneNode(!0));const{nodeType:e,nodeName:t}=s.nextSibling;if(e===n&&t===r)break;s=s.nextSibling}return o.prepend(t.cloneNode(!0)),e.appendChild(o),e}),document.createDocumentFragment())}var ii=Object.freeze({__proto__:null,name:ni,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=si(t,n);break;case"ol":case"ul":e=oi(t,n);break;default:Ot(`ReSpec can't sort ${t.localName} elements.`,ni,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:si,sortListItems:oi});var ai=String.raw`var:hover{text-decoration:underline;cursor:pointer} +.hljs-link{text-decoration:underline}`;async function Xs(t){const n=await fetch(new URL(`../../${t}`,e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href));return await n.text()}const Js=at({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(Js);const ei=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return ia}))).default}catch{return Xs("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();n("core/worker",ei.then((e=>({worker:e}))));const ti=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function ni(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:ti(),languages:t},r=await ei;return r.postMessage(n),new Promise(((e,t)=>{const o=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(s){const{data:{id:i,language:a,value:c}}=s;i===n.id&&(r.removeEventListener("message",t),clearTimeout(o),e({language:a,value:c}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:o,value:s}=r;switch(e.localName){case"pre":e.classList.remove(o),e.innerHTML=`<code class="hljs${o?` ${o}`:""}">${s}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=s,e.classList.add("hljs"),o&&e.classList.add(o)}e.setAttribute("aria-busy","false")}var ri=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(ni);document.head.appendChild(Qe`<style> + ${Qs} + </style>`),await Promise.all(n)}});const oi="core/list-sorter";function si(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function ii(e,t){return[...e.querySelectorAll(":scope > li")].sort(si(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function ai(e,t){return[...e.querySelectorAll(":scope > dt")].sort(si(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,o=document.createDocumentFragment();let{nextSibling:s}=t;for(;s&&s.nextSibling;){o.appendChild(s.cloneNode(!0));const{nodeType:e,nodeName:t}=s.nextSibling;if(e===n&&t===r)break;s=s.nextSibling}return o.prepend(t.cloneNode(!0)),e.appendChild(o),e}),document.createDocumentFragment())}var ci=Object.freeze({__proto__:null,name:oi,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=ai(t,n);break;case"ol":case"ul":e=ii(t,n);break;default:Rt(`ReSpec can't sort ${t.localName} elements.`,oi,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:ai,sortListItems:ii});var li=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)} @@ -425,15 +425,15 @@ 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} -}`;function ci(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=mt(e.textContent),n=e.closest(".algorithm, section"),r=ui(e),o=[...n.querySelectorAll("var")].filter((e=>mt(e.textContent)===t&&e.closest(".algorithm, section")===n)),s=o[0].classList.contains("respec-hl");if(li.set(r,s),s)return o.forEach((e=>di(e,r))),[];o.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return o}(t),r=()=>{const e=ui(t);n.forEach((t=>di(t,e))),[...li.keys()].forEach((e=>li.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const li=new Map([["respec-hl-c1",!0],["respec-hl-c2",!0],["respec-hl-c3",!0],["respec-hl-c4",!0],["respec-hl-c5",!0],["respec-hl-c6",!0],["respec-hl-c7",!0]]);function ui(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===li.get("respec-hl-c1")?"respec-hl-c1":[...li.keys()].find((e=>li.get(e)))||"respec-hl-c1"}function di(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var pi=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=ai,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",ci))),s("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(di)}))}});var fi=String.raw`var{position:relative;cursor:pointer} +}`;function ui(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=ft(e.textContent),n=e.closest(".algorithm, section"),r=pi(e),o=[...n.querySelectorAll("var")].filter((e=>ft(e.textContent)===t&&e.closest(".algorithm, section")===n)),s=o[0].classList.contains("respec-hl");if(di.set(r,s),s)return o.forEach((e=>fi(e,r))),[];o.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return o}(t),r=()=>{const e=pi(t);n.forEach((t=>fi(t,e))),[...di.keys()].forEach((e=>di.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const di=new Map([["respec-hl-c1",!0],["respec-hl-c2",!0],["respec-hl-c3",!0],["respec-hl-c4",!0],["respec-hl-c5",!0],["respec-hl-c6",!0],["respec-hl-c7",!0]]);function pi(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===di.get("respec-hl-c1")?"respec-hl-c1":[...di.keys()].find((e=>di.get(e)))||"respec-hl-c1"}function fi(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var hi=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=li,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",ui))),Mt("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(fi)}))}});var mi=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 hi=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=fi,document.head.appendChild(t);let n=null;const r=new Map,o=document.querySelectorAll("section var");for(const e of o){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 o=r.get(e.textContent.trim());o&&(e.dataset.type=o)}}});var mi=String.raw`:root{--assertion-border:#aaa;--assertion-bg:#eee;--assertion-text:black} +var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var gi=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=mi,document.head.appendChild(t);let n=null;const r=new Map,o=document.querySelectorAll("section var");for(const e of o){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 o=r.get(e.textContent.trim());o&&(e.dataset.type=o)}}});var bi=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 gi=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(Je`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=mi,document.head.appendChild(t)}});const bi="core/anchor-expander";function yi(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Nt(`Found matching element "${t}", but it has no title or marker.`,bi,{title:"Missing title.",elements:[n]})}const o=St(r);n.append(...o.childNodes),n.classList.add("box-ref")}function wi(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Nt(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,bi,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...St(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...o),n.classList.add("fig-ref");const s=r.querySelector(".fig-title");!n.hasAttribute("title")&&s&&(n.title=mt(s.textContent))}function vi(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Nt(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,bi,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...St(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...o),n.classList.add("table-ref");const s=r.querySelector(".table-title");!n.hasAttribute("title")&&s&&(n.title=mt(s.textContent))}function xi(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)ki(r,n),$i(r,n);else{n.textContent=n.getAttribute("href");Nt("Found matching section, but the section was lacking a heading element.",bi,{title:`No matching id in document: "${t}".`,elements:[n]})}}function ki(e,t){const n=e.querySelector(".self-link"),r=[...St(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=xt(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function $i(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const o=t.closest(`[${n}]`);o&&o.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var Ei=Object.freeze({__proto__:null,name:bi,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":ki(n,t);break;case"section":xi(n,e,t);break;case"figure":wi(n,e,t);break;case"table":vi(n,e,t);break;case"aside":case"div":yi(n,e,t);break;default:t.textContent=t.getAttribute("href");Nt("ReSpec doesn't support expanding this kind of reference.",bi,{title:`Can't expand "#${e}".`,elements:[t]})}$i(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Nt(`Couldn't expand inline reference. The id "${e}" is not in the document.`,bi,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var _i=String.raw`dfn{cursor:pointer} +}`;var yi=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(Qe`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=bi,document.head.appendChild(t)}});const wi="core/anchor-expander";function vi(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Tt(`Found matching element "${t}", but it has no title or marker.`,wi,{title:"Missing title.",elements:[n]})}const o=_t(r);n.append(...o.childNodes),n.classList.add("box-ref")}function xi(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Tt(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,wi,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[..._t(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...o),n.classList.add("fig-ref");const s=r.querySelector(".fig-title");!n.hasAttribute("title")&&s&&(n.title=ft(s.textContent))}function ki(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Tt(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,wi,{title:"Missing caption in referenced table.",elements:[n]})}const o=[..._t(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...o),n.classList.add("table-ref");const s=r.querySelector(".table-title");!n.hasAttribute("title")&&s&&(n.title=ft(s.textContent))}function $i(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)Ei(r,n),_i(r,n);else{n.textContent=n.getAttribute("href");Tt("Found matching section, but the section was lacking a heading element.",wi,{title:`No matching id in document: "${t}".`,elements:[n]})}}function Ei(e,t){const n=e.querySelector(".self-link"),r=[..._t(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=wt(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function _i(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const o=t.closest(`[${n}]`);o&&o.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var Ci=Object.freeze({__proto__:null,name:wi,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":Ei(n,t);break;case"section":$i(n,e,t);break;case"figure":xi(n,e,t);break;case"table":ki(n,e,t);break;case"aside":case"div":vi(n,e,t);break;default:t.textContent=t.getAttribute("href");Tt("ReSpec doesn't support expanding this kind of reference.",wi,{title:`Can't expand "#${e}".`,elements:[t]})}_i(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Tt(`Couldn't expand inline reference. The id "${e}" is not in the document.`,wi,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var Si=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} @@ -450,7 +450,7 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var hi=Obje .dfn-panel a[href]:hover{border-bottom-width:1px} .dfn-panel ul{padding:0} .dfn-panel li{margin-left:1em} -.dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto}`;function Ci(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),o=`dfn-panel-for-${e.id}`,s=e.getAttribute("aria-label")||mt(e.textContent),i=Je` +.dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto}`;function Ai(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),o=`dfn-panel-for-${e.id}`,s=e.getAttribute("aria-label")||ft(e.textContent),i=Qe` <div class="dfn-panel" id="${o}" @@ -467,11 +467,11 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var hi=Obje aria-label="Permalink for definition: ${s}. Activate to close this dialog." >Permalink</a > - ${function(e){return e.matches("dfn[data-export]")?Je`<span + ${function(e){return e.matches("dfn[data-export]")?Qe`<span class="marker dfn-exported" title="Definition can be referenced by other specifications" >exported</span - >`:null}(e)} ${function(e,t){if(!e.hasAttribute("data-idl"))return null;for(const n of t){if(n.dataset.linkType!==e.dataset.dfnType)continue;const t=n.closest("pre.idl");if(t&&t.id){const e=`#${t.id}`;return Je`<a + >`:null}(e)} ${function(e,t){if(!e.hasAttribute("data-idl"))return null;for(const n of t){if(n.dataset.linkType!==e.dataset.dfnType)continue;const t=n.closest("pre.idl");if(t&&t.id){const e=`#${t.id}`;return Qe`<a href="${e}" class="marker idl-block" title="Jump to IDL declaration" @@ -479,20 +479,20 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var hi=Obje >`}}return null}(e,r)} </div> <p><b>Referenced in:</b></p> - ${function(e,t){if(!t.length)return Je`<ul> + ${function(e,t){if(!t.length)return Qe`<ul> <li>Not referenced in this document.</li> - </ul>`;const n=new Map;t.forEach(((t,r)=>{const o=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=o);const s=function(e){const t=e.closest("section");if(!t)return null;const n=t.querySelector("h1, h2, h3, h4, h5, h6");return n?`Ā§ ${mt(n.textContent)}`:null}(t);(n.get(s)||n.set(s,[]).get(s)).push(o)}));const r=([e,t])=>[{title:e,id:t[0],text:e}].concat(t.slice(1).map(((e,t)=>({title:`Reference ${t+2}`,text:`(${t+2})`,id:e})))),o=e=>Je`<li> - ${r(e).map((e=>Je`<a href="#${e.id}" title="${e.title}">${e.text}</a + </ul>`;const n=new Map;t.forEach(((t,r)=>{const o=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=o);const s=function(e){const t=e.closest("section");if(!t)return null;const n=t.querySelector("h1, h2, h3, h4, h5, h6");return n?`Ā§ ${ft(n.textContent)}`:null}(t);(n.get(s)||n.set(s,[]).get(s)).push(o)}));const r=([e,t])=>[{title:e,id:t[0],text:e}].concat(t.slice(1).map(((e,t)=>({title:`Reference ${t+2}`,text:`(${t+2})`,id:e})))),o=e=>Qe`<li> + ${r(e).map((e=>Qe`<a href="#${e.id}" title="${e.title}">${e.text}</a >${" "}`))} - </li>`;return Je`<ul> + </li>`;return Qe`<ul> ${[...n].map(o)} </ul>`}(t,r)} </div> - `;return i}var Si=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(Je`<style> - ${_i} - </style>`,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(Ci(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");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 sa}))).default}catch{return Ks("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Ai=new Promise(((e,t)=>{}));gt({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"ģ°øģ—¬"},zh:{file_a_bug:"反馈错čÆÆ",participate:"参äøŽļ¼š"},ja:{commit_history:"å¤‰ę›“å±„ę­“",file_a_bug:"問锌報告",participate:"å‚åŠ ę–¹ę³•ļ¼š"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});const Li="rs-changelog",Ti=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;Je.bind(this)` + `;return i}var Li=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(Qe`<style> + ${Si} + </style>`,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(Ai(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");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 aa}))).default}catch{return Xs("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Ti=new Promise(((e,t)=>{}));ht({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"ģ°øģ—¬"},zh:{file_a_bug:"反馈错čÆÆ",participate:"参äøŽļ¼š"},ja:{commit_history:"å¤‰ę›“å±„ę­“",file_a_bug:"問锌報告",participate:"å‚åŠ ę–¹ę³•ļ¼š"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});const Ri="rs-changelog",Ni=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;Qe.bind(this)` <ul> - ${{any:Ri(e,t,n).then((e=>async function(e){const{repoURL:t}=await Ai;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),o=`${t}commit/${e.hash}`,s=r&&Je` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return Je`<li><a href="${o}">${n.trim()}</a>${s}</li>`}))}(e))).catch((e=>Nt(e.message,Li,{elements:[this]}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}} + ${{any:Oi(e,t,n).then((e=>async function(e){const{repoURL:t}=await Ti;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),o=`${t}commit/${e.hash}`,s=r&&Qe` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return Qe`<li><a href="${o}">${n.trim()}</a>${s}</li>`}))}(e))).catch((e=>Tt(e.message,Ri,{elements:[this],cause:e}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}} </ul> - `}};async function Ri(e,t,n){let r;try{const o=await Ai;if(!o)throw new Error("`respecConfig.github` is not set");const s=new URL("commits",`${o.apiBase}/${o.fullName}/`);s.searchParams.set("from",e),s.searchParams.set("to",t);const i=await fetch(s.href);if(!i.ok)throw new Error(`Request to ${s} failed with status code ${i.status}`);if(r=await i.json(),!r.length)throw new Error(`No commits between ${e}..${t}.`);r=r.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw console.error(e),new Error(t)}return r}const Ni=[Object.freeze({__proto__:null,element:Ti,name:Li})];var Oi=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Ni.forEach((e=>{customElements.define(e.name,e.element)}));const e=Ni.map((e=>e.name)).join(", "),t=[...document.querySelectorAll(e)].map((e=>new Promise((t=>e.addEventListener("done",t,{once:!0})))));await Promise.all(t)}});var Ii=Object.freeze({__proto__:null,name:"core/dfn-contract",run:function(){!function(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}(),function(){const e=document.querySelectorAll("dl.definitions dt:has(dfn[data-dfn-type])");for(const t of e){const e=t.querySelector("dfn[data-dfn-type]").id,n=t.nextElementSibling;n&&!n.dataset.defines&&e&&(n.dataset.defines=`#${e}`)}const t=document.querySelectorAll(".definition:has(dfn[data-dfn-type])");for(const e of t){const t=e.querySelector("dfn[data-dfn-type]");t.id&&!e.dataset.defines&&(e.dataset.defines=`#${t.id}`)}}()}});const Pi="core/linter-rules/check-charset",Di=gt({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ `<meta>` ꠇē­¾",hint:'å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ `<head>` éƒØ分ā€”ā€” `<meta charset="utf-8">` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚'}});var ji=Object.freeze({__proto__:null,name:Pi,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||Ot(Di.msg,Pi,{hint:Di.hint,elements:[...t]})}});const zi="core/linter-rules/check-punctuation",Mi=[".",":","!","?"],qi=gt({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Mi.map((e=>`"${e}"`)).join(", ")}.`}});var Fi=Object.freeze({__proto__:null,name:zi,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Mi.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&Ot(qi.msg,zi,{hint:qi.hint,elements:n})}});const Bi="core/linter-rules/local-refs-exist",Hi=gt({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function Wi(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Ui=Object.freeze({__proto__:null,name:Bi,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Wi);t.length&&Ot(Hi.msg,Bi,{hint:Hi.hint,elements:t})}});const Vi="core/linter-rules/no-headingless-sections",Zi=gt({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂",hint:"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂"}});var Yi=Object.freeze({__proto__:null,name:Vi,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,#abstract,#sotd)")].filter((({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement)));t.length&&Ot(Zi.msg,Vi,{hint:Zi.hint,elements:t})}});const Gi="core/linter-rules/no-unused-vars",Ki=gt({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var Qi=Object.freeze({__proto__:null,name:Gi,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const o=new Map;for(const e of r){const t=mt(e.textContent);(o.get(t)||o.set(t,[]).get(t)).push(e)}for(const e of o.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&Ot(Ki.msg,Gi,{hint:Ki.hint,elements:t})}});const Xi="core/linter-rules/privsec-section",Ji=gt({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."}});var ea=Object.freeze({__proto__:null,name:Xi,run:function(e){var t;e.lint?.["privsec-section"]&&e.isRecTrack&&(t=document,!Array.from(t.querySelectorAll("h2, h3, h4, h5, h6")).some((({textContent:e})=>{const t=/(privacy|security)/im.test(e),n=/(considerations)/im.test(e);return t&&n||t})))&&Ot(Ji.msg,Xi,{hint:Ji.hint})}});const ta="core/linter-rules/no-http-props",na=gt({en:{msg:jt`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:jt`${"[respecConfig]"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,hint:"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š"}});var ra=Object.freeze({__proto__:null,name:ta,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter((t=>t.endsWith("URI")&&e[t]||"prevED"===t)).filter((t=>new URL(e[t],parent.location.href).href.startsWith("http://")));if(t.length){const e=ht(t,(e=>jt`${`[${e}]`}`));Ot(na.msg,ta,{hint:na.hint+e})}}}),oa=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'}),sa=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 <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); + `}};async function Oi(e,t,n){let r;try{const o=await Ti;if(!o)throw new Error("`respecConfig.github` is not set");const s=new URL("commits",`${o.apiBase}/${o.fullName}/`);s.searchParams.set("from",e),s.searchParams.set("to",t);const i=await fetch(s.href);if(!i.ok)throw new Error(`Request to ${s} failed with status code ${i.status}`);if(r=await i.json(),!r.length)throw new Error(`No commits between ${e}..${t}.`);r=r.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw new Error(t,{cause:e})}return r}const Ii=[Object.freeze({__proto__:null,element:Ni,name:Ri})];var Pi=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Ii.forEach((e=>{customElements.define(e.name,e.element)}));const e=Ii.map((e=>e.name)).join(", "),t=[...document.querySelectorAll(e)].map((e=>new Promise((t=>e.addEventListener("done",t,{once:!0})))));await Promise.all(t)}});var Di=Object.freeze({__proto__:null,name:"core/dfn-contract",run:function(){!function(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}(),function(){const e=document.querySelectorAll("dl.definitions dt:has(dfn[data-dfn-type])");for(const t of e){const e=t.querySelector("dfn[data-dfn-type]").id,n=t.nextElementSibling;n&&!n.dataset.defines&&e&&(n.dataset.defines=`#${e}`)}const t=document.querySelectorAll(".definition:has(dfn[data-dfn-type])");for(const e of t){const t=e.querySelector("dfn[data-dfn-type]");t.id&&!e.dataset.defines&&(e.dataset.defines=`#${t.id}`)}}()}});const ji="core/linter-rules/check-charset",zi=ht({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ `<meta>` ꠇē­¾",hint:'å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ `<head>` éƒØ分ā€”ā€” `<meta charset="utf-8">` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚'}});var Mi=Object.freeze({__proto__:null,name:ji,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||Rt(zi.msg,ji,{hint:zi.hint,elements:[...t]})}});const qi="core/linter-rules/check-punctuation",Fi=[".",":","!","?"],Bi=ht({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Fi.map((e=>`"${e}"`)).join(", ")}.`}});var Hi=Object.freeze({__proto__:null,name:qi,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Fi.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&Rt(Bi.msg,qi,{hint:Bi.hint,elements:n})}});const Wi="core/linter-rules/local-refs-exist",Ui=ht({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function Vi(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Zi=Object.freeze({__proto__:null,name:Wi,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Vi);t.length&&Rt(Ui.msg,Wi,{hint:Ui.hint,elements:t})}});const Yi="core/linter-rules/no-headingless-sections",Gi=ht({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂",hint:"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂"}});var Ki=Object.freeze({__proto__:null,name:Yi,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,#abstract,#sotd)")].filter((({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement)));t.length&&Rt(Gi.msg,Yi,{hint:Gi.hint,elements:t})}});const Qi="core/linter-rules/no-unused-vars",Xi=ht({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var Ji=Object.freeze({__proto__:null,name:Qi,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const o=new Map;for(const e of r){const t=ft(e.textContent);(o.get(t)||o.set(t,[]).get(t)).push(e)}for(const e of o.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&Rt(Xi.msg,Qi,{hint:Xi.hint,elements:t})}});const ea="core/linter-rules/privsec-section",ta=ht({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."}});var na=Object.freeze({__proto__:null,name:ea,run:function(e){var t;e.lint?.["privsec-section"]&&e.isRecTrack&&(t=document,!Array.from(t.querySelectorAll("h2, h3, h4, h5, h6")).some((({textContent:e})=>{const t=/(privacy|security)/im.test(e),n=/(considerations)/im.test(e);return t&&n||t})))&&Rt(ta.msg,ea,{hint:ta.hint})}});const ra="core/linter-rules/no-http-props",oa=ht({en:{msg:Pt`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:Pt`${"[respecConfig]"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,hint:"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š"}});var sa=Object.freeze({__proto__:null,name:ra,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter((t=>t.endsWith("URI")&&e[t]||"prevED"===t)).filter((t=>new URL(e[t],parent.location.href).href.startsWith("http://")));if(t.length){const e=pt(t,(e=>Pt`${`[${e}]`}`));Rt(oa.msg,ra,{hint:oa.hint+e})}}}),ia=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'}),aa=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 <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); //# sourceMappingURL=respec-aom.js.map diff --git a/builds/respec-aom.js.map b/builds/respec-aom.js.map index e19b8d0403..0672c830d5 100644 --- a/builds/respec-aom.js.map +++ b/builds/respec-aom.js.map @@ -1 +1 @@ -{"version":3,"file":"respec-aom.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/index.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/utils.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/aom.js","../src/core/location-hash.js","../src/core/defaults.js","../src/aom/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/aom/style.js","../src/core/sections.js","../src/core/data-include.js","../src/core/reindent.js","../src/core/title.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/aom/templates/headers.js","../src/aom/headers.js","../src/aom/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/aom/conformance.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/ui/save-html.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/github.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/dfn-contract.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/no-http-props.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\n// Explicitly default lang and dir on <html> if not set.\n// We assume English and ltr as default for international standards.\nif (!html?.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html?.lang ?? \"en\";\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst transactionDoneMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(this.request);\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nconst advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance'];\nconst methodMap = {};\nconst advanceResults = new WeakMap();\nconst ittrProxiedCursorToOriginalProxy = new WeakMap();\nconst cursorIteratorTraps = {\n get(target, prop) {\n if (!advanceMethodProps.includes(prop))\n return target[prop];\n let cachedFunc = methodMap[prop];\n if (!cachedFunc) {\n cachedFunc = methodMap[prop] = function (...args) {\n advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args));\n };\n }\n return cachedFunc;\n },\n};\nasync function* iterate(...args) {\n // tslint:disable-next-line:no-this-assignment\n let cursor = this;\n if (!(cursor instanceof IDBCursor)) {\n cursor = await cursor.openCursor(...args);\n }\n if (!cursor)\n return;\n cursor = cursor;\n const proxiedCursor = new Proxy(cursor, cursorIteratorTraps);\n ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor);\n // Map this double-proxy back to the original, so other cursor methods work.\n reverseTransformCache.set(proxiedCursor, unwrap(cursor));\n while (cursor) {\n yield proxiedCursor;\n // If one of the advancing methods was not called, call continue().\n cursor = await (advanceResults.get(proxiedCursor) || cursor.continue());\n advanceResults.delete(proxiedCursor);\n }\n}\nfunction isIteratorProp(target, prop) {\n return ((prop === Symbol.asyncIterator &&\n instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) ||\n (prop === 'iterate' && instanceOfAny(target, [IDBIndex, IDBObjectStore])));\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get(target, prop, receiver) {\n if (isIteratorProp(target, prop))\n return iterate;\n return oldTraps.get(target, prop, receiver);\n },\n has(target, prop) {\n return isIteratorProp(target, prop) || oldTraps.has(target, prop);\n },\n}));\n\nexport { deleteDB, openDB, unwrap, wrap };\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (Ćæ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v12.0.2 - a markdown parser\n * Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\n/**\n * Gets the original marked default options.\n */\nfunction _getDefaults() {\n return {\n async: false,\n breaks: false,\n extensions: null,\n gfm: true,\n hooks: null,\n pedantic: false,\n renderer: null,\n silent: false,\n tokenizer: null,\n walkTokens: null\n };\n}\nlet _defaults = _getDefaults();\nfunction changeDefaults(newDefaults) {\n _defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape$1(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n }\n else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n return html;\n}\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon')\n return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\nconst caret = /(^|[^\\[])\\^/g;\nfunction edit(regex, opt) {\n let source = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n let valSource = typeof val === 'string' ? val : val.source;\n valSource = valSource.replace(caret, '$1');\n source = source.replace(name, valSource);\n return obj;\n },\n getRegex: () => {\n return new RegExp(source, opt);\n }\n };\n return obj;\n}\nfunction cleanUrl(href) {\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n }\n catch (e) {\n return null;\n }\n return href;\n}\nconst noopTest = { exec: () => null };\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false;\n let curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\')\n escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n }\n else {\n // add space before unescaped |\n return ' |';\n }\n }), cells = row.split(/ \\|/);\n let i = 0;\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) {\n cells.shift();\n }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) {\n cells.pop();\n }\n if (count) {\n if (cells.length > count) {\n cells.splice(count);\n }\n else {\n while (cells.length < count)\n cells.push('');\n }\n }\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param str\n * @param c\n * @param invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n }\n else if (currChar !== c && invert) {\n suffLen++;\n }\n else {\n break;\n }\n }\n return str.slice(0, l - suffLen);\n}\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n let level = 0;\n for (let i = 0; i < str.length; i++) {\n if (str[i] === '\\\\') {\n i++;\n }\n else if (str[i] === b[0]) {\n level++;\n }\n else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape$1(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape$1(text)\n };\n}\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n if (matchIndentToCode === null) {\n return text;\n }\n const indentToCode = matchIndentToCode[1];\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n const [indentInNode] = matchIndentInNode;\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n return node;\n })\n .join('\\n');\n}\n/**\n * Tokenizer\n */\nclass _Tokenizer {\n options;\n rules; // set by the lexer\n lexer; // set by the lexer\n constructor(options) {\n this.options = options || _defaults;\n }\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, '$1') : cap[2],\n text\n };\n }\n }\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n }\n else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n // precede setext continuation with 4 spaces so it isn't a setext\n let text = cap[0].replace(/\\n {0,3}((?:=+|-+) *)(?=\\n|$)/g, '\\n $1');\n text = rtrim(text.replace(/^ *>[ \\t]?/gm, ''), '\\n');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n let raw = '';\n let itemContents = '';\n let endsWithBlankLine = false;\n // Check if current bullet point can start a new List Item\n while (src) {\n let endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n raw = cap[0];\n src = src.substring(raw.length);\n let line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n let nextLine = src.split('\\n', 1)[0];\n let indent = 0;\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimStart();\n }\n else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n let blankLine = false;\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n // Check if following lines should be included in List Item\n while (src) {\n const rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n }\n else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n itemContents += '\\n' + nextLine;\n }\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n }\n else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n let istask = null;\n let ischecked;\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents,\n tokens: []\n });\n list.raw += raw;\n }\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimEnd();\n (list.items[list.items.length - 1]).text = itemContents.trimEnd();\n list.raw = list.raw.trimEnd();\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (let i = 0; i < list.items.length; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n list.loose = hasMultipleLineBreaks;\n }\n }\n // Set all items to loose if list is loose\n if (list.loose) {\n for (let i = 0; i < list.items.length; i++) {\n list.items[i].loose = true;\n }\n }\n return list;\n }\n }\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n block: true,\n raw: cap[0],\n pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',\n text: cap[0]\n };\n return token;\n }\n }\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline.anyPunctuation, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (!cap) {\n return;\n }\n if (!/[:|]/.test(cap[2])) {\n // delimiter row must have a pipe (|) or colon (:) otherwise it is a setext heading\n return;\n }\n const headers = splitCells(cap[1]);\n const aligns = cap[2].replace(/^\\||\\| *$/g, '').split('|');\n const rows = cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : [];\n const item = {\n type: 'table',\n raw: cap[0],\n header: [],\n align: [],\n rows: []\n };\n if (headers.length !== aligns.length) {\n // header and align columns must be equal, rows can be different.\n return;\n }\n for (const align of aligns) {\n if (/^ *-+: *$/.test(align)) {\n item.align.push('right');\n }\n else if (/^ *:-+: *$/.test(align)) {\n item.align.push('center');\n }\n else if (/^ *:-+ *$/.test(align)) {\n item.align.push('left');\n }\n else {\n item.align.push(null);\n }\n }\n for (const header of headers) {\n item.header.push({\n text: header,\n tokens: this.lexer.inline(header)\n });\n }\n for (const row of rows) {\n item.rows.push(splitCells(row, item.header.length).map(cell => {\n return {\n text: cell,\n tokens: this.lexer.inline(cell)\n };\n }));\n }\n return item;\n }\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape$1(cap[1])\n };\n }\n }\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n }\n else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n }\n else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n return {\n type: 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n block: false,\n text: cap[0]\n };\n }\n }\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n }\n else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n if (link) {\n href = link[1];\n title = link[3];\n }\n }\n else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n }\n else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline.anyPunctuation, '$1') : href,\n title: title ? title.replace(this.rules.inline.anyPunctuation, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n const linkString = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n const link = links[linkString.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrongLDelim.exec(src);\n if (!match)\n return;\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u))\n return;\n const nextChar = match[1] || match[2] || '';\n if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {\n // unicode Regex counts emoji as 1 char; spread into array for proper count (used multiple times below)\n const lLength = [...match[0]].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;\n endReg.lastIndex = 0;\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n if (!rDelim)\n continue; // skip single * in __abc*abc__\n rLength = [...rDelim].length;\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n }\n else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n delimTotal -= rLength;\n if (delimTotal > 0)\n continue; // Haven't found enough closing delimiters\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n // char length can be >1 for unicode characters;\n const lastCharLength = [...match[0]][0].length;\n const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape$1(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n autolink(src) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[1]);\n href = 'mailto:' + text;\n }\n else {\n text = escape$1(cap[1]);\n href = text;\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n url(src) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[0]);\n href = 'mailto:' + text;\n }\n else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? '';\n } while (prevCapZero !== cap[0]);\n text = escape$1(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n }\n else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n inlineText(src) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = cap[0];\n }\n else {\n text = escape$1(cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst newline = /^(?: *(?:\\n|$))+/;\nconst blockCode = /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/;\nconst fences = /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/;\nconst hr = /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/;\nconst heading = /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/;\nconst bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nconst lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\\n(?!\\s*?\\n|bull |blockCode|fences|blockquote|heading|html))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/)\n .replace(/bull/g, bullet) // lists can interrupt\n .replace(/blockCode/g, / {4}/) // indented code blocks can interrupt\n .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt\n .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n .getRegex();\nconst _paragraph = /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/;\nconst blockText = /^[^\\n]+/;\nconst _blockLabel = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nconst def = edit(/^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/)\n .replace('label', _blockLabel)\n .replace('title', /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/)\n .getRegex();\nconst list = edit(/^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/)\n .replace(/bull/g, bullet)\n .getRegex();\nconst _tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title'\n + '|tr|track|ul';\nconst _comment = /<!--(?:-?>|[\\s\\S]*?(?:-->|$))/;\nconst html = edit('^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')', 'i')\n .replace('comment', _comment)\n .replace('tag', _tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst paragraph = edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\nconst blockquote = edit(/^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/)\n .replace('paragraph', paragraph)\n .getRegex();\n/**\n * Normal Block Grammar\n */\nconst blockNormal = {\n blockquote,\n code: blockCode,\n def,\n fences,\n heading,\n hr,\n html,\n lheading,\n list,\n newline,\n paragraph,\n table: noopTest,\n text: blockText\n};\n/**\n * GFM Block Grammar\n */\nconst gfmTable = edit('^ *([^\\\\n ].*)\\\\n' // Header\n + ' {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)') // Cells\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\nconst blockGfm = {\n ...blockNormal,\n table: gfmTable,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('table', gfmTable) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex()\n};\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\nconst blockPedantic = {\n ...blockNormal,\n html: edit('^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', _comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', lheading)\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .replace('|tag', '')\n .getRegex()\n};\n/**\n * Inline-Level Grammar\n */\nconst escape = /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/;\nconst inlineCode = /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/;\nconst br = /^( {2,}|\\\\)\\n(?!\\s*$)/;\nconst inlineText = /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/;\n// list of unicode punctuation marks, plus any missing characters from CommonMark spec\nconst _punctuation = '\\\\p{P}\\\\p{S}';\nconst punctuation = edit(/^((?![*_])[\\spunctuation])/, 'u')\n .replace(/punctuation/g, _punctuation).getRegex();\n// sequences em should skip over [title](link), `code`, <html>\nconst blockSkip = /\\[[^[\\]]*?\\]\\([^\\(\\)]*?\\)|`[^`]*?`|<[^<>]*?>/g;\nconst emStrongLDelim = edit(/^(?:\\*+(?:((?!\\*)[punct])|[^\\s*]))|^_+(?:((?!_)[punct])|([^\\s_]))/, 'u')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst emStrongRDelimAst = edit('^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)' // Skip orphan inside strong\n + '|[^*]+(?=[^*])' // Consume to delim\n + '|(?!\\\\*)[punct](\\\\*+)(?=[\\\\s]|$)' // (1) #*** can only be a Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?!\\\\*)(?=[punct\\\\s]|$)' // (2) a***#, a*** can only be a Right Delimiter\n + '|(?!\\\\*)[punct\\\\s](\\\\*+)(?=[^punct\\\\s])' // (3) #***a, ***a can only be Left Delimiter\n + '|[\\\\s](\\\\*+)(?!\\\\*)(?=[punct])' // (4) ***# can only be Left Delimiter\n + '|(?!\\\\*)[punct](\\\\*+)(?!\\\\*)(?=[punct])' // (5) #***# can be either Left or Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?=[^punct\\\\s])', 'gu') // (6) a***a can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\n// (6) Not allowed for _\nconst emStrongRDelimUnd = edit('^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)' // Skip orphan inside strong\n + '|[^_]+(?=[^_])' // Consume to delim\n + '|(?!_)[punct](_+)(?=[\\\\s]|$)' // (1) #___ can only be a Right Delimiter\n + '|[^punct\\\\s](_+)(?!_)(?=[punct\\\\s]|$)' // (2) a___#, a___ can only be a Right Delimiter\n + '|(?!_)[punct\\\\s](_+)(?=[^punct\\\\s])' // (3) #___a, ___a can only be Left Delimiter\n + '|[\\\\s](_+)(?!_)(?=[punct])' // (4) ___# can only be Left Delimiter\n + '|(?!_)[punct](_+)(?!_)(?=[punct])', 'gu') // (5) #___# can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst anyPunctuation = edit(/\\\\([punct])/, 'gu')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst autolink = edit(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/)\n .replace('scheme', /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/)\n .replace('email', /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/)\n .getRegex();\nconst _inlineComment = edit(_comment).replace('(?:-->|$)', '-->').getRegex();\nconst tag = edit('^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>') // CDATA section\n .replace('comment', _inlineComment)\n .replace('attribute', /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst _inlineLabel = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\nconst link = edit(/^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/)\n .replace('label', _inlineLabel)\n .replace('href', /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/)\n .replace('title', /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/)\n .getRegex();\nconst reflink = edit(/^!?\\[(label)\\]\\[(ref)\\]/)\n .replace('label', _inlineLabel)\n .replace('ref', _blockLabel)\n .getRegex();\nconst nolink = edit(/^!?\\[(ref)\\](?:\\[\\])?/)\n .replace('ref', _blockLabel)\n .getRegex();\nconst reflinkSearch = edit('reflink|nolink(?!\\\\()', 'g')\n .replace('reflink', reflink)\n .replace('nolink', nolink)\n .getRegex();\n/**\n * Normal Inline Grammar\n */\nconst inlineNormal = {\n _backpedal: noopTest, // only used for GFM url\n anyPunctuation,\n autolink,\n blockSkip,\n br,\n code: inlineCode,\n del: noopTest,\n emStrongLDelim,\n emStrongRDelimAst,\n emStrongRDelimUnd,\n escape,\n link,\n nolink,\n punctuation,\n reflink,\n reflinkSearch,\n tag,\n text: inlineText,\n url: noopTest\n};\n/**\n * Pedantic Inline Grammar\n */\nconst inlinePedantic = {\n ...inlineNormal,\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', _inlineLabel)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', _inlineLabel)\n .getRegex()\n};\n/**\n * GFM Inline Grammar\n */\nconst inlineGfm = {\n ...inlineNormal,\n escape: edit(escape).replace('])', '~|])').getRegex(),\n url: edit(/^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/, 'i')\n .replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/)\n .getRegex(),\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n};\n/**\n * GFM + Line Breaks Inline Grammar\n */\nconst inlineBreaks = {\n ...inlineGfm,\n br: edit(br).replace('{2,}', '*').getRegex(),\n text: edit(inlineGfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n/**\n * exports\n */\nconst block = {\n normal: blockNormal,\n gfm: blockGfm,\n pedantic: blockPedantic\n};\nconst inline = {\n normal: inlineNormal,\n gfm: inlineGfm,\n breaks: inlineBreaks,\n pedantic: inlinePedantic\n};\n\n/**\n * Block Lexer\n */\nclass _Lexer {\n tokens;\n options;\n state;\n tokenizer;\n inlineQueue;\n constructor(options) {\n // TokenList cannot be created in one go\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || _defaults;\n this.options.tokenizer = this.options.tokenizer || new _Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n }\n else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n }\n else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new _Lexer(options);\n return lexer.lex(src);\n }\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new _Lexer(options);\n return lexer.inlineTokens(src);\n }\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n this.blockTokens(src, this.tokens);\n for (let i = 0; i < this.inlineQueue.length; i++) {\n const next = this.inlineQueue[i];\n this.inlineTokens(next.src, next.tokens);\n }\n this.inlineQueue = [];\n return this.tokens;\n }\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n }\n else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n let token;\n let lastToken;\n let cutSrc;\n let lastParagraphClipped;\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unnecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n this.state.top = true;\n return tokens;\n }\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n // Mask out escaped characters\n while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);\n }\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // autolink\n if (token = this.tokenizer.autolink(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass _Renderer {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/^\\S*/)?.[0];\n code = code.replace(/\\n$/, '') + '\\n';\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n return '<pre><code class=\"language-'\n + escape$1(lang)\n + '\">'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n html(html, block) {\n return html;\n }\n heading(text, level, raw) {\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n hr() {\n return '<hr>\\n';\n }\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul';\n const startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n listitem(text, task, checked) {\n return `<li>${text}</li>\\n`;\n }\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\">';\n }\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n table(header, body) {\n if (body)\n body = `<tbody>${body}</tbody>`;\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n /**\n * span level renderer\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n em(text) {\n return `<em>${text}</em>`;\n }\n codespan(text) {\n return `<code>${text}</code>`;\n }\n br() {\n return '<br>';\n }\n del(text) {\n return `<del>${text}</del>`;\n }\n link(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n image(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += '>';\n return out;\n }\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass _TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n em(text) {\n return text;\n }\n codespan(text) {\n return text;\n }\n del(text) {\n return text;\n }\n html(text) {\n return text;\n }\n text(text) {\n return text;\n }\n link(href, title, text) {\n return '' + text;\n }\n image(href, title, text) {\n return '' + text;\n }\n br() {\n return '';\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass _Parser {\n options;\n renderer;\n textRenderer;\n constructor(options) {\n this.options = options || _defaults;\n this.options.renderer = this.options.renderer || new _Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new _TextRenderer();\n }\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new _Parser(options);\n return parser.parse(tokens);\n }\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new _Parser(options);\n return parser.parseInline(tokens);\n }\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const genericToken = token;\n const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(genericToken.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n const headingToken = token;\n out += this.renderer.heading(this.parseInline(headingToken.tokens), headingToken.depth, unescape(this.parseInline(headingToken.tokens, this.textRenderer)));\n continue;\n }\n case 'code': {\n const codeToken = token;\n out += this.renderer.code(codeToken.text, codeToken.lang, !!codeToken.escaped);\n continue;\n }\n case 'table': {\n const tableToken = token;\n let header = '';\n // header\n let cell = '';\n for (let j = 0; j < tableToken.header.length; j++) {\n cell += this.renderer.tablecell(this.parseInline(tableToken.header[j].tokens), { header: true, align: tableToken.align[j] });\n }\n header += this.renderer.tablerow(cell);\n let body = '';\n for (let j = 0; j < tableToken.rows.length; j++) {\n const row = tableToken.rows[j];\n cell = '';\n for (let k = 0; k < row.length; k++) {\n cell += this.renderer.tablecell(this.parseInline(row[k].tokens), { header: false, align: tableToken.align[k] });\n }\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n const blockquoteToken = token;\n const body = this.parse(blockquoteToken.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n const listToken = token;\n const ordered = listToken.ordered;\n const start = listToken.start;\n const loose = listToken.loose;\n let body = '';\n for (let j = 0; j < listToken.items.length; j++) {\n const item = listToken.items[j];\n const checked = item.checked;\n const task = item.task;\n let itemBody = '';\n if (item.task) {\n const checkbox = this.renderer.checkbox(!!checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n }\n else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox + ' '\n });\n }\n }\n else {\n itemBody += checkbox + ' ';\n }\n }\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, !!checked);\n }\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n const htmlToken = token;\n out += this.renderer.html(htmlToken.text, htmlToken.block);\n continue;\n }\n case 'paragraph': {\n const paragraphToken = token;\n out += this.renderer.paragraph(this.parseInline(paragraphToken.tokens));\n continue;\n }\n case 'text': {\n let textToken = token;\n let body = textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text;\n while (i + 1 < tokens.length && tokens[i + 1].type === 'text') {\n textToken = tokens[++i];\n body += '\\n' + (textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'escape': {\n const escapeToken = token;\n out += renderer.text(escapeToken.text);\n break;\n }\n case 'html': {\n const tagToken = token;\n out += renderer.html(tagToken.text);\n break;\n }\n case 'link': {\n const linkToken = token;\n out += renderer.link(linkToken.href, linkToken.title, this.parseInline(linkToken.tokens, renderer));\n break;\n }\n case 'image': {\n const imageToken = token;\n out += renderer.image(imageToken.href, imageToken.title, imageToken.text);\n break;\n }\n case 'strong': {\n const strongToken = token;\n out += renderer.strong(this.parseInline(strongToken.tokens, renderer));\n break;\n }\n case 'em': {\n const emToken = token;\n out += renderer.em(this.parseInline(emToken.tokens, renderer));\n break;\n }\n case 'codespan': {\n const codespanToken = token;\n out += renderer.codespan(codespanToken.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n const delToken = token;\n out += renderer.del(this.parseInline(delToken.tokens, renderer));\n break;\n }\n case 'text': {\n const textToken = token;\n out += renderer.text(textToken.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\nclass _Hooks {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess',\n 'processAllTokens'\n ]);\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n /**\n * Process all tokens before walk tokens\n */\n processAllTokens(tokens) {\n return tokens;\n }\n}\n\nclass Marked {\n defaults = _getDefaults();\n options = this.setOptions;\n parse = this.#parseMarkdown(_Lexer.lex, _Parser.parse);\n parseInline = this.#parseMarkdown(_Lexer.lexInline, _Parser.parseInline);\n Parser = _Parser;\n Renderer = _Renderer;\n TextRenderer = _TextRenderer;\n Lexer = _Lexer;\n Tokenizer = _Tokenizer;\n Hooks = _Hooks;\n constructor(...args) {\n this.use(...args);\n }\n /**\n * Run callback for every token\n */\n walkTokens(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(this, token));\n switch (token.type) {\n case 'table': {\n const tableToken = token;\n for (const cell of tableToken.header) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n for (const row of tableToken.rows) {\n for (const cell of row) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n const listToken = token;\n values = values.concat(this.walkTokens(listToken.items, callback));\n break;\n }\n default: {\n const genericToken = token;\n if (this.defaults.extensions?.childTokens?.[genericToken.type]) {\n this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {\n const tokens = genericToken[childTokens].flat(Infinity);\n values = values.concat(this.walkTokens(tokens, callback));\n });\n }\n else if (genericToken.tokens) {\n values = values.concat(this.walkTokens(genericToken.tokens, callback));\n }\n }\n }\n }\n return values;\n }\n use(...args) {\n const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n // set async to true if it was set to true before\n opts.async = this.defaults.async || opts.async || false;\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if ('renderer' in ext) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function (...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n }\n else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if ('tokenizer' in ext) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n const extLevel = extensions[ext.level];\n if (extLevel) {\n extLevel.unshift(ext.tokenizer);\n }\n else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n }\n else {\n extensions.startBlock = [ext.start];\n }\n }\n else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n }\n else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if ('childTokens' in ext && ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = this.defaults.renderer || new _Renderer(this.defaults);\n for (const prop in pack.renderer) {\n if (!(prop in renderer)) {\n throw new Error(`renderer '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const rendererProp = prop;\n const rendererFunc = pack.renderer[rendererProp];\n const prevRenderer = renderer[rendererProp];\n // Replace renderer with func to run extension, but fall back if false\n renderer[rendererProp] = (...args) => {\n let ret = rendererFunc.apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret || '';\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);\n for (const prop in pack.tokenizer) {\n if (!(prop in tokenizer)) {\n throw new Error(`tokenizer '${prop}' does not exist`);\n }\n if (['options', 'rules', 'lexer'].includes(prop)) {\n // ignore options, rules, and lexer properties\n continue;\n }\n const tokenizerProp = prop;\n const tokenizerFunc = pack.tokenizer[tokenizerProp];\n const prevTokenizer = tokenizer[tokenizerProp];\n // Replace tokenizer with func to run extension, but fall back if false\n // @ts-expect-error cannot type tokenizer function dynamically\n tokenizer[tokenizerProp] = (...args) => {\n let ret = tokenizerFunc.apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = this.defaults.hooks || new _Hooks();\n for (const prop in pack.hooks) {\n if (!(prop in hooks)) {\n throw new Error(`hook '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const hooksProp = prop;\n const hooksFunc = pack.hooks[hooksProp];\n const prevHook = hooks[hooksProp];\n if (_Hooks.passThroughHooks.has(prop)) {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (arg) => {\n if (this.defaults.async) {\n return Promise.resolve(hooksFunc.call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n const ret = hooksFunc.call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n }\n else {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (...args) => {\n let ret = hooksFunc.apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = this.defaults.walkTokens;\n const packWalktokens = pack.walkTokens;\n opts.walkTokens = function (token) {\n let values = [];\n values.push(packWalktokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n this.defaults = { ...this.defaults, ...opts };\n });\n return this;\n }\n setOptions(opt) {\n this.defaults = { ...this.defaults, ...opt };\n return this;\n }\n lexer(src, options) {\n return _Lexer.lex(src, options ?? this.defaults);\n }\n parser(tokens, options) {\n return _Parser.parse(tokens, options ?? this.defaults);\n }\n #parseMarkdown(lexer, parser) {\n return (src, options) => {\n const origOpt = { ...options };\n const opt = { ...this.defaults, ...origOpt };\n // Show warning if an extension set async to true but the parse was called with async: false\n if (this.defaults.async === true && origOpt.async === false) {\n if (!opt.silent) {\n console.warn('marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.');\n }\n opt.async = true;\n }\n const throwError = this.#onError(!!opt.silent, !!opt.async);\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens)\n .then(tokens => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n let tokens = lexer(src, opt);\n if (opt.hooks) {\n tokens = opt.hooks.processAllTokens(tokens);\n }\n if (opt.walkTokens) {\n this.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n }\n catch (e) {\n return throwError(e);\n }\n };\n }\n #onError(silent, async) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape$1(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n return msg;\n }\n if (async) {\n return Promise.reject(e);\n }\n throw e;\n };\n }\n}\n\nconst markedInstance = new Marked();\nfunction marked(src, opt) {\n return markedInstance.parse(src, opt);\n}\n/**\n * Sets the default options.\n *\n * @param options Hash of options\n */\nmarked.options =\n marked.setOptions = function (options) {\n markedInstance.setOptions(options);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n };\n/**\n * Gets the original marked default options.\n */\nmarked.getDefaults = _getDefaults;\nmarked.defaults = _defaults;\n/**\n * Use Extension\n */\nmarked.use = function (...args) {\n markedInstance.use(...args);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n};\n/**\n * Run callback for every token\n */\nmarked.walkTokens = function (tokens, callback) {\n return markedInstance.walkTokens(tokens, callback);\n};\n/**\n * Compiles markdown to HTML without enclosing `p` tag.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options\n * @return String of compiled HTML\n */\nmarked.parseInline = markedInstance.parseInline;\n/**\n * Expose\n */\nmarked.Parser = _Parser;\nmarked.parser = _Parser.parse;\nmarked.Renderer = _Renderer;\nmarked.TextRenderer = _TextRenderer;\nmarked.Lexer = _Lexer;\nmarked.lexer = _Lexer.lex;\nmarked.Tokenizer = _Tokenizer;\nmarked.Hooks = _Hooks;\nmarked.parse = marked;\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = _Parser.parse;\nconst lexer = _Lexer.lex;\n\nexport { _Hooks as Hooks, _Lexer as Lexer, Marked, _Parser as Parser, _Renderer as Renderer, _TextRenderer as TextRenderer, _Tokenizer as Tokenizer, _defaults as defaults, _getDefaults as getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n//# sourceMappingURL=marked.esm.js.map\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralize$1 = {exports: {}};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eĆ©]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t}); \n} (pluralize$1));\n\nvar pluralizeExports = pluralize$1.exports;\nvar pluralize = /*@__PURE__*/getDefaultExportFromCjs(pluralizeExports);\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"šŸ‘»\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint });\n console.error(e);\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up šŸ˜–\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message);\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return { message, name, plugin, hint, elements, title, details, stack };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Creates showError, showWarning utilities for use in custom pre-process and\n * post-process plugins.\n * @param {string} pluginName\n */\nexport function makePluginUtils(pluginName) {\n /** @typedef {Parameters<typeof showError>[2]} Options */\n return {\n /** @type {(message: string, options?: Options) => void} */\n showError: (msg, options) => showError(msg, pluginName, options),\n /** @type {(message: string, options?: Options) => void} */\n showWarning: (msg, options) => showWarning(msg, pluginName, options),\n };\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n\n/**\n * Takes a text string, trims it, splits it into lines,\n * finds the common indentation level, and then de-indents every line\n * by that common indentation level.\n *\n * @param {string} text - The text to be re-indented.\n * @returns {string} The re-indented text.\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n background: var(--bg, #fff);\n color: rgb(120, 120, 120);\n color: var(--tocnav-normal-text, rgb(120, 120, 120));\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n box-shadow: 1px 1px 8px 0 var(--tocsidebar-shadow, rgba(100, 100, 100, 0.5));\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: var(--bg, #fff);\n color: var(--text, black);\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: var(--def-text, white);\n background: var(--def-bg, rgb(42, 90, 168));\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: var(--def-text, white);\n background: var(--defrow-border, rgb(42, 90, 168));\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: var(--tocnav-active-bg, #193766);\n color: var(--tocnav-active-text, black);\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"āš ļø\";\n}\n\n.respec-error-list > li::before {\n content: \"šŸ’„\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: var(--bg, #fff);\n color: var(--text, black);\n border: 5px solid #666;\n border-color: var(--tocsidebar-shadow, #666);\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n left: 0 !important;\n text-align: center;\n background: var(--tocsidebar-shadow, #ddd);\n color: var(--text, black);\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: var(--bg, white);\n color: var(--text, black);\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: var(--tocnav-hover-bg, #eee);\n color: var(--tocnav-hover-text, black);\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/markedjs/marked\n *\n */\n\nimport { getElementIndentation, reindent } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\n\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\n\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super\n .code(code, language, isEscaped)\n .replace(`class=\"language-`, `class=\"`);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw);\n }\n}\n\n/** @type {import('marked').MarkedOptions} */\nconst config = {\n gfm: true,\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport { reindent, xmlEscape } from \"./utils.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n āŒ\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}ā€¦\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${xmlEscape(err.message)}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/aom/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/aom/style.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/title.js\"),\n import(\"../src/aom/headers.js\"),\n import(\"../src/aom/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/aom/conformance.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n import(\"../src/core/dfn-contract.js\"),\n /* Linter must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/core/linter-rules/privsec-section.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// As ReSpec injects a bunch of stuff async, the scroll position is not always\n// at the right place when we are done processing. The purpose of this module\n// is to reset window's location hash, which will cause the browser to scroll\n// the window to the correct point in the document when processing is done.\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!window.location.hash) {\n return;\n }\n\n // We have to use .then() here because otherwise we would get stuck\n // awaiting this plugin to finish.\n document.respec.ready.then(() => {\n const hash = decodeURIComponent(window.location.hash).slice(1);\n\n let newHash = hash;\n /** @type {HTMLElement|null} */\n const element = document.getElementById(newHash);\n\n // Check if hash contains any non-word character.\n const isLegacyFrag = /\\W/.test(newHash);\n\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/speced/respec/issues/1353\n if (!element && isLegacyFrag) {\n const id = newHash\n // Replace all non-word characters with a dash.\n .replace(/[\\W]+/gim, \"-\")\n // Remove any leading dashes.\n .replace(/^-+/, \"\")\n // Remove any trailing dashes.\n .replace(/-+$/, \"\");\n\n /** @type {HTMLElement|null} */\n const updatedElement = document.getElementById(id);\n if (updatedElement) {\n newHash = id;\n }\n }\n window.location.hash = `#${newHash}`;\n });\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for AOM specs\n */\nexport const name = \"aom/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst licenses = new Map([\n [\n \"aom\",\n {\n name: \"Alliance for Open Media License\",\n short: \"AOM\",\n url: \"http://aomedia.org/license/\",\n },\n ],\n]);\n\nconst aomDefaults = {\n // treat document as \"Common Markdown\" (with a little bit of HTML).\n // choice between Markdown and HTML depends on the complexity of the spec\n // example of Markdown spec: https://github.com/WICG/netinfo/blob/gh-pages/index.html\n // Helpful guide: https://respec.org/docs/#markdown\n format: \"markdown\",\n logos: [\n {\n src: \"https://aomedia.org/assets/images/aomedia-icon-only.png\",\n alt: \"AOM\",\n id: \"AOM\",\n height: 170,\n width: 170,\n url: \"https://aomedia.org/\",\n },\n ],\n license: \"aom\",\n};\n\nfunction computeProps(conf) {\n return {\n licenseInfo: licenses.get(conf.license),\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...aomDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...aomDefaults,\n ...conf,\n lint,\n });\n\n // computed properties\n Object.assign(conf, computeProps(conf));\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOF --- */\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"Ā§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// The purpose of this module is to insert the default ReSpec CSS into the document.\n// If you don't want to use the default ReSpec CSS, set the `noReSpecCSS` configuration\n// option to `true`. If you want to use your own styles, create a ReSpec profile that\n// includes your own styles and sets the `noReSpecCSS` configuration option to `true`.\n\n/**\n * Module Name.\n * @type {string}\n */\nexport const name = \"core/style\";\n\nimport css from \"../styles/respec.css.js\";\n\n// Opportunistically inserts the style to reduce some FOUC.\n/** @type {HTMLStyleElement} */\nconst styleElement = insertStyle();\n\n/**\n * Inserts the ReSpec CSS as a `style` element into the document's `head`.\n * @return {HTMLStyleElement} The `style` element that was inserted.\n */\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\n/**\n * Removes the ReSpec CSS if the `noReSpecCSS` configuration option is `true`.\n * @param {Conf} conf The document configuration object.\n */\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n// Module aom/style\n// Inserts a link to the appropriate style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport {\n createResourceHint,\n linkCSS,\n showWarning,\n toKeyValuePairs,\n} from \"../core/utils.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"aom/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n script.src = `https://www.w3.org/scripts/TR/${version}/fixup.js`;\n doc.body.appendChild(script);\n}\n\n/**\n * Make a best effort to attach meta viewport at the top of the head.\n * Other plugins might subsequently push it down, but at least we start\n * at the right place. When ReSpec exports the HTML, it again moves the\n * meta viewport to the top of the head - so to make sure it's the first\n * thing the browser sees. See js/ui/save-html.js.\n */\nfunction createMetaViewport() {\n const meta = document.createElement(\"meta\");\n meta.name = \"viewport\";\n const contentProps = {\n width: \"device-width\",\n \"initial-scale\": \"1\",\n \"shrink-to-fit\": \"no\",\n };\n meta.content = toKeyValuePairs(contentProps).replace(/\"/g, \"\");\n return meta;\n}\n\nfunction createBaseStyle() {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = \"https://www.w3.org/StyleSheets/TR/2016/base.css\";\n link.classList.add(\"removeOnSave\");\n return link;\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C styles and scripts.\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2016/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: \"https://www.w3.org/StyleSheets/TR/2016/base.css\",\n as: \"style\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// Opportunistically apply base style\nelements.appendChild(createBaseStyle());\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(createMetaViewport());\n}\n\ndocument.head.prepend(elements);\n\nfunction styleMover(linkURL) {\n return exportDoc => {\n const w3cStyle = exportDoc.querySelector(`head link[href=\"${linkURL}\"]`);\n exportDoc.querySelector(\"head\").append(w3cStyle);\n };\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"`respecConfig.specStatus` missing. Defaulting to 'base'.\";\n conf.specStatus = \"base\";\n showWarning(msg, name);\n }\n\n let styleFile = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"PD\":\n styleFile = \"W3C-UD\";\n break;\n default:\n styleFile = \"base.css\";\n break;\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://www.w3.org/StyleSheets/TR/2016/${styleFile}`;\n linkCSS(document, finalStyleURL);\n // Make sure the W3C stylesheet is the last stylesheet, as required by W3C Pub Rules.\n const moveStyle = styleMover(finalStyleURL);\n sub(\"beforesave\", moveStyle);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n console.error(msg, el, err);\n showError(msg, name, { elements: [el] });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","// @ts-check\n/**\n * @module core/reindent\n *\n * Normalizes indents across the pre elements in the document,\n * so that indentation inside <pre> won't affect the rendered result.\n */\nimport { reindent } from \"./utils.js\";\nexport const name = \"core/reindent\";\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","/**\n * This module handles the creation of the h1#title of a spec and\n * makes sure the <title> always matches the h1.\n *\n * If no h1#title is included, then the <title> becomes the h1#title.\n *\n * When a h1#title is included, it always takes precedence over the\n * <title> of a spec. An error will be displayed in case of\n * any mismatch.\n *\n */\n\nimport { getIntlData, norm, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/title\";\n\nconst localizationStrings = {\n en: {\n default_title: \"No Title\",\n },\n de: {\n default_title: \"Kein Titel\",\n },\n zh: {\n default_title: \"ę— ę ‡é¢˜\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {HTMLElement} */\n const h1Elem =\n document.querySelector(\"h1#title\") || html`<h1 id=\"title\"></h1>`;\n\n // check existing element is ok to use\n if (h1Elem.isConnected && h1Elem.textContent.trim() === \"\") {\n const msg =\n \"The document is missing a title, so using a default title. \" +\n \"To fix this, please give your document a `<title>`. \" +\n \"If you need special markup in the document's title, \" +\n 'please use a `<h1 id=\"title\">`.';\n const title = \"Document is missing a title\";\n showError(msg, name, { title, elements: [h1Elem] });\n }\n\n // Decorate the spec title\n if (!h1Elem.id) h1Elem.id = \"title\";\n h1Elem.classList.add(\"title\");\n\n setDocumentTitle(conf, h1Elem);\n\n // This will get relocated by a template later.\n document.body.prepend(h1Elem);\n}\n\nfunction setDocumentTitle(conf, h1Elem) {\n // If the h1 is newly created, it won't be connected. In this case\n // we use the <title> or a localized fallback.\n if (!h1Elem.isConnected) {\n h1Elem.textContent = document.title || `${l10n.default_title}`;\n }\n // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.textContent);\n\n if (conf.isPreview && conf.prNumber) {\n const prUrl = conf.prUrl || `${conf.github.repoURL}pull/${conf.prNumber}`;\n const { childNodes } = html`\n Preview of PR <a href=\"${prUrl}\">#${conf.prNumber}</a>:\n `;\n h1Elem.prepend(...childNodes);\n documentTitle = `Preview of PR #${conf.prNumber}: ${documentTitle}`;\n }\n\n document.title = documentTitle;\n\n // conf.title is deperecated - we are keeping this here just to\n // retain backwards compat as we think the ePub generator\n // relies on it.\n conf.title = documentTitle;\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"core/templates/show-link\";\n\n/**\n * @param {object} link\n * @param {string} link.key\n * @param {string} [link.class]\n * @param {LinkData[]} [link.data]\n */\nexport default function showLink(link) {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n showWarning(msg, name);\n console.warn(msg, link);\n return;\n }\n return html`\n <dt class=\"${link.class ? link.class : null}\">${link.key}</dt>\n ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n `;\n}\n\n/**\n * @typedef {object} LinkData\n * @property {string} [LinkData.class]\n * @property {string} [LinkData.href]\n * @property {string} [LinkData.value]\n * @param {LinkData} data\n */\nfunction showLinkData(data) {\n return html`<dd class=\"${data.class ? data.class : null}\">\n ${data.href\n ? html`<a href=\"${data.href}\">${data.value || data.href}</a>`\n : data.value}\n </dd>`;\n}\n","// @ts-check\nimport { docLink, showError } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst name = \"core/templates/show-logo\";\n\n/**\n * Logo mapper. Takes a logo structure and converts it to HTML.\n *\n * @param {object} logo\n * @param {string} logo.src\n * @param {string} logo.url\n * @param {string} logo.alt\n * @param {string} [logo.id]\n * @param {number} [logo.width]\n * @param {number} [logo.height]\n * @param {number} index\n */\nexport default function showLogo(logo, index) {\n /** @type {HTMLAnchorElement} */\n const a = html`<a href=\"${logo.url || null}\" class=\"logo\"\n ><img\n alt=\"${logo.alt || null}\"\n crossorigin\n height=\"${logo.height || null}\"\n id=\"${logo.id || null}\"\n src=\"${logo.src || null}\"\n width=\"${logo.width || null}\"\n />\n </a>`;\n if (!logo.alt) {\n const src = logo.src ? `, with \\`src\\` ${logo.src}, ` : \"\";\n const msg = `Logo at index ${index}${src} is missing required \"\\`alt\\`\" property.`;\n const hint = docLink`Add the missing \"\\`alt\\`\" property describing the logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n if (!logo.src) {\n const msg = `Logo at index ${index} is missing \"\\`src\\`\" property.`;\n const hint = docLink`The \\`src\\` property is required on every logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n return a;\n}\n","// @ts-check\n\nconst name = \"core/templates/show-people\";\n\nimport {\n W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n until(date) {\n return html` Until ${date} `;\n },\n },\n es: {\n until(date) {\n return html` Hasta ${date} `;\n },\n },\n ko: {\n until(date) {\n return html` ${date} ģ“ģ „ `;\n },\n },\n ja: {\n until(date) {\n return html` ${date} 仄前 `;\n },\n },\n de: {\n until(date) {\n return html` bis ${date} `;\n },\n },\n zh: {\n until(date) {\n return html` ē›“到 ${date} `;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst orcidIcon = () =>\n html`<svg\n width=\"16\"\n height=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n >\n <style>\n .st1 {\n fill: #fff;\n }\n </style>\n <path\n d=\"M256 128c0 70.7-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0s128 57.3 128 128z\"\n fill=\"#a6ce39\"\n />\n <path\n class=\"st1\"\n d=\"M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z\"\n />\n </svg>`;\n\n/**\n * @param {Conf} conf\n * @param {\"editors\" | \"authors\" | \"formerEditors\"} propName - the name of the property of the people to render.\n */\nexport default function showPeople(conf, propName) {\n const people = conf[propName];\n if (!Array.isArray(people) || !people.length) return; // nothing to show...\n\n const validatePerson = personValidator(propName);\n return people.filter(validatePerson).map(personToHTML);\n}\n\n/**\n * @param {Person} person\n */\nfunction personToHTML(person) {\n // The following are treated as opt-in HTML by hyperHTML\n // we need to deprecate this!\n const personName = [person.name];\n const company = [person.company];\n const editorId = person.w3cid || null;\n const contents = [];\n if (person.mailto) {\n person.url = `mailto:${person.mailto}`;\n }\n if (person.url) {\n const url = new URL(person.url, document.location.href);\n const classList =\n url.protocol === \"mailto:\"\n ? \"ed_mailto u-email email p-name\"\n : \"u-url url p-name fn\";\n contents.push(\n html`<a class=\"${classList}\" href=\"${person.url}\">${personName}</a>`\n );\n } else {\n contents.push(html`<span class=\"p-name fn\">${personName}</span>`);\n }\n if (person.orcid) {\n contents.push(\n html`<a class=\"p-name orcid\" href=\"${person.orcid}\">${orcidIcon()}</a>`\n );\n }\n if (person.company) {\n const hCard = \"p-org org h-org\";\n const companyElem = person.companyURL\n ? html`<a class=\"${hCard}\" href=\"${person.companyURL}\">${company}</a>`\n : html`<span class=\"${hCard}\">${company}</span>`;\n contents.push(html` (${companyElem})`);\n }\n if (person.note) {\n contents.push(document.createTextNode(` (${person.note})`));\n }\n if (person.extras) {\n contents.push(...person.extras.map(extra => html`, ${renderExtra(extra)}`));\n }\n const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(retiredDate))}</time\n >`;\n contents.push(html` - ${l10n.until(time)} `);\n }\n const dd = html`<dd\n class=\"editor p-author h-card vcard\"\n data-editor-id=\"${editorId}\"\n >\n ${contents}\n </dd>`;\n return dd;\n}\n\nfunction renderExtra(extra) {\n const classVal = extra.class || null;\n const { name, href } = extra;\n return href\n ? html`<a href=\"${href}\" class=\"${classVal}\">${name}</a>`\n : html`<span class=\"${classVal}\">${name}</span>`;\n}\n\n/**\n *\n * @param {string} prop\n */\nfunction personValidator(prop) {\n /**\n * @param {Person} person\n * @param {Number} index\n */\n return function validatePerson(person, index) {\n const docsUrl = \"https://respec.org/docs/\";\n const seePersonHint = `See [person](${docsUrl}#person) configuration for available options.`;\n const preamble =\n `Error processing the [person object](${docsUrl}#person) ` +\n `at index ${index} of the \"[\\`${prop}\\`](${docsUrl}#${prop})\" configuration option.`;\n\n if (!person.name) {\n const msg = `${preamble} Missing required property \\`\"name\"\\`.`;\n showError(msg, name, { hint: seePersonHint });\n return false;\n }\n\n if (person.orcid) {\n const { orcid } = person;\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n\n if (orcidUrl.origin !== \"https://orcid.org\") {\n const msg = `${preamble} ORCID \"${person.orcid}\" at index ${index} is invalid.`;\n const hint = `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`;\n showError(msg, name, { hint });\n return false;\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n const msg = `${preamble} ORCID \"${orcidId}\" has wrong format.`;\n const hint = `ORCIDs have the format \"1234-1234-1234-1234.\"`;\n showError(msg, name, { hint });\n return false;\n }\n\n if (!checkOrcidChecksum(orcid)) {\n const msg = `${preamble} ORCID \"${orcid}\" failed checksum check.`;\n const hint = \"Please check that the ORCID is valid.\";\n showError(msg, name, { hint });\n return false;\n }\n\n // canonical form\n person.orcid = orcidUrl.href;\n }\n\n if (person.retiredDate && !isValidConfDate(person.retiredDate)) {\n const msg = `${preamble} The property \"\\`retiredDate\\`\" is not a valid date.`;\n showError(msg, name, {\n hint: `The expected format is YYYY-MM-DD. ${seePersonHint}`,\n });\n return false;\n }\n\n if (\n person.hasOwnProperty(\"extras\") &&\n !validateExtras(person.extras, seePersonHint, preamble)\n ) {\n return false;\n }\n\n if (person.url && person.mailto) {\n const msg = `${preamble} Has both \"url\" and \"mailto\" property.`;\n showWarning(msg, name, {\n hint: `Please choose either \"url\" or \"mailto\" (\"url\" is preferred). ${seePersonHint}`,\n });\n }\n\n if (person.companyURL && !person.company) {\n const msg = `${preamble} Has a \"\\`companyURL\\`\" property but no \"\\`company\\`\" property.`;\n showWarning(msg, name, {\n hint: `Please add a \"\\`company\\`\" property. ${seePersonHint}.`,\n });\n }\n return true;\n };\n}\n\n/**\n *\n * @param {PersonExtras[]} extras\n * @param {string} hint\n * @param {string} preamble\n */\nfunction validateExtras(extras, hint, preamble) {\n if (!Array.isArray(extras)) {\n showError(\n `${preamble}. A person's \"extras\" member must be an array.`,\n name,\n { hint }\n );\n return false;\n }\n return extras.every((extra, index) => {\n switch (true) {\n case typeof extra !== \"object\":\n showError(\n `${preamble}. Member \"extra\" at index ${index} is not an object.`,\n name,\n {\n hint,\n }\n );\n return false;\n case !extra.hasOwnProperty(\"name\"):\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} is missing required \"name\" member.`,\n name,\n { hint }\n );\n return false;\n case typeof extra.name === \"string\" && extra.name.trim() === \"\":\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} \"name\" can't be empty.`,\n name,\n { hint }\n );\n return false;\n }\n return true;\n });\n}\n\n/**\n * @param {string} orcid\n * @returns {boolean}\n */\nfunction checkOrcidChecksum(orcid) {\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcid[orcid.length - 1];\n const remainder = orcid\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n return lastDigit === lastDigitShould;\n}\n","// @ts-check\nimport { getIntlData } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nconst localizationStrings = {\n en: {\n author: \"Author:\",\n authors: \"Authors:\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest approved version:\",\n this_version: \"This version:\",\n issue_tracker: \"Issue Tracker:\",\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nfunction getSpecSubTitleElem(conf) {\n let specSubTitleElem = document.querySelector(\"h2#subtitle\");\n\n if (specSubTitleElem && specSubTitleElem.parentElement) {\n specSubTitleElem.remove();\n conf.subtitle = specSubTitleElem.textContent.trim();\n } else if (conf.subtitle) {\n specSubTitleElem = document.createElement(\"h2\");\n specSubTitleElem.textContent = conf.subtitle;\n specSubTitleElem.id = \"subtitle\";\n }\n if (specSubTitleElem) {\n specSubTitleElem.classList.add(\"subtitle\");\n }\n return specSubTitleElem;\n}\n\nexport default conf => {\n return html`<div class=\"head\">\n ${conf.specStatus !== \"PD\" ? conf.logos.map(showLogo) : \"\"}\n ${document.querySelector(\"h1#title\")} ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.textStatus} -\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\n <dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\">${conf.thisVersion}</a>\n </dd>\n <dt>${l10n.issue_tracker}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.issueTracker}\">${conf.issueTracker}</a>\n </dd>\n <dt>${conf.multipleEditors ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>${conf.multipleAuthors ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${renderCopyright(conf)}\n <hr />\n </div>`;\n};\n\nfunction renderCopyright(conf) {\n // If there is already a copyright, let's relocate it.\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n return existingCopyright;\n }\n return html`<p class=\"copyright\">\n Copyright ${conf.publishYear},\n <a href=\"https://www.w3.org/\"\n ><abbr title=\"The Alliance for Open Media\">AOM</abbr></a\n ><br />\n Licensing information is available at http://aomedia.org/license/<br />\n The MATERIALS ARE PROVIDED ā€œAS IS.ā€ The Alliance for Open Media, its\n members,and its contributors expressly disclaim any warranties (express,\n implied, or otherwise), including implied warranties of merchantability,\n non-infringement, fitness for a particular purpose, or title, related to the\n materials. The entire risk as to implementing or otherwise using the\n materials is assumed by the implementer and user. IN NO EVENT WILL THE\n ALLIANCE FOR OPEN MEDIA, ITS MEMBERS, OR CONTRIBUTORS BE LIABLE TO ANY OTHER\n PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL, INCIDENTAL, OR\n CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF ACTION OF ANY KIND\n WITH RESPECT TO THIS DELIVERABLE OR ITS GOVERNING AGREEMENT, WHETHER BASED\n ON BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND\n WHETHER OR NOT THE OTHER MEMBER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n DAMAGE.\n </p>`;\n}\n","// @ts-check\n// Module aom/headers\n// Generate the headers material based on the provided configuration.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n// - editors: an array of people editing the document (at least one is required). People\n// are defined using:\n// - name: the person's name (required)\n// - url: URI for the person's home page\n// - company: the person's company\n// - companyURL: the URI for the person's company\n// - mailto: the person's email\n// - note: a note on the person (e.g. former editor)\n// - authors: an array of people who are contributing authors of the document.\n// - formerEditors: an array of people that had earlier edited the document but no longer edit.\n// - subtitle: a subtitle for the specification\n// - publishDate: the date to use for the publication, default to document.lastModified, and\n// failing that to now. The format is YYYY-MM-DD or a Date object.\n// - alternateFormats: a list of alternate formats for the document, each of which being\n// defined by:\n// - uri: the URI to the alternate\n// - label: a label for the alternate\n// - lang: optional language\n// - type: optional MIME type\n// - logos: a list of logos to use instead of the W3C logo, each of which being defined by:\n// - src: the URI to the logo (target of <img src=>)\n// - alt: alternate text for the image (<img alt=>), defaults to \"Logo\" or \"Logo 1\", \"Logo 2\", ...\n// if src is not specified, this is the text of the \"logo\"\n// - height: optional height of the logo (<img height=>)\n// - width: optional width of the logo (<img width=>)\n// - url: the URI to the organization represented by the logo (target of <a href=>)\n// - id: optional id for the logo, permits custom CSS (wraps logo in <span id=>)\n// - each logo element must specify either src or alt\n// - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc).\n// Example of usage: [{key: \"foo\", href:\"https://b\"}, {key: \"bar\", href:\"https://\"}].\n// Allowed values are:\n// - key: the key for the <dt> (e.g., \"Bug Tracker\"). Required.\n// - value: The value that will appear in the <dd> (e.g., \"GitHub\"). Optional.\n// - href: a URL for the value (e.g., \"https://foo.com/issues\"). Optional.\n// - class: a string representing CSS classes. Optional.\n// - license: can be one of the following\n// - \"aom\"\nimport { ISODate, showError } from \"../core/utils.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { pub } from \"../core/pubsubhub.js\";\n\nexport const name = \"aom/headers\";\n\nconst status2text = {\n PD: \"Pre-Draft\",\n WGD: \"AOM Work Group Draft\",\n WGA: \"AOM Working Group Approved Draft\",\n FD: \"AOM Final Deliverable\",\n};\n\nconst AOMDate = new Intl.DateTimeFormat([\"en-US\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n});\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg =\n `[\\`${prop}\\`](https://github.com/speced/respec/wiki/${prop}) ` +\n `is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"Missing required configuration: `specStatus`\";\n showError(msg, name);\n }\n conf.title = document.title || \"No title\";\n if (!conf.subtitle) conf.subtitle = \"\";\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.thisVersion = `https://aomediacodec.github.io/${conf.shortName}/`;\n conf.issueTracker = `https://github.com/AOMediaCodec/${conf.shortName}/issues/`;\n conf.publishYear = conf.publishDate.getUTCFullYear();\n conf.publishHumanDate = AOMDate.format(conf.publishDate);\n const peopCheck = function (it) {\n if (!it.name) {\n const msg = \"All authors and editors must have a name.\";\n showError(msg, name);\n }\n };\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\n conf.editors.forEach(peopCheck);\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n }\n if (!conf.editors || conf.editors.length === 0) {\n const msg = \"At least one editor is required\";\n showError(msg, name);\n }\n if (conf.formerEditors.length) {\n conf.formerEditors.forEach(peopCheck);\n }\n if (conf.authors) {\n conf.authors.forEach(peopCheck);\n }\n conf.multipleEditors = conf.editors && conf.editors.length > 1;\n conf.multipleFormerEditors = conf.formerEditors.length > 1;\n conf.multipleAuthors = conf.authors && conf.authors.length > 1;\n // (conf.alternateFormats || []).forEach(it => {\n // if (!it.uri || !it.label) {\n // const msg = \"All alternate formats must have a uri and a label.\";\n // showError(msg, name);\n // }\n // });\n if (conf.copyrightStart && conf.copyrightStart == conf.publishYear)\n conf.copyrightStart = \"\";\n conf.textStatus = status2text[conf.specStatus];\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n // configuration done - yay!\n\n // insert into document\n const header = headersTmpl(conf);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // Requested by https://github.com/speced/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: `${conf.longStatus} ${conf.publishHumanDate}`,\n });\n}\n","// @ts-check\n// Module aom/abstract\n// Handle the abstract section properly.\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"aom/abstract\";\n\nconst localizationStrings = {\n en: {\n abstract: \"Abstract\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run() {\n const abs = document.getElementById(\"abstract\");\n if (!abs) {\n const msg = `Document must have one element with \\`id=\"abstract\"`;\n showError(msg, name);\n return;\n }\n abs.classList.add(\"introductory\");\n let abstractHeading = document.querySelector(\"#abstract>h2\");\n if (abstractHeading) {\n return;\n }\n abstractHeading = document.createElement(\"h2\");\n abstractHeading.textContent = l10n.abstract;\n abs.prepend(abstractHeading);\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Module core/data-abbr\n// - Finds all elements with data-abbr attribute and processes them.\nimport { showError } from \"./utils.js\";\nexport const name = \"core/dfn-abbr\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = document.querySelectorAll(\"[data-abbr]\");\n for (const elem of elements) {\n const { localName } = elem;\n switch (localName) {\n case \"dfn\":\n processDfnElement(elem);\n break;\n default: {\n const msg = `\\`data-abbr\\` attribute not supported on \\`${localName}\\` elements.`;\n showError(msg, name, {\n elements: [elem],\n title: \"Error: unsupported.\",\n });\n }\n }\n }\n}\n/**\n * @param {HTMLElement} dfn\n */\nfunction processDfnElement(dfn) {\n const abbr = generateAbbreviation(dfn);\n // get normalized <dfn> textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (<abbr title=\"${fullForm}\">${abbr}</abbr>)`\n );\n const lt = dfn.dataset.lt || \"\";\n dfn.dataset.lt = lt\n .split(\"|\")\n .filter(i => i.trim())\n .concat(abbr)\n .join(\"|\");\n}\n\nfunction generateAbbreviation(elem) {\n if (elem.dataset.abbr) return elem.dataset.abbr;\n // Generates abbreviation from textContent\n // e.g., \"Permanent Account Number\" -> \"PAN\"\n return elem.textContent\n .match(/\\b([a-z])/gi)\n .join(\"\")\n .toUpperCase();\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/speced/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"ģ°øģ”°\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参ē…§ē”Øå‚č€ƒę–‡ēŒ®\",\n norm_references: \"č¦ēƄēš„å‚č€ƒę–‡ēŒ®\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n de: {\n info_references: \"WeiterfĆ¼hrende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"éžč§„čŒƒę€§å¼•ē”Ø\",\n norm_references: \"č§„čŒƒę€§å¼•ē”Ø\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMƜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NƖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDƜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKƖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;\"?<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn or a `a`, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn,a\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn|abstract-op\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n /** @param {string} str */\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","// @ts-check\n// Module aom/conformance\n// Handle the conformance section properly.\nimport { getIntlData, htmlJoinAnd, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"aom/conformance\";\n\nconst localizationStrings = {\n en: {\n conformance: \"Conformance\",\n normativity:\n \"As well as sections marked as non-normative, all authoring guidelines, \" +\n \"diagrams, examples, and notes in this specification are non-normative. \" +\n \"Everything else in this specification is normative.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n The key word${plural ? \"s\" : \"\"} ${keywords} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n when, and only when, they appear in all capitals, as shown here.\n </p>`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = [...Object.keys(rfc2119Usage)];\n // Add RFC2119 to bibliography\n if (terms.length) {\n conf.normativeReferences.add(\"RFC2119\");\n conf.normativeReferences.add(\"RFC8174\");\n }\n // Put in the 2119 clause and reference\n const keywords = htmlJoinAnd(\n terms.sort(),\n item => html`<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h1>${l10n.conformance}</h1>\n <p>${l10n.normativity}</p>\n ${terms.length ? l10n.keywordInterpretation(keywords, plural) : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance && !conformance.classList.contains(\"override\")) {\n processConformance(conformance, conf);\n }\n // Warn when there are RFC2119/RFC8174 keywords, but not conformance section\n if (!conformance && Object.keys(rfc2119Usage).length) {\n const msg = `Document uses RFC2119 keywords but lacks a conformance section.`;\n const hint = 'Please add a `<section id=\"conformance\">`.';\n showWarning(msg, name, { hint });\n }\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"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`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"ģ˜ˆģ‹œ\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-color: var(--warning-border, #f11);\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n background: var(--warning-bg, #fbe9e9);\n color: black;\n color: var(--text, black);\n}\n\n.warning-title:before {\n content: \"āš \"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"ę³Ø\",\n editors_note: \"ē·Ø者ę³Ø\",\n feature_at_risk: \"(å¤‰ę›“ć®åÆčƒ½ę€§ć®ć‚ć‚‹ę©Ÿčƒ½) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 恮要ē“„\",\n no_issues_in_spec: \"ć“ć®ä»•ę§˜ć«ćÆęœŖč§£ę±ŗ恮 issues ćÆå«ć¾ć‚Œć¦ć„ć¾ć›ć‚“ļ¼Ž\",\n warning: \"č­¦å‘Š\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"CuestiĆ³n\",\n issue_summary: \"Resumen de la cuestiĆ³n\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificaciĆ³n.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthƤlt keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"ē¼–者ę³Ø\",\n feature_at_risk: \"ļ¼ˆęœ‰åÆčƒ½å˜åŠØēš„ē‰¹ę€§ļ¼‰Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue ꀻē»“\",\n no_issues_in_spec: \"ęœ¬č§„čŒƒäø­ęœŖ列å‡ŗ任何 issue怂\",\n note: \"ę³Ø\",\n warning: \"č­¦å‘Š\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"꜀č‰Æå®Ÿę–½ä¾‹ \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"ęœ€ä½³å®žč·µ \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"å›³ć®ćƒŖć‚¹ćƒˆ\",\n },\n ko: {\n fig: \"ź·øė¦¼ \",\n list_of_figures: \"ź·øė¦¼ ėŖ©ė”\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范äø­åŒ…含ēš„图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of the specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n *\n * @module core/data-cite\n */\n\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to the current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n * @type {string}\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * Gets the link properties for the given citation details.\n * @param {CiteDetails} citeDetails - The citation details.\n * @returns {Promise<LinkProps|null>} The link properties or null if not found.\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/speced/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n\n return { href, title };\n}\n\n/**\n * Links the given element with the provided link properties and citation details.\n * @param {HTMLElement} elem - The element to link.\n * @param {LinkProps} linkProps - The link properties.\n * @param {CiteDetails} citeDetails - The citation details.\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n anchor.dataset.cite = citeDetails.key;\n anchor.dataset.citePath = citeDetails.path;\n anchor.dataset.citeFrag = citeDetails.frag;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting a linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * Converts the given raw key to citation details.\n * @param {HTMLElement} elem - The element containing the citation details.\n * @returns {CiteDetails} The citation details.\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as a fragment\n return toCiteDetails(elem);\n }\n\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\n/**\n * Runs the data-cite processing on elements with the data-cite attribute.\n */\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetches and updates `biblio` with entries corresponding to the given elements.\n * @param {HTMLElement[]} elems - The elements requiring biblio entries.\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/**\n * Cleans up the data-cite attributes from the document.\n * @param {Document} doc - The document to cleanup.\n */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ć®é‡č¤‡å®šē¾©`;\n },\n duplicateTitle: \"恓恮ꖇę›øå†…ć§č¤‡ę•°å›žå®šē¾©ć•ć‚Œć¦ć„ć¾ć™ļ¼Ž\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthƤlt mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ēš„重复定义`;\n },\n duplicateTitle: \"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n for (const type of linkType.split(\"|\")) {\n if (dfnsByType.get(type)) {\n return dfnsByType.get(type);\n }\n }\n return dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name);\n console.error(error);\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大ēŗ²\",\n },\n ko: {\n toc: \"ėŖ©ģ°Ø\",\n },\n ja: {\n toc: \"ē›®ę¬”\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at Ā§1, we will keep Ā§1.1 but not Ā§1.1.1\n // Similarly, `data-max-toc=1` will keep Ā§1, but not Ā§1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"ģ“ ė¶€ė¶„ģ€ ė¹„ź·œė²”ģ ģž…ė‹ˆė‹¤.\",\n },\n ja: {\n informative: \"恓恮ēƀćÆä»•ę§˜ć«ćÆå«ć¾ć‚Œć¾ć›ć‚“ļ¼Ž\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"äæå­˜ć™ć‚‹\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"åƼå‡ŗ\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"šŸ’¾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关äŗŽ\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"ć“ć‚Œć«ć¤ć„ć¦\",\n },\n de: {\n about_respec: \"Ɯber\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ā„¹ļø\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/speced/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/speced/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\nimport { html } from \"../core/import-maps.js\";\n\nexport const name = \"core/seo\";\n\nexport function run(conf) {\n if (conf.gitRevision) {\n // This allows to set a git revision of the source used to produce the\n // generated content. Typically, this would be set when generating the\n // static HTML via a build process.\n // 'revision' is the name recommended in https://wiki.whatwg.org/wiki/MetaExtensions\n const metaElem = html`<meta\n name=\"revision\"\n content=\"${conf.gitRevision}\"\n />`;\n document.head.appendChild(metaElem);\n }\n\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","/*\nOne Light for ReSpec, with better color contrast\nAdapted from Atom One Light by Daniel Gamage (https://github.com/highlightjs/highlight.js/blob/c0b6ddbaaf7/src/styles/atom-one-light.css>\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n --base: #fafafa;\n --mono-1: #383a42;\n --mono-2: #686b77;\n --mono-3: #717277;\n --hue-1: #0b76c5;\n --hue-2: #336ae3;\n --hue-3: #a626a4;\n --hue-4: #42803c;\n --hue-5: #ca4706;\n --hue-5-2: #c91243;\n --hue-6: #986801;\n --hue-6-2: #9a6a01;\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n .hljs {\n --base: #282c34;\n --mono-1: #abb2bf;\n --mono-2: #818896;\n --mono-3: #5c6370;\n --hue-1: #56b6c2;\n --hue-2: #61aeee;\n --hue-3: #c678dd;\n --hue-4: #98c379;\n --hue-5: #e06c75;\n --hue-5-2: #be5046;\n --hue-6: #d19a66;\n --hue-6-2: #e6c07b;\n }\n}\n\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n color: var(--mono-1, #383a42);\n background: #fafafa;\n background: var(--base, #fafafa);\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n color: var(--mono-3, #717277);\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n color: var(--hue-3, #a626a4);\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n color: var(--hue-5, #ca4706);\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n color: var(--hue-1, #0b76c5);\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n color: var(--hue-4, #42803c);\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n color: var(--hue-6-2, #9a6a01);\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n color: var(--hue-6, #986801);\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n color: var(--hue-2, #336ae3);\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n var.respec-hl {\n filter: saturate(0.9) brightness(0.9)\n }\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within the algorithm or the encompassing section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\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","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar {\n position: relative;\n cursor: pointer;\n}\n\nvar[data-type]::before,\nvar[data-type]::after {\n position: absolute;\n left: 50%;\n top: -6px;\n opacity: 0;\n transition: opacity 0.4s;\n pointer-events: none;\n}\n\n/* the triangle or arrow or caret or whatever */\nvar[data-type]::before {\n content: \"\";\n transform: translateX(-50%);\n border-width: 4px 6px 0 6px;\n border-style: solid;\n border-color: transparent;\n border-top-color: #222;\n}\n\n/* actual text */\nvar[data-type]::after {\n content: attr(data-type);\n transform: translateX(-50%) translateY(-100%);\n background: #222;\n text-align: center;\n /* additional styling */\n font-family: \"Dank Mono\", \"Fira Code\", monospace;\n font-style: normal;\n padding: 6px;\n border-radius: 3px;\n color: #daca88;\n text-indent: 0;\n font-weight: normal;\n}\n\nvar[data-type]:hover::after,\nvar[data-type]:hover::before {\n opacity: 1;\n}\n`;\n","// @ts-check\n/**\n * Module core/data-type\n * Propagates data type of a <var> to subsequent instances within a section.\n * Also adds the CSS for the data type tooltip.\n * Set `conf.highlightVars = true` to enable.\n */\nimport css from \"../styles/datatype.css.js\";\n\nexport const name = \"core/data-type\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n\n let section = null;\n const varMap = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const variables = document.querySelectorAll(\"section var\");\n for (const varElem of variables) {\n const currentSection = varElem.closest(\"section\");\n if (section !== currentSection) {\n section = currentSection;\n varMap.clear();\n }\n if (varElem.dataset.type) {\n varMap.set(varElem.textContent.trim(), varElem.dataset.type);\n continue;\n }\n const type = varMap.get(varElem.textContent.trim());\n if (type) varElem.dataset.type = type;\n }\n}\n","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n:root {\n --assertion-border: #aaa;\n --assertion-bg: #eee;\n --assertion-text: black;\n}\n\n.assert {\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n border-color: #aaa;\n border-color: var(--assertion-border);\n background: #eee;\n background: var(--assertion-bg);\n color: black;\n color: var(--assertion-text);\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n :root {\n --assertion-border: #444;\n --assertion-bg: var(--borderedblock-bg);\n --assertion-text: var(--text);\n }\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"Ā§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/speced/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n background: var(--indextable-hover-bg, #fff);\n color: black;\n color: var(--text, black);\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: 0 1em 3em -0.4em var(--tocsidebar-shadow, rgba(0, 0, 0, 0.3)),\n 0 0 1px 1px var(--tocsidebar-shadow, rgba(0, 0, 0, 0.05));\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n border-bottom-color: var(--indextable-hover-bg, #fff);\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n /* TODO: need slightly darker shade */\n border-bottom-color: var(--indextable-hover-bg, #a2a9b1);\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n color: var(--text, #000);\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n color: var(--text, #333);\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => {\n return html`<li>\n ${toLinkProps(entry).map(link => {\n return html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a\n >${\" \"}`;\n })}\n </li>`;\n };\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `Ā§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/speced/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"ģ°øģ—¬\",\n },\n zh: {\n file_a_bug: \"反馈错čÆÆ\",\n participate: \"参äøŽļ¼š\",\n },\n ja: {\n commit_history: \"å¤‰ę›“å±„ę­“\",\n file_a_bug: \"問锌報告\",\n participate: \"å‚åŠ ę–¹ę³•ļ¼š\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${ghURL.href}).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","// @ts-check\n/**\n * Fetches commits between two commitish (tag or commit) - `from` and `to=HEAD`\n * and shows them as a list of \"changes during\" those commitish. If a filter\n * function is provided by the user, it is used to filter the commits that are\n * to be shown. Otherwise, all commits are shown.\n *\n * @typedef {{message: string, hash: string}} Commit\n */\nimport { github } from \"../github.js\";\nimport { html } from \"../import-maps.js\";\nimport { showError } from \"../utils.js\";\n\nexport const name = \"rs-changelog\";\n\nexport const element = class ChangelogElement extends HTMLElement {\n constructor() {\n super();\n this.props = {\n from: this.getAttribute(\"from\"),\n to: this.getAttribute(\"to\") || \"HEAD\",\n /** @type {(commit: Commit) => boolean} */\n filter:\n typeof window[this.getAttribute(\"filter\")] === \"function\"\n ? window[this.getAttribute(\"filter\")]\n : () => true,\n };\n }\n\n connectedCallback() {\n const { from, to, filter } = this.props;\n html.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error => showError(error.message, name, { elements: [this] }))\n .finally(() => {\n this.dispatchEvent(new CustomEvent(\"done\"));\n }),\n placeholder: \"Loading list of commits...\",\n }}\n </ul>\n `;\n }\n};\n\nasync function fetchCommits(from, to, filter) {\n /** @type {Commit[]} */\n let commits;\n try {\n const gh = await github;\n if (!gh) {\n throw new Error(\"`respecConfig.github` is not set\");\n }\n const url = new URL(\"commits\", `${gh.apiBase}/${gh.fullName}/`);\n url.searchParams.set(\"from\", from);\n url.searchParams.set(\"to\", to);\n\n const res = await fetch(url.href);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n commits = await res.json();\n if (!commits.length) {\n throw new Error(`No commits between ${from}..${to}.`);\n }\n commits = commits.filter(filter);\n } catch (error) {\n const msg = `Error loading commits from GitHub. ${error.message}`;\n console.error(error);\n throw new Error(msg);\n }\n return commits;\n}\n\nasync function toHTML(commits) {\n const { repoURL } = await github;\n return commits.map(commit => {\n const [message, prNumber = null] = commit.message.split(/\\(#(\\d+)\\)/, 2);\n const commitURL = `${repoURL}commit/${commit.hash}`;\n const prURL = prNumber ? `${repoURL}pull/${prNumber}` : null;\n const pr = prNumber && html` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return html`<li><a href=\"${commitURL}\">${message.trim()}</a>${pr}</li>`;\n });\n}\n","// @ts-check\n/**\n * Registers custom elements and waits for them to finish their processing.\n *\n * Every custom element file exports:\n * - `name`: registered name of the custom element, prefixed with `rs-`.\n * - `element`: class defintion of the custom element.\n *\n * Every custom element must dispatch a CustomEvent 'done' that tells the\n * element has finished its processing, with or without errors.\n *\n * @typedef {{ name: string, element: CustomElementConstructor }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements/index\";\n\nexport async function run() {\n // prepare and register elements\n CUSTOM_ELEMENTS.forEach(el => {\n customElements.define(el.name, el.element);\n });\n\n // wait for each element to be ready\n const selectors = CUSTOM_ELEMENTS.map(el => el.name).join(\", \");\n const elems = document.querySelectorAll(selectors);\n const readyPromises = [...elems].map(\n el => new Promise(res => el.addEventListener(\"done\", res, { once: true }))\n );\n await Promise.all(readyPromises);\n}\n","export const name = \"core/dfn-contract\";\n\nexport function run() {\n addContractDefaults();\n addDefinitionPointers();\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n\n// - Sets data-defines on well-known definition content patterns\nfunction addDefinitionPointers() {\n // A dl with class hasdefinitions associated the dfn in each dt\n // the definition in the following sibling element\n /** @type NodeListOf<HTMLElement> */\n const describedDTs = document.querySelectorAll(\n \"dl.definitions dt:has(dfn[data-dfn-type])\"\n );\n for (const dt of describedDTs) {\n const dfnId = dt.querySelector(\"dfn[data-dfn-type]\").id;\n const dfnContent = /** @type {HTMLElement | null} */ (\n dt.nextElementSibling\n );\n if (dfnContent && !dfnContent.dataset.defines && dfnId) {\n dfnContent.dataset.defines = `#${dfnId}`;\n }\n }\n\n // an element with class \"definition\" is marked as defining the term\n // found in the element\n /** @type NodeListOf<HTMLElement> */\n const definitionContainers = document.querySelectorAll(\n \".definition:has(dfn[data-dfn-type])\"\n );\n for (const el of definitionContainers) {\n const dfn = el.querySelector(\"dfn[data-dfn-type]\");\n if (dfn.id && !el.dataset.defines) {\n el.dataset.defines = `#${dfn.id}`;\n }\n }\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ \\`<meta>\\` ꠇē­¾`,\n hint: `å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ \\`<head>\\` éƒØ分ā€”ā€” \\`<meta charset=\"utf-8\">\\` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂\",\n hint: \"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * Checks that there is a section that has at least privacy and/or\n * security and considerations.\n *\n * The rule is \"privacy\" or \"security\", and \"considerations\", in any order,\n * case-insensitive, multi-line check.\n *\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"privsec-section\";\nexport const name = \"core/linter-rules/privsec-section\";\n\nconst localizationStrings = {\n en: {\n msg: \"Document must have a 'Privacy and/or Security' Considerations section.\",\n hint:\n \"Add a privacy and/or security considerations section. \" +\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nfunction hasPriSecConsiderations(doc) {\n return Array.from(doc.querySelectorAll(\"h2, h3, h4, h5, h6\")).some(\n ({ textContent: text }) => {\n const saysPrivOrSec = /(privacy|security)/im.test(text);\n const saysConsiderations = /(considerations)/im.test(text);\n return (saysPrivOrSec && saysConsiderations) || saysPrivOrSec;\n }\n );\n}\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n if (conf.isRecTrack && !hasPriSecConsiderations(document)) {\n showWarning(l10n.msg, name, { hint: l10n.hint });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,\n hint: \"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","instanceOfAny","constructors","some","c","idbProxyableTypes","cursorAdvanceMethods","transactionDoneMap","WeakMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","replaceTraps","wrapFunction","func","IDBCursor","prototype","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","request","transformCachableValue","tx","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","cacheDonePromiseForTransaction","IDBDatabase","IDBObjectStore","IDBIndex","Proxy","IDBRequest","promise","success","result","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","transaction","store","index","shift","oldTraps","advanceMethodProps","methodMap","advanceResults","ittrProxiedCursorToOriginalProxy","cursorIteratorTraps","cachedFunc","iterate","cursor","openCursor","proxiedCursor","delete","isIteratorProp","Symbol","asyncIterator","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","catch","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","_getDefaults","breaks","extensions","gfm","hooks","pedantic","renderer","silent","tokenizer","walkTokens","_defaults","changeDefaults","newDefaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape$1","encode","unescapeTest","unescape","_","n","charAt","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","valSource","getRegex","cleanUrl","href","encodeURI","noopTest","exec","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","i","trim","length","pop","splice","push","rtrim","invert","l","suffLen","currChar","slice","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","_Tokenizer","rules","constructor","space","src","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","anyPunctuation","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","bull","isordered","ordered","start","loose","items","itemRegex","itemContents","endsWithBlankLine","endEarly","line","t","repeat","nextLine","indent","trimStart","search","blankLine","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","rawLine","ischecked","istask","task","checked","trimEnd","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","headers","aligns","rows","item","header","align","row","cell","lheading","paragraph","escape","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","indexOf","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","emStrongLDelim","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","emStrongRDelimAst","emStrongRDelimUnd","lastIndex","lastCharLength","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","bullet","_paragraph","_blockLabel","_tag","_comment","blockNormal","gfmTable","blockGfm","blockPedantic","_punctuation","_inlineComment","_inlineLabel","inlineNormal","blockSkip","reflinkSearch","inlinePedantic","inlineGfm","inlineBreaks","normal","_Lexer","inlineQueue","Object","create","lex","lexInline","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","call","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","charCodeAt","console","keepPrevChar","keys","lastIndexOf","startInline","_Renderer","infostring","quote","body","listitem","checkbox","tablerow","content","tablecell","flags","strong","em","cleanHref","out","image","_TextRenderer","_Parser","textRenderer","parse","parseInline","renderers","genericToken","ret","parser","headingToken","codeToken","tableToken","j","k","blockquoteToken","listToken","itemBody","unshift","htmlToken","paragraphToken","textToken","escapeToken","tagToken","linkToken","imageToken","strongToken","emToken","codespanToken","delToken","_Hooks","static","Set","preprocess","markdown","postprocess","processAllTokens","markedInstance","defaults","setOptions","parseMarkdown","Parser","Renderer","TextRenderer","Lexer","Tokenizer","Hooks","use","values","concat","childTokens","flat","pack","opts","ext","prevRenderer","extLevel","rendererProp","rendererFunc","tokenizerProp","tokenizerFunc","prevTokenizer","hooksProp","hooksFunc","prevHook","passThroughHooks","arg","packWalktokens","origOpt","warn","throwError","onError","toString","message","msg","marked","getDefaults","globalThis","global","getDefaultExportFromCjs","x","__esModule","hasOwnProperty","module","pluralize$1","exports","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","arguments","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","configurable","o","random","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","v","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ne","re","ie","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","sort","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","setTimeout","addedNodes","removedNodes","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","key","serialize","_pluralize","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","startsWith","W3CDate","nonNormativeSelector","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","getElementsByTagName","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","markAsOffending","toJSON","details","showError","pluginName","makePluginUtils","toMDCode","codedJoinOr","quotes","docLink","strings","reindent","endsWith","linkingText","lines","indents","leastIndent","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","toHTML","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodeURIComponent","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","utils","err","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$h","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","buttonId","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$p","style$1","dataInclude","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","saveHtml","aboutRespec","seo","highlight","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","dfnContract","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","newHash","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","aomDefaults","logos","alt","height","width","license","licenseInfo","computeProps","css$f","noReSpecCSS","resourceHints","createResourceHints","createBaseStyle","meta","delimiter","separator","toKeyValuePairs","createMetaViewport","styleFile","noToc","attachFixupScript","finalStyleURL","linkURL","urls","frag","reduce","nextLink","linkCSS","exportDoc","w3cStyle","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","default_title","zh","h1Elem","isConnected","tempElem","documentTitle","isPreview","prNumber","prUrl","github","repoURL","setDocumentTitle","showLink","class","showLinkData","showLogo","logo","until","date","es","ko","ja","orcidIcon","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","remainder","Number","acc","lastDigitInt","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","Date","extras","every","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","protocol","hCard","companyElem","note","classVal","renderExtra","time","author","authors","editor","editors","former_editor","former_editors","latest_editors_draft","latest_published_version","this_version","issue_tracker","headersTmpl","specSubTitleElem","subtitle","getSpecSubTitleElem","textStatus","dashDate","publishHumanDate","thisVersion","issueTracker","multipleEditors","formerEditors","multipleFormerEditors","multipleAuthors","otherLinks","existingCopyright","publishYear","renderCopyright","status2text","PD","WGD","WGA","FD","AOMDate","publishDate","fallbackDate","isFinite","formattedDate","validateDateAndRecover","lastModified","shortName","getUTCFullYear","peopCheck","copyrightStart","publishISODate","toISOString","generatedSubtitle","longStatus","abs","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","base","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","range","IDBKeyRange","lowerBound","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","addAll","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","clear","storeNames","stores","clearStorePromises","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","nl","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","normativity","keywordInterpretation","processConformance","terms","contains","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","closestType","computeExport","export","titles","pluralizeDfn","dfnTexts","dfns","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$d","makeTitle","num","report","number","div","inAside","exampleTitle","css$b","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","handleIssues","ins","ghIssues","getIssueNumber","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","issueBase","atRiskBase","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","issuesURL","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","apiBase","issueNumbers","fullName","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","decorateTableOfFigures","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","citePath","citeFrag","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","about_respec","getEntriesByType","duration","round","perfEntryToTR","gitRevision","metaElem","firstParagraph","css$9","fetchBase","_documentCurrentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","css$5","varMap","variables","currentSection","css$3","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","file_a_bug","participate","commit_history","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","dfnsWithNoType","exportableDfns","addContractDefaults","describedDTs","dfnId","dfnContent","defines","definitionContainers","addDefinitionPointers","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"qHACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IACrD,EACEV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCtBO,MAIDC,EAAgB,IAAIC,YAOnB,S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AAU,MACX,CAAC,WAAY,OACb,CAAC,OAAQ,QACTtH,SAAQ,SAAUsH,GAClB,OAAOR,EAAU0B,cAAclB,EAAK,GAAIA,EAAK,GAClD,IAKG,CACE,CAAC,MAAO,IACR,CAAC,SAAU,MACX,CAAC,gEAAiE,QAClE,CAAC,kCAAmC,OACpC,CAAC,QAAS,KACV,CAAC,uFAAwF,QACzF,CAAC,oBAAqB,QACtB,CAAC,uBAAwB,UACzB,CAAC,sBAAuB,MACxB,CAAC,2FAA4F,MAC7F,CAAC,qEAAsE,SACvE,CAAC,iCAAkC,MACnC,CAAC,oBAAqB,QACtB,CAAC,4FAA6F,QAC9F,CAAC,yGAA0G,QAC3G,CAAC,8FAA+F,QAChG,CAAC,0BAA2B,OAC5B,CAAC,+BAAgC,QACjC,CAAC,sBAAuB,QACxB,CAAC,oBAAqB,UACtB,CAAC,eAAgB,MACjB,CAAC,YAAa,MACd,CAAC,QAAS,QACVtH,SAAQ,SAAUsH,GAClB,OAAOR,EAAU4B,gBAAgBpB,EAAK,GAAIA,EAAK,GACpD,IAKG,CAEE,YACA,SACA,SACA,MACA,WACA,UACA,OACA,YACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,SACA,WACA,YACA,MACA,SACA,YACA,YACA,YACA,WACA,WACA,MACA,UACA,UACA,WACA,WACA,eACA,SACA,SACA,YACA,WACA,YACA,cACA,QACA,UACA,QACA,SACA,aACA,YACA,WACA,OACA,QACA,OACA,QACA,QACA,MACA,QACA,OACA,OACA,YACA,OACA,WACA,SACA,SACA,YACA,WACA,OACA,WACA,OACA,SACA,WACA,SACA,SACA,WACA,SACA,WACA,UACA,QACA,QACA,SACA,UACA,iBACA,QACA,OACA,SACA,UACA,UACA,aACA,WACA,MACA,eAEA,gBACA,SACA,SACA,YACA,WACA,QACA,WACAtH,QAAQ8G,EAAU6B,oBAEb7B,CACV,IAGA,IACIA,GAAyBR,GADNK,GAAY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iBnoD,OAAQ,CAC3B,MAAMmL,EAAOyZ,GAAQujC,GAAkB7lC,GAAO4H,EAAO,GAAG,IAAI5H,SAC5DiD,GAAYlwB,GAAKyb,IAAKzd,GAAM,CAAEswB,KAAMtuB,GAAKsuB,KAAOxY,GACjD,CACH","x_google_ignoreList":[4,5,6,8]} \ No newline at end of file +{"version":3,"file":"respec-aom.js","sources":["../src/core/expose-modules.js","../src/core/l10n.js","../node_modules/idb/build/index.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/utils.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/aom.js","../src/core/location-hash.js","../src/core/defaults.js","../src/aom/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/aom/style.js","../src/core/sections.js","../src/core/data-include.js","../src/core/reindent.js","../src/core/title.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/aom/templates/headers.js","../src/aom/headers.js","../src/aom/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/aom/conformance.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/ui/save-html.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/github.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/dfn-contract.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/no-http-props.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\n// Explicitly default lang and dir on <html> if not set.\n// We assume English and ltr as default for international standards.\nif (!html?.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html?.lang ?? \"en\";\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst transactionDoneMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(this.request);\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nconst advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance'];\nconst methodMap = {};\nconst advanceResults = new WeakMap();\nconst ittrProxiedCursorToOriginalProxy = new WeakMap();\nconst cursorIteratorTraps = {\n get(target, prop) {\n if (!advanceMethodProps.includes(prop))\n return target[prop];\n let cachedFunc = methodMap[prop];\n if (!cachedFunc) {\n cachedFunc = methodMap[prop] = function (...args) {\n advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args));\n };\n }\n return cachedFunc;\n },\n};\nasync function* iterate(...args) {\n // tslint:disable-next-line:no-this-assignment\n let cursor = this;\n if (!(cursor instanceof IDBCursor)) {\n cursor = await cursor.openCursor(...args);\n }\n if (!cursor)\n return;\n cursor = cursor;\n const proxiedCursor = new Proxy(cursor, cursorIteratorTraps);\n ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor);\n // Map this double-proxy back to the original, so other cursor methods work.\n reverseTransformCache.set(proxiedCursor, unwrap(cursor));\n while (cursor) {\n yield proxiedCursor;\n // If one of the advancing methods was not called, call continue().\n cursor = await (advanceResults.get(proxiedCursor) || cursor.continue());\n advanceResults.delete(proxiedCursor);\n }\n}\nfunction isIteratorProp(target, prop) {\n return ((prop === Symbol.asyncIterator &&\n instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) ||\n (prop === 'iterate' && instanceOfAny(target, [IDBIndex, IDBObjectStore])));\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get(target, prop, receiver) {\n if (isIteratorProp(target, prop))\n return iterate;\n return oldTraps.get(target, prop, receiver);\n },\n has(target, prop) {\n return isIteratorProp(target, prop) || oldTraps.has(target, prop);\n },\n}));\n\nexport { deleteDB, openDB, unwrap, wrap };\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (Ćæ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v12.0.2 - a markdown parser\n * Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\n/**\n * Gets the original marked default options.\n */\nfunction _getDefaults() {\n return {\n async: false,\n breaks: false,\n extensions: null,\n gfm: true,\n hooks: null,\n pedantic: false,\n renderer: null,\n silent: false,\n tokenizer: null,\n walkTokens: null\n };\n}\nlet _defaults = _getDefaults();\nfunction changeDefaults(newDefaults) {\n _defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape$1(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n }\n else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n return html;\n}\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon')\n return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\nconst caret = /(^|[^\\[])\\^/g;\nfunction edit(regex, opt) {\n let source = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n let valSource = typeof val === 'string' ? val : val.source;\n valSource = valSource.replace(caret, '$1');\n source = source.replace(name, valSource);\n return obj;\n },\n getRegex: () => {\n return new RegExp(source, opt);\n }\n };\n return obj;\n}\nfunction cleanUrl(href) {\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n }\n catch (e) {\n return null;\n }\n return href;\n}\nconst noopTest = { exec: () => null };\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false;\n let curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\')\n escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n }\n else {\n // add space before unescaped |\n return ' |';\n }\n }), cells = row.split(/ \\|/);\n let i = 0;\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) {\n cells.shift();\n }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) {\n cells.pop();\n }\n if (count) {\n if (cells.length > count) {\n cells.splice(count);\n }\n else {\n while (cells.length < count)\n cells.push('');\n }\n }\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param str\n * @param c\n * @param invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n }\n else if (currChar !== c && invert) {\n suffLen++;\n }\n else {\n break;\n }\n }\n return str.slice(0, l - suffLen);\n}\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n let level = 0;\n for (let i = 0; i < str.length; i++) {\n if (str[i] === '\\\\') {\n i++;\n }\n else if (str[i] === b[0]) {\n level++;\n }\n else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape$1(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape$1(text)\n };\n}\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n if (matchIndentToCode === null) {\n return text;\n }\n const indentToCode = matchIndentToCode[1];\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n const [indentInNode] = matchIndentInNode;\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n return node;\n })\n .join('\\n');\n}\n/**\n * Tokenizer\n */\nclass _Tokenizer {\n options;\n rules; // set by the lexer\n lexer; // set by the lexer\n constructor(options) {\n this.options = options || _defaults;\n }\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, '$1') : cap[2],\n text\n };\n }\n }\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n }\n else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n // precede setext continuation with 4 spaces so it isn't a setext\n let text = cap[0].replace(/\\n {0,3}((?:=+|-+) *)(?=\\n|$)/g, '\\n $1');\n text = rtrim(text.replace(/^ *>[ \\t]?/gm, ''), '\\n');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n let raw = '';\n let itemContents = '';\n let endsWithBlankLine = false;\n // Check if current bullet point can start a new List Item\n while (src) {\n let endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n raw = cap[0];\n src = src.substring(raw.length);\n let line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n let nextLine = src.split('\\n', 1)[0];\n let indent = 0;\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimStart();\n }\n else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n let blankLine = false;\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n // Check if following lines should be included in List Item\n while (src) {\n const rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n }\n else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n itemContents += '\\n' + nextLine;\n }\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n }\n else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n let istask = null;\n let ischecked;\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents,\n tokens: []\n });\n list.raw += raw;\n }\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimEnd();\n (list.items[list.items.length - 1]).text = itemContents.trimEnd();\n list.raw = list.raw.trimEnd();\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (let i = 0; i < list.items.length; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n list.loose = hasMultipleLineBreaks;\n }\n }\n // Set all items to loose if list is loose\n if (list.loose) {\n for (let i = 0; i < list.items.length; i++) {\n list.items[i].loose = true;\n }\n }\n return list;\n }\n }\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n block: true,\n raw: cap[0],\n pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',\n text: cap[0]\n };\n return token;\n }\n }\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline.anyPunctuation, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (!cap) {\n return;\n }\n if (!/[:|]/.test(cap[2])) {\n // delimiter row must have a pipe (|) or colon (:) otherwise it is a setext heading\n return;\n }\n const headers = splitCells(cap[1]);\n const aligns = cap[2].replace(/^\\||\\| *$/g, '').split('|');\n const rows = cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : [];\n const item = {\n type: 'table',\n raw: cap[0],\n header: [],\n align: [],\n rows: []\n };\n if (headers.length !== aligns.length) {\n // header and align columns must be equal, rows can be different.\n return;\n }\n for (const align of aligns) {\n if (/^ *-+: *$/.test(align)) {\n item.align.push('right');\n }\n else if (/^ *:-+: *$/.test(align)) {\n item.align.push('center');\n }\n else if (/^ *:-+ *$/.test(align)) {\n item.align.push('left');\n }\n else {\n item.align.push(null);\n }\n }\n for (const header of headers) {\n item.header.push({\n text: header,\n tokens: this.lexer.inline(header)\n });\n }\n for (const row of rows) {\n item.rows.push(splitCells(row, item.header.length).map(cell => {\n return {\n text: cell,\n tokens: this.lexer.inline(cell)\n };\n }));\n }\n return item;\n }\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape$1(cap[1])\n };\n }\n }\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n }\n else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n }\n else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n return {\n type: 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n block: false,\n text: cap[0]\n };\n }\n }\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n }\n else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n if (link) {\n href = link[1];\n title = link[3];\n }\n }\n else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n }\n else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline.anyPunctuation, '$1') : href,\n title: title ? title.replace(this.rules.inline.anyPunctuation, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n const linkString = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n const link = links[linkString.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrongLDelim.exec(src);\n if (!match)\n return;\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u))\n return;\n const nextChar = match[1] || match[2] || '';\n if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {\n // unicode Regex counts emoji as 1 char; spread into array for proper count (used multiple times below)\n const lLength = [...match[0]].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;\n endReg.lastIndex = 0;\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n if (!rDelim)\n continue; // skip single * in __abc*abc__\n rLength = [...rDelim].length;\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n }\n else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n delimTotal -= rLength;\n if (delimTotal > 0)\n continue; // Haven't found enough closing delimiters\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n // char length can be >1 for unicode characters;\n const lastCharLength = [...match[0]][0].length;\n const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape$1(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n autolink(src) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[1]);\n href = 'mailto:' + text;\n }\n else {\n text = escape$1(cap[1]);\n href = text;\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n url(src) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[0]);\n href = 'mailto:' + text;\n }\n else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? '';\n } while (prevCapZero !== cap[0]);\n text = escape$1(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n }\n else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n inlineText(src) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = cap[0];\n }\n else {\n text = escape$1(cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst newline = /^(?: *(?:\\n|$))+/;\nconst blockCode = /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/;\nconst fences = /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/;\nconst hr = /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/;\nconst heading = /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/;\nconst bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nconst lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\\n(?!\\s*?\\n|bull |blockCode|fences|blockquote|heading|html))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/)\n .replace(/bull/g, bullet) // lists can interrupt\n .replace(/blockCode/g, / {4}/) // indented code blocks can interrupt\n .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt\n .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n .getRegex();\nconst _paragraph = /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/;\nconst blockText = /^[^\\n]+/;\nconst _blockLabel = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nconst def = edit(/^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/)\n .replace('label', _blockLabel)\n .replace('title', /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/)\n .getRegex();\nconst list = edit(/^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/)\n .replace(/bull/g, bullet)\n .getRegex();\nconst _tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title'\n + '|tr|track|ul';\nconst _comment = /<!--(?:-?>|[\\s\\S]*?(?:-->|$))/;\nconst html = edit('^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')', 'i')\n .replace('comment', _comment)\n .replace('tag', _tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst paragraph = edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\nconst blockquote = edit(/^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/)\n .replace('paragraph', paragraph)\n .getRegex();\n/**\n * Normal Block Grammar\n */\nconst blockNormal = {\n blockquote,\n code: blockCode,\n def,\n fences,\n heading,\n hr,\n html,\n lheading,\n list,\n newline,\n paragraph,\n table: noopTest,\n text: blockText\n};\n/**\n * GFM Block Grammar\n */\nconst gfmTable = edit('^ *([^\\\\n ].*)\\\\n' // Header\n + ' {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)') // Cells\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\nconst blockGfm = {\n ...blockNormal,\n table: gfmTable,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('table', gfmTable) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex()\n};\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\nconst blockPedantic = {\n ...blockNormal,\n html: edit('^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', _comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', lheading)\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .replace('|tag', '')\n .getRegex()\n};\n/**\n * Inline-Level Grammar\n */\nconst escape = /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/;\nconst inlineCode = /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/;\nconst br = /^( {2,}|\\\\)\\n(?!\\s*$)/;\nconst inlineText = /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/;\n// list of unicode punctuation marks, plus any missing characters from CommonMark spec\nconst _punctuation = '\\\\p{P}\\\\p{S}';\nconst punctuation = edit(/^((?![*_])[\\spunctuation])/, 'u')\n .replace(/punctuation/g, _punctuation).getRegex();\n// sequences em should skip over [title](link), `code`, <html>\nconst blockSkip = /\\[[^[\\]]*?\\]\\([^\\(\\)]*?\\)|`[^`]*?`|<[^<>]*?>/g;\nconst emStrongLDelim = edit(/^(?:\\*+(?:((?!\\*)[punct])|[^\\s*]))|^_+(?:((?!_)[punct])|([^\\s_]))/, 'u')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst emStrongRDelimAst = edit('^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)' // Skip orphan inside strong\n + '|[^*]+(?=[^*])' // Consume to delim\n + '|(?!\\\\*)[punct](\\\\*+)(?=[\\\\s]|$)' // (1) #*** can only be a Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?!\\\\*)(?=[punct\\\\s]|$)' // (2) a***#, a*** can only be a Right Delimiter\n + '|(?!\\\\*)[punct\\\\s](\\\\*+)(?=[^punct\\\\s])' // (3) #***a, ***a can only be Left Delimiter\n + '|[\\\\s](\\\\*+)(?!\\\\*)(?=[punct])' // (4) ***# can only be Left Delimiter\n + '|(?!\\\\*)[punct](\\\\*+)(?!\\\\*)(?=[punct])' // (5) #***# can be either Left or Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?=[^punct\\\\s])', 'gu') // (6) a***a can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\n// (6) Not allowed for _\nconst emStrongRDelimUnd = edit('^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)' // Skip orphan inside strong\n + '|[^_]+(?=[^_])' // Consume to delim\n + '|(?!_)[punct](_+)(?=[\\\\s]|$)' // (1) #___ can only be a Right Delimiter\n + '|[^punct\\\\s](_+)(?!_)(?=[punct\\\\s]|$)' // (2) a___#, a___ can only be a Right Delimiter\n + '|(?!_)[punct\\\\s](_+)(?=[^punct\\\\s])' // (3) #___a, ___a can only be Left Delimiter\n + '|[\\\\s](_+)(?!_)(?=[punct])' // (4) ___# can only be Left Delimiter\n + '|(?!_)[punct](_+)(?!_)(?=[punct])', 'gu') // (5) #___# can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst anyPunctuation = edit(/\\\\([punct])/, 'gu')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst autolink = edit(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/)\n .replace('scheme', /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/)\n .replace('email', /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/)\n .getRegex();\nconst _inlineComment = edit(_comment).replace('(?:-->|$)', '-->').getRegex();\nconst tag = edit('^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>') // CDATA section\n .replace('comment', _inlineComment)\n .replace('attribute', /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst _inlineLabel = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\nconst link = edit(/^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/)\n .replace('label', _inlineLabel)\n .replace('href', /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/)\n .replace('title', /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/)\n .getRegex();\nconst reflink = edit(/^!?\\[(label)\\]\\[(ref)\\]/)\n .replace('label', _inlineLabel)\n .replace('ref', _blockLabel)\n .getRegex();\nconst nolink = edit(/^!?\\[(ref)\\](?:\\[\\])?/)\n .replace('ref', _blockLabel)\n .getRegex();\nconst reflinkSearch = edit('reflink|nolink(?!\\\\()', 'g')\n .replace('reflink', reflink)\n .replace('nolink', nolink)\n .getRegex();\n/**\n * Normal Inline Grammar\n */\nconst inlineNormal = {\n _backpedal: noopTest, // only used for GFM url\n anyPunctuation,\n autolink,\n blockSkip,\n br,\n code: inlineCode,\n del: noopTest,\n emStrongLDelim,\n emStrongRDelimAst,\n emStrongRDelimUnd,\n escape,\n link,\n nolink,\n punctuation,\n reflink,\n reflinkSearch,\n tag,\n text: inlineText,\n url: noopTest\n};\n/**\n * Pedantic Inline Grammar\n */\nconst inlinePedantic = {\n ...inlineNormal,\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', _inlineLabel)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', _inlineLabel)\n .getRegex()\n};\n/**\n * GFM Inline Grammar\n */\nconst inlineGfm = {\n ...inlineNormal,\n escape: edit(escape).replace('])', '~|])').getRegex(),\n url: edit(/^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/, 'i')\n .replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/)\n .getRegex(),\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n};\n/**\n * GFM + Line Breaks Inline Grammar\n */\nconst inlineBreaks = {\n ...inlineGfm,\n br: edit(br).replace('{2,}', '*').getRegex(),\n text: edit(inlineGfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n/**\n * exports\n */\nconst block = {\n normal: blockNormal,\n gfm: blockGfm,\n pedantic: blockPedantic\n};\nconst inline = {\n normal: inlineNormal,\n gfm: inlineGfm,\n breaks: inlineBreaks,\n pedantic: inlinePedantic\n};\n\n/**\n * Block Lexer\n */\nclass _Lexer {\n tokens;\n options;\n state;\n tokenizer;\n inlineQueue;\n constructor(options) {\n // TokenList cannot be created in one go\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || _defaults;\n this.options.tokenizer = this.options.tokenizer || new _Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n }\n else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n }\n else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new _Lexer(options);\n return lexer.lex(src);\n }\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new _Lexer(options);\n return lexer.inlineTokens(src);\n }\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n this.blockTokens(src, this.tokens);\n for (let i = 0; i < this.inlineQueue.length; i++) {\n const next = this.inlineQueue[i];\n this.inlineTokens(next.src, next.tokens);\n }\n this.inlineQueue = [];\n return this.tokens;\n }\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n }\n else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n let token;\n let lastToken;\n let cutSrc;\n let lastParagraphClipped;\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unnecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n this.state.top = true;\n return tokens;\n }\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n // Mask out escaped characters\n while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);\n }\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // autolink\n if (token = this.tokenizer.autolink(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass _Renderer {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/^\\S*/)?.[0];\n code = code.replace(/\\n$/, '') + '\\n';\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n return '<pre><code class=\"language-'\n + escape$1(lang)\n + '\">'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n html(html, block) {\n return html;\n }\n heading(text, level, raw) {\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n hr() {\n return '<hr>\\n';\n }\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul';\n const startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n listitem(text, task, checked) {\n return `<li>${text}</li>\\n`;\n }\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\">';\n }\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n table(header, body) {\n if (body)\n body = `<tbody>${body}</tbody>`;\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n /**\n * span level renderer\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n em(text) {\n return `<em>${text}</em>`;\n }\n codespan(text) {\n return `<code>${text}</code>`;\n }\n br() {\n return '<br>';\n }\n del(text) {\n return `<del>${text}</del>`;\n }\n link(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n image(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += '>';\n return out;\n }\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass _TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n em(text) {\n return text;\n }\n codespan(text) {\n return text;\n }\n del(text) {\n return text;\n }\n html(text) {\n return text;\n }\n text(text) {\n return text;\n }\n link(href, title, text) {\n return '' + text;\n }\n image(href, title, text) {\n return '' + text;\n }\n br() {\n return '';\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass _Parser {\n options;\n renderer;\n textRenderer;\n constructor(options) {\n this.options = options || _defaults;\n this.options.renderer = this.options.renderer || new _Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new _TextRenderer();\n }\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new _Parser(options);\n return parser.parse(tokens);\n }\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new _Parser(options);\n return parser.parseInline(tokens);\n }\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const genericToken = token;\n const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(genericToken.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n const headingToken = token;\n out += this.renderer.heading(this.parseInline(headingToken.tokens), headingToken.depth, unescape(this.parseInline(headingToken.tokens, this.textRenderer)));\n continue;\n }\n case 'code': {\n const codeToken = token;\n out += this.renderer.code(codeToken.text, codeToken.lang, !!codeToken.escaped);\n continue;\n }\n case 'table': {\n const tableToken = token;\n let header = '';\n // header\n let cell = '';\n for (let j = 0; j < tableToken.header.length; j++) {\n cell += this.renderer.tablecell(this.parseInline(tableToken.header[j].tokens), { header: true, align: tableToken.align[j] });\n }\n header += this.renderer.tablerow(cell);\n let body = '';\n for (let j = 0; j < tableToken.rows.length; j++) {\n const row = tableToken.rows[j];\n cell = '';\n for (let k = 0; k < row.length; k++) {\n cell += this.renderer.tablecell(this.parseInline(row[k].tokens), { header: false, align: tableToken.align[k] });\n }\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n const blockquoteToken = token;\n const body = this.parse(blockquoteToken.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n const listToken = token;\n const ordered = listToken.ordered;\n const start = listToken.start;\n const loose = listToken.loose;\n let body = '';\n for (let j = 0; j < listToken.items.length; j++) {\n const item = listToken.items[j];\n const checked = item.checked;\n const task = item.task;\n let itemBody = '';\n if (item.task) {\n const checkbox = this.renderer.checkbox(!!checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n }\n else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox + ' '\n });\n }\n }\n else {\n itemBody += checkbox + ' ';\n }\n }\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, !!checked);\n }\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n const htmlToken = token;\n out += this.renderer.html(htmlToken.text, htmlToken.block);\n continue;\n }\n case 'paragraph': {\n const paragraphToken = token;\n out += this.renderer.paragraph(this.parseInline(paragraphToken.tokens));\n continue;\n }\n case 'text': {\n let textToken = token;\n let body = textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text;\n while (i + 1 < tokens.length && tokens[i + 1].type === 'text') {\n textToken = tokens[++i];\n body += '\\n' + (textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'escape': {\n const escapeToken = token;\n out += renderer.text(escapeToken.text);\n break;\n }\n case 'html': {\n const tagToken = token;\n out += renderer.html(tagToken.text);\n break;\n }\n case 'link': {\n const linkToken = token;\n out += renderer.link(linkToken.href, linkToken.title, this.parseInline(linkToken.tokens, renderer));\n break;\n }\n case 'image': {\n const imageToken = token;\n out += renderer.image(imageToken.href, imageToken.title, imageToken.text);\n break;\n }\n case 'strong': {\n const strongToken = token;\n out += renderer.strong(this.parseInline(strongToken.tokens, renderer));\n break;\n }\n case 'em': {\n const emToken = token;\n out += renderer.em(this.parseInline(emToken.tokens, renderer));\n break;\n }\n case 'codespan': {\n const codespanToken = token;\n out += renderer.codespan(codespanToken.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n const delToken = token;\n out += renderer.del(this.parseInline(delToken.tokens, renderer));\n break;\n }\n case 'text': {\n const textToken = token;\n out += renderer.text(textToken.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\nclass _Hooks {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess',\n 'processAllTokens'\n ]);\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n /**\n * Process all tokens before walk tokens\n */\n processAllTokens(tokens) {\n return tokens;\n }\n}\n\nclass Marked {\n defaults = _getDefaults();\n options = this.setOptions;\n parse = this.#parseMarkdown(_Lexer.lex, _Parser.parse);\n parseInline = this.#parseMarkdown(_Lexer.lexInline, _Parser.parseInline);\n Parser = _Parser;\n Renderer = _Renderer;\n TextRenderer = _TextRenderer;\n Lexer = _Lexer;\n Tokenizer = _Tokenizer;\n Hooks = _Hooks;\n constructor(...args) {\n this.use(...args);\n }\n /**\n * Run callback for every token\n */\n walkTokens(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(this, token));\n switch (token.type) {\n case 'table': {\n const tableToken = token;\n for (const cell of tableToken.header) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n for (const row of tableToken.rows) {\n for (const cell of row) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n const listToken = token;\n values = values.concat(this.walkTokens(listToken.items, callback));\n break;\n }\n default: {\n const genericToken = token;\n if (this.defaults.extensions?.childTokens?.[genericToken.type]) {\n this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {\n const tokens = genericToken[childTokens].flat(Infinity);\n values = values.concat(this.walkTokens(tokens, callback));\n });\n }\n else if (genericToken.tokens) {\n values = values.concat(this.walkTokens(genericToken.tokens, callback));\n }\n }\n }\n }\n return values;\n }\n use(...args) {\n const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n // set async to true if it was set to true before\n opts.async = this.defaults.async || opts.async || false;\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if ('renderer' in ext) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function (...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n }\n else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if ('tokenizer' in ext) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n const extLevel = extensions[ext.level];\n if (extLevel) {\n extLevel.unshift(ext.tokenizer);\n }\n else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n }\n else {\n extensions.startBlock = [ext.start];\n }\n }\n else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n }\n else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if ('childTokens' in ext && ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = this.defaults.renderer || new _Renderer(this.defaults);\n for (const prop in pack.renderer) {\n if (!(prop in renderer)) {\n throw new Error(`renderer '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const rendererProp = prop;\n const rendererFunc = pack.renderer[rendererProp];\n const prevRenderer = renderer[rendererProp];\n // Replace renderer with func to run extension, but fall back if false\n renderer[rendererProp] = (...args) => {\n let ret = rendererFunc.apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret || '';\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);\n for (const prop in pack.tokenizer) {\n if (!(prop in tokenizer)) {\n throw new Error(`tokenizer '${prop}' does not exist`);\n }\n if (['options', 'rules', 'lexer'].includes(prop)) {\n // ignore options, rules, and lexer properties\n continue;\n }\n const tokenizerProp = prop;\n const tokenizerFunc = pack.tokenizer[tokenizerProp];\n const prevTokenizer = tokenizer[tokenizerProp];\n // Replace tokenizer with func to run extension, but fall back if false\n // @ts-expect-error cannot type tokenizer function dynamically\n tokenizer[tokenizerProp] = (...args) => {\n let ret = tokenizerFunc.apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = this.defaults.hooks || new _Hooks();\n for (const prop in pack.hooks) {\n if (!(prop in hooks)) {\n throw new Error(`hook '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const hooksProp = prop;\n const hooksFunc = pack.hooks[hooksProp];\n const prevHook = hooks[hooksProp];\n if (_Hooks.passThroughHooks.has(prop)) {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (arg) => {\n if (this.defaults.async) {\n return Promise.resolve(hooksFunc.call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n const ret = hooksFunc.call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n }\n else {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (...args) => {\n let ret = hooksFunc.apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = this.defaults.walkTokens;\n const packWalktokens = pack.walkTokens;\n opts.walkTokens = function (token) {\n let values = [];\n values.push(packWalktokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n this.defaults = { ...this.defaults, ...opts };\n });\n return this;\n }\n setOptions(opt) {\n this.defaults = { ...this.defaults, ...opt };\n return this;\n }\n lexer(src, options) {\n return _Lexer.lex(src, options ?? this.defaults);\n }\n parser(tokens, options) {\n return _Parser.parse(tokens, options ?? this.defaults);\n }\n #parseMarkdown(lexer, parser) {\n return (src, options) => {\n const origOpt = { ...options };\n const opt = { ...this.defaults, ...origOpt };\n // Show warning if an extension set async to true but the parse was called with async: false\n if (this.defaults.async === true && origOpt.async === false) {\n if (!opt.silent) {\n console.warn('marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.');\n }\n opt.async = true;\n }\n const throwError = this.#onError(!!opt.silent, !!opt.async);\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens)\n .then(tokens => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n let tokens = lexer(src, opt);\n if (opt.hooks) {\n tokens = opt.hooks.processAllTokens(tokens);\n }\n if (opt.walkTokens) {\n this.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n }\n catch (e) {\n return throwError(e);\n }\n };\n }\n #onError(silent, async) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape$1(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n return msg;\n }\n if (async) {\n return Promise.reject(e);\n }\n throw e;\n };\n }\n}\n\nconst markedInstance = new Marked();\nfunction marked(src, opt) {\n return markedInstance.parse(src, opt);\n}\n/**\n * Sets the default options.\n *\n * @param options Hash of options\n */\nmarked.options =\n marked.setOptions = function (options) {\n markedInstance.setOptions(options);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n };\n/**\n * Gets the original marked default options.\n */\nmarked.getDefaults = _getDefaults;\nmarked.defaults = _defaults;\n/**\n * Use Extension\n */\nmarked.use = function (...args) {\n markedInstance.use(...args);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n};\n/**\n * Run callback for every token\n */\nmarked.walkTokens = function (tokens, callback) {\n return markedInstance.walkTokens(tokens, callback);\n};\n/**\n * Compiles markdown to HTML without enclosing `p` tag.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options\n * @return String of compiled HTML\n */\nmarked.parseInline = markedInstance.parseInline;\n/**\n * Expose\n */\nmarked.Parser = _Parser;\nmarked.parser = _Parser.parse;\nmarked.Renderer = _Renderer;\nmarked.TextRenderer = _TextRenderer;\nmarked.Lexer = _Lexer;\nmarked.lexer = _Lexer.lex;\nmarked.Tokenizer = _Tokenizer;\nmarked.Hooks = _Hooks;\nmarked.parse = marked;\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = _Parser.parse;\nconst lexer = _Lexer.lex;\n\nexport { _Hooks as Hooks, _Lexer as Lexer, Marked, _Parser as Parser, _Renderer as Renderer, _TextRenderer as TextRenderer, _Tokenizer as Tokenizer, _defaults as defaults, _getDefaults as getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n//# sourceMappingURL=marked.esm.js.map\n","function getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralize$2 = {exports: {}};\n\n/* global define */\nvar pluralize$1 = pluralize$2.exports;\n\nvar hasRequiredPluralize;\n\nfunction requirePluralize () {\n\tif (hasRequiredPluralize) return pluralize$2.exports;\n\thasRequiredPluralize = 1;\n\t(function (module, exports) {\n\t\t(function (root, pluralize) {\n\t\t /* istanbul ignore else */\n\t\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t\t // Node.\n\t\t module.exports = pluralize();\n\t\t } else {\n\t\t // Browser global.\n\t\t root.pluralize = pluralize();\n\t\t }\n\t\t})(pluralize$1, function () {\n\t\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t\t // while other rules can be optimized using an object for instant lookups.\n\t\t var pluralRules = [];\n\t\t var singularRules = [];\n\t\t var uncountables = {};\n\t\t var irregularPlurals = {};\n\t\t var irregularSingles = {};\n\n\t\t /**\n\t\t * Sanitize a pluralization rule to a usable regular expression.\n\t\t *\n\t\t * @param {(RegExp|string)} rule\n\t\t * @return {RegExp}\n\t\t */\n\t\t function sanitizeRule (rule) {\n\t\t if (typeof rule === 'string') {\n\t\t return new RegExp('^' + rule + '$', 'i');\n\t\t }\n\n\t\t return rule;\n\t\t }\n\n\t\t /**\n\t\t * Pass in a word token to produce a function that can replicate the case on\n\t\t * another word.\n\t\t *\n\t\t * @param {string} word\n\t\t * @param {string} token\n\t\t * @return {Function}\n\t\t */\n\t\t function restoreCase (word, token) {\n\t\t // Tokens are an exact match.\n\t\t if (word === token) return token;\n\n\t\t // Lower cased words. E.g. \"hello\".\n\t\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t\t // Upper cased words. E.g. \"WHISKY\".\n\t\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t\t // Title cased words. E.g. \"Title\".\n\t\t if (word[0] === word[0].toUpperCase()) {\n\t\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t\t }\n\n\t\t // Lower cased words. E.g. \"test\".\n\t\t return token.toLowerCase();\n\t\t }\n\n\t\t /**\n\t\t * Interpolate a regexp string.\n\t\t *\n\t\t * @param {string} str\n\t\t * @param {Array} args\n\t\t * @return {string}\n\t\t */\n\t\t function interpolate (str, args) {\n\t\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t\t return args[index] || '';\n\t\t });\n\t\t }\n\n\t\t /**\n\t\t * Replace a word using a rule.\n\t\t *\n\t\t * @param {string} word\n\t\t * @param {Array} rule\n\t\t * @return {string}\n\t\t */\n\t\t function replace (word, rule) {\n\t\t return word.replace(rule[0], function (match, index) {\n\t\t var result = interpolate(rule[1], arguments);\n\n\t\t if (match === '') {\n\t\t return restoreCase(word[index - 1], result);\n\t\t }\n\n\t\t return restoreCase(match, result);\n\t\t });\n\t\t }\n\n\t\t /**\n\t\t * Sanitize a word by passing in the word and sanitization rules.\n\t\t *\n\t\t * @param {string} token\n\t\t * @param {string} word\n\t\t * @param {Array} rules\n\t\t * @return {string}\n\t\t */\n\t\t function sanitizeWord (token, word, rules) {\n\t\t // Empty string or doesn't need fixing.\n\t\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t\t return word;\n\t\t }\n\n\t\t var len = rules.length;\n\n\t\t // Iterate over the sanitization rules and use the first one to match.\n\t\t while (len--) {\n\t\t var rule = rules[len];\n\n\t\t if (rule[0].test(word)) return replace(word, rule);\n\t\t }\n\n\t\t return word;\n\t\t }\n\n\t\t /**\n\t\t * Replace a word with the updated word.\n\t\t *\n\t\t * @param {Object} replaceMap\n\t\t * @param {Object} keepMap\n\t\t * @param {Array} rules\n\t\t * @return {Function}\n\t\t */\n\t\t function replaceWord (replaceMap, keepMap, rules) {\n\t\t return function (word) {\n\t\t // Get the correct token and case restoration functions.\n\t\t var token = word.toLowerCase();\n\n\t\t // Check against the keep object map.\n\t\t if (keepMap.hasOwnProperty(token)) {\n\t\t return restoreCase(word, token);\n\t\t }\n\n\t\t // Check against the replacement map for a direct word replacement.\n\t\t if (replaceMap.hasOwnProperty(token)) {\n\t\t return restoreCase(word, replaceMap[token]);\n\t\t }\n\n\t\t // Run all the rules against the word.\n\t\t return sanitizeWord(token, word, rules);\n\t\t };\n\t\t }\n\n\t\t /**\n\t\t * Check if a word is part of the map.\n\t\t */\n\t\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t\t return function (word) {\n\t\t var token = word.toLowerCase();\n\n\t\t if (keepMap.hasOwnProperty(token)) return true;\n\t\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t\t return sanitizeWord(token, token, rules) === token;\n\t\t };\n\t\t }\n\n\t\t /**\n\t\t * Pluralize or singularize a word based on the passed in count.\n\t\t *\n\t\t * @param {string} word The word to pluralize\n\t\t * @param {number} count How many of the word exist\n\t\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t\t * @return {string}\n\t\t */\n\t\t function pluralize (word, count, inclusive) {\n\t\t var pluralized = count === 1\n\t\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t\t return (inclusive ? count + ' ' : '') + pluralized;\n\t\t }\n\n\t\t /**\n\t\t * Pluralize a word.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.plural = replaceWord(\n\t\t irregularSingles, irregularPlurals, pluralRules\n\t\t );\n\n\t\t /**\n\t\t * Check if a word is plural.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.isPlural = checkWord(\n\t\t irregularSingles, irregularPlurals, pluralRules\n\t\t );\n\n\t\t /**\n\t\t * Singularize a word.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.singular = replaceWord(\n\t\t irregularPlurals, irregularSingles, singularRules\n\t\t );\n\n\t\t /**\n\t\t * Check if a word is singular.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.isSingular = checkWord(\n\t\t irregularPlurals, irregularSingles, singularRules\n\t\t );\n\n\t\t /**\n\t\t * Add a pluralization rule to the collection.\n\t\t *\n\t\t * @param {(string|RegExp)} rule\n\t\t * @param {string} replacement\n\t\t */\n\t\t pluralize.addPluralRule = function (rule, replacement) {\n\t\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t\t };\n\n\t\t /**\n\t\t * Add a singularization rule to the collection.\n\t\t *\n\t\t * @param {(string|RegExp)} rule\n\t\t * @param {string} replacement\n\t\t */\n\t\t pluralize.addSingularRule = function (rule, replacement) {\n\t\t singularRules.push([sanitizeRule(rule), replacement]);\n\t\t };\n\n\t\t /**\n\t\t * Add an uncountable word rule.\n\t\t *\n\t\t * @param {(string|RegExp)} word\n\t\t */\n\t\t pluralize.addUncountableRule = function (word) {\n\t\t if (typeof word === 'string') {\n\t\t uncountables[word.toLowerCase()] = true;\n\t\t return;\n\t\t }\n\n\t\t // Set singular and plural references for the word.\n\t\t pluralize.addPluralRule(word, '$0');\n\t\t pluralize.addSingularRule(word, '$0');\n\t\t };\n\n\t\t /**\n\t\t * Add an irregular word definition.\n\t\t *\n\t\t * @param {string} single\n\t\t * @param {string} plural\n\t\t */\n\t\t pluralize.addIrregularRule = function (single, plural) {\n\t\t plural = plural.toLowerCase();\n\t\t single = single.toLowerCase();\n\n\t\t irregularSingles[single] = plural;\n\t\t irregularPlurals[plural] = single;\n\t\t };\n\n\t\t /**\n\t\t * Irregular rules.\n\t\t */\n\t\t [\n\t\t // Pronouns.\n\t\t ['I', 'we'],\n\t\t ['me', 'us'],\n\t\t ['he', 'they'],\n\t\t ['she', 'they'],\n\t\t ['them', 'them'],\n\t\t ['myself', 'ourselves'],\n\t\t ['yourself', 'yourselves'],\n\t\t ['itself', 'themselves'],\n\t\t ['herself', 'themselves'],\n\t\t ['himself', 'themselves'],\n\t\t ['themself', 'themselves'],\n\t\t ['is', 'are'],\n\t\t ['was', 'were'],\n\t\t ['has', 'have'],\n\t\t ['this', 'these'],\n\t\t ['that', 'those'],\n\t\t // Words ending in with a consonant and `o`.\n\t\t ['echo', 'echoes'],\n\t\t ['dingo', 'dingoes'],\n\t\t ['volcano', 'volcanoes'],\n\t\t ['tornado', 'tornadoes'],\n\t\t ['torpedo', 'torpedoes'],\n\t\t // Ends with `us`.\n\t\t ['genus', 'genera'],\n\t\t ['viscus', 'viscera'],\n\t\t // Ends with `ma`.\n\t\t ['stigma', 'stigmata'],\n\t\t ['stoma', 'stomata'],\n\t\t ['dogma', 'dogmata'],\n\t\t ['lemma', 'lemmata'],\n\t\t ['schema', 'schemata'],\n\t\t ['anathema', 'anathemata'],\n\t\t // Other irregular rules.\n\t\t ['ox', 'oxen'],\n\t\t ['axe', 'axes'],\n\t\t ['die', 'dice'],\n\t\t ['yes', 'yeses'],\n\t\t ['foot', 'feet'],\n\t\t ['eave', 'eaves'],\n\t\t ['goose', 'geese'],\n\t\t ['tooth', 'teeth'],\n\t\t ['quiz', 'quizzes'],\n\t\t ['human', 'humans'],\n\t\t ['proof', 'proofs'],\n\t\t ['carve', 'carves'],\n\t\t ['valve', 'valves'],\n\t\t ['looey', 'looies'],\n\t\t ['thief', 'thieves'],\n\t\t ['groove', 'grooves'],\n\t\t ['pickaxe', 'pickaxes'],\n\t\t ['passerby', 'passersby']\n\t\t ].forEach(function (rule) {\n\t\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t\t });\n\n\t\t /**\n\t\t * Pluralization rules.\n\t\t */\n\t\t [\n\t\t [/s?$/i, 's'],\n\t\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t\t [/([^aeiou]ese)$/i, '$1'],\n\t\t [/(ax|test)is$/i, '$1es'],\n\t\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t\t [/(e[mn]u)s?$/i, '$1s'],\n\t\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t\t [/(her|at|gr)o$/i, '$1oes'],\n\t\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t\t [/sis$/i, 'ses'],\n\t\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t\t [/(child)(?:ren)?$/i, '$1ren'],\n\t\t [/eaux$/i, '$0'],\n\t\t [/m[ae]n$/i, 'men'],\n\t\t ['thou', 'you']\n\t\t ].forEach(function (rule) {\n\t\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t\t });\n\n\t\t /**\n\t\t * Singularization rules.\n\t\t */\n\t\t [\n\t\t [/s$/i, ''],\n\t\t [/(ss)$/i, '$1'],\n\t\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t\t [/ies$/i, 'y'],\n\t\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t\t [/(seraph|cherub)im$/i, '$1'],\n\t\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t\t [/(test)(?:is|es)$/i, '$1is'],\n\t\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t\t [/(matr|append)ices$/i, '$1ix'],\n\t\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t\t [/(child)ren$/i, '$1'],\n\t\t [/(eau)x?$/i, '$1'],\n\t\t [/men$/i, 'man']\n\t\t ].forEach(function (rule) {\n\t\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t\t });\n\n\t\t /**\n\t\t * Uncountable rules.\n\t\t */\n\t\t [\n\t\t // Singular words with no plurals.\n\t\t 'adulthood',\n\t\t 'advice',\n\t\t 'agenda',\n\t\t 'aid',\n\t\t 'aircraft',\n\t\t 'alcohol',\n\t\t 'ammo',\n\t\t 'analytics',\n\t\t 'anime',\n\t\t 'athletics',\n\t\t 'audio',\n\t\t 'bison',\n\t\t 'blood',\n\t\t 'bream',\n\t\t 'buffalo',\n\t\t 'butter',\n\t\t 'carp',\n\t\t 'cash',\n\t\t 'chassis',\n\t\t 'chess',\n\t\t 'clothing',\n\t\t 'cod',\n\t\t 'commerce',\n\t\t 'cooperation',\n\t\t 'corps',\n\t\t 'debris',\n\t\t 'diabetes',\n\t\t 'digestion',\n\t\t 'elk',\n\t\t 'energy',\n\t\t 'equipment',\n\t\t 'excretion',\n\t\t 'expertise',\n\t\t 'firmware',\n\t\t 'flounder',\n\t\t 'fun',\n\t\t 'gallows',\n\t\t 'garbage',\n\t\t 'graffiti',\n\t\t 'hardware',\n\t\t 'headquarters',\n\t\t 'health',\n\t\t 'herpes',\n\t\t 'highjinks',\n\t\t 'homework',\n\t\t 'housework',\n\t\t 'information',\n\t\t 'jeans',\n\t\t 'justice',\n\t\t 'kudos',\n\t\t 'labour',\n\t\t 'literature',\n\t\t 'machinery',\n\t\t 'mackerel',\n\t\t 'mail',\n\t\t 'media',\n\t\t 'mews',\n\t\t 'moose',\n\t\t 'music',\n\t\t 'mud',\n\t\t 'manga',\n\t\t 'news',\n\t\t 'only',\n\t\t 'personnel',\n\t\t 'pike',\n\t\t 'plankton',\n\t\t 'pliers',\n\t\t 'police',\n\t\t 'pollution',\n\t\t 'premises',\n\t\t 'rain',\n\t\t 'research',\n\t\t 'rice',\n\t\t 'salmon',\n\t\t 'scissors',\n\t\t 'series',\n\t\t 'sewage',\n\t\t 'shambles',\n\t\t 'shrimp',\n\t\t 'software',\n\t\t 'species',\n\t\t 'staff',\n\t\t 'swine',\n\t\t 'tennis',\n\t\t 'traffic',\n\t\t 'transportation',\n\t\t 'trout',\n\t\t 'tuna',\n\t\t 'wealth',\n\t\t 'welfare',\n\t\t 'whiting',\n\t\t 'wildebeest',\n\t\t 'wildlife',\n\t\t 'you',\n\t\t /pok[eĆ©]mon$/i,\n\t\t // Regexes.\n\t\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t\t /deer$/i, // \"deer\", \"reindeer\"\n\t\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t\t /measles$/i,\n\t\t /o[iu]s$/i, // \"carnivorous\"\n\t\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t\t /sheep$/i\n\t\t ].forEach(pluralize.addUncountableRule);\n\n\t\t return pluralize;\n\t\t}); \n\t} (pluralize$2));\n\treturn pluralize$2.exports;\n}\n\nvar pluralizeExports = requirePluralize();\nvar pluralize = /*@__PURE__*/getDefaultExportFromCjs(pluralizeExports);\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"šŸ‘»\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint, cause: e });\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up šŸ˜–\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message, { ...(options.cause && { cause: options.cause }) });\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return {\n message,\n name,\n plugin,\n hint,\n elements,\n title,\n details,\n stack,\n ...(this.cause instanceof Error && {\n cause: {\n name: this.cause.name,\n message: this.cause.message,\n stack: this.cause.stack,\n },\n }),\n };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n * @param {Error} [options.cause] The error that caused this one.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n * @param {Error} [options.cause] The error that caused this one.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Creates showError, showWarning utilities for use in custom pre-process and\n * post-process plugins.\n * @param {string} pluginName\n */\nexport function makePluginUtils(pluginName) {\n /** @typedef {Parameters<typeof showError>[2]} Options */\n return {\n /** @type {(message: string, options?: Options) => void} */\n showError: (msg, options) => showError(msg, pluginName, options),\n /** @type {(message: string, options?: Options) => void} */\n showWarning: (msg, options) => showWarning(msg, pluginName, options),\n };\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n\n/**\n * Takes a text string, trims it, splits it into lines,\n * finds the common indentation level, and then de-indents every line\n * by that common indentation level.\n *\n * @param {string} text - The text to be re-indented.\n * @returns {string} The re-indented text.\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\nimport { showError } from \"./utils.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n /** @param {CustomEvent} ev */\n const listener = async ev => {\n try {\n await cb(ev.detail);\n } catch (error) {\n const msg = `Error in handler for topic \"${topic}\": ${error.message}`;\n showError(msg, `sub:${topic}`, { cause: error });\n }\n };\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint, cause: err });\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint, cause: err });\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n background: var(--bg, #fff);\n color: rgb(120, 120, 120);\n color: var(--tocnav-normal-text, rgb(120, 120, 120));\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n box-shadow: 1px 1px 8px 0 var(--tocsidebar-shadow, rgba(100, 100, 100, 0.5));\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: var(--bg, #fff);\n color: var(--text, black);\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: var(--def-text, white);\n background: var(--def-bg, rgb(42, 90, 168));\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: var(--def-text, white);\n background: var(--defrow-border, rgb(42, 90, 168));\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: var(--tocnav-active-bg, #193766);\n color: var(--tocnav-active-text, black);\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"āš ļø\";\n}\n\n.respec-error-list > li::before {\n content: \"šŸ’„\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: var(--bg, #fff);\n color: var(--text, black);\n border: 5px solid #666;\n border-color: var(--tocsidebar-shadow, #666);\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n left: 0 !important;\n text-align: center;\n background: var(--tocsidebar-shadow, #ddd);\n color: var(--text, black);\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: var(--bg, white);\n color: var(--text, black);\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: var(--tocnav-hover-bg, #eee);\n color: var(--tocnav-hover-text, black);\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/markedjs/marked\n *\n */\n\nimport { getElementIndentation, reindent } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\n\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\n\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super\n .code(code, language, isEscaped)\n .replace(`class=\"language-`, `class=\"`);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw);\n }\n}\n\n/** @type {import('marked').MarkedOptions} */\nconst config = {\n gfm: true,\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport { reindent, xmlEscape } from \"./utils.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n āŒ\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}ā€¦\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${xmlEscape(err.message)}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/aom/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/aom/style.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/title.js\"),\n import(\"../src/aom/headers.js\"),\n import(\"../src/aom/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/aom/conformance.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n import(\"../src/core/dfn-contract.js\"),\n /* Linter must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/core/linter-rules/privsec-section.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// As ReSpec injects a bunch of stuff async, the scroll position is not always\n// at the right place when we are done processing. The purpose of this module\n// is to reset window's location hash, which will cause the browser to scroll\n// the window to the correct point in the document when processing is done.\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!window.location.hash) {\n return;\n }\n\n // We have to use .then() here because otherwise we would get stuck\n // awaiting this plugin to finish.\n document.respec.ready.then(() => {\n const hash = decodeURIComponent(window.location.hash).slice(1);\n\n let newHash = hash;\n /** @type {HTMLElement|null} */\n const element = document.getElementById(newHash);\n\n // Check if hash contains any non-word character.\n const isLegacyFrag = /\\W/.test(newHash);\n\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/speced/respec/issues/1353\n if (!element && isLegacyFrag) {\n const id = newHash\n // Replace all non-word characters with a dash.\n .replace(/[\\W]+/gim, \"-\")\n // Remove any leading dashes.\n .replace(/^-+/, \"\")\n // Remove any trailing dashes.\n .replace(/-+$/, \"\");\n\n /** @type {HTMLElement|null} */\n const updatedElement = document.getElementById(id);\n if (updatedElement) {\n newHash = id;\n }\n }\n window.location.hash = `#${newHash}`;\n });\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for AOM specs\n */\nexport const name = \"aom/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst licenses = new Map([\n [\n \"aom\",\n {\n name: \"Alliance for Open Media License\",\n short: \"AOM\",\n url: \"http://aomedia.org/license/\",\n },\n ],\n]);\n\nconst aomDefaults = {\n // treat document as \"Common Markdown\" (with a little bit of HTML).\n // choice between Markdown and HTML depends on the complexity of the spec\n // example of Markdown spec: https://github.com/WICG/netinfo/blob/gh-pages/index.html\n // Helpful guide: https://respec.org/docs/#markdown\n format: \"markdown\",\n logos: [\n {\n src: \"https://aomedia.org/assets/images/aomedia-icon-only.png\",\n alt: \"AOM\",\n id: \"AOM\",\n height: 170,\n width: 170,\n url: \"https://aomedia.org/\",\n },\n ],\n license: \"aom\",\n};\n\nfunction computeProps(conf) {\n return {\n licenseInfo: licenses.get(conf.license),\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...aomDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...aomDefaults,\n ...conf,\n lint,\n });\n\n // computed properties\n Object.assign(conf, computeProps(conf));\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOF --- */\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"Ā§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// The purpose of this module is to insert the default ReSpec CSS into the document.\n// If you don't want to use the default ReSpec CSS, set the `noReSpecCSS` configuration\n// option to `true`. If you want to use your own styles, create a ReSpec profile that\n// includes your own styles and sets the `noReSpecCSS` configuration option to `true`.\n\n/**\n * Module Name.\n * @type {string}\n */\nexport const name = \"core/style\";\n\nimport css from \"../styles/respec.css.js\";\n\n// Opportunistically inserts the style to reduce some FOUC.\n/** @type {HTMLStyleElement} */\nconst styleElement = insertStyle();\n\n/**\n * Inserts the ReSpec CSS as a `style` element into the document's `head`.\n * @return {HTMLStyleElement} The `style` element that was inserted.\n */\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\n/**\n * Removes the ReSpec CSS if the `noReSpecCSS` configuration option is `true`.\n * @param {Conf} conf The document configuration object.\n */\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n// Module aom/style\n// Inserts a link to the appropriate style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport {\n createResourceHint,\n linkCSS,\n showWarning,\n toKeyValuePairs,\n} from \"../core/utils.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"aom/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n script.src = `https://www.w3.org/scripts/TR/${version}/fixup.js`;\n doc.body.appendChild(script);\n}\n\n/**\n * Make a best effort to attach meta viewport at the top of the head.\n * Other plugins might subsequently push it down, but at least we start\n * at the right place. When ReSpec exports the HTML, it again moves the\n * meta viewport to the top of the head - so to make sure it's the first\n * thing the browser sees. See js/ui/save-html.js.\n */\nfunction createMetaViewport() {\n const meta = document.createElement(\"meta\");\n meta.name = \"viewport\";\n const contentProps = {\n width: \"device-width\",\n \"initial-scale\": \"1\",\n \"shrink-to-fit\": \"no\",\n };\n meta.content = toKeyValuePairs(contentProps).replace(/\"/g, \"\");\n return meta;\n}\n\nfunction createBaseStyle() {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = \"https://www.w3.org/StyleSheets/TR/2016/base.css\";\n link.classList.add(\"removeOnSave\");\n return link;\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C styles and scripts.\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2016/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: \"https://www.w3.org/StyleSheets/TR/2016/base.css\",\n as: \"style\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// Opportunistically apply base style\nelements.appendChild(createBaseStyle());\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(createMetaViewport());\n}\n\ndocument.head.prepend(elements);\n\nfunction styleMover(linkURL) {\n return exportDoc => {\n const w3cStyle = exportDoc.querySelector(`head link[href=\"${linkURL}\"]`);\n exportDoc.querySelector(\"head\").append(w3cStyle);\n };\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"`respecConfig.specStatus` missing. Defaulting to 'base'.\";\n conf.specStatus = \"base\";\n showWarning(msg, name);\n }\n\n let styleFile = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"PD\":\n styleFile = \"W3C-UD\";\n break;\n default:\n styleFile = \"base.css\";\n break;\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://www.w3.org/StyleSheets/TR/2016/${styleFile}`;\n linkCSS(document, finalStyleURL);\n // Make sure the W3C stylesheet is the last stylesheet, as required by W3C Pub Rules.\n const moveStyle = styleMover(finalStyleURL);\n sub(\"beforesave\", moveStyle);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n showError(msg, name, { elements: [el], cause: err });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","// @ts-check\n/**\n * @module core/reindent\n *\n * Normalizes indents across the pre elements in the document,\n * so that indentation inside <pre> won't affect the rendered result.\n */\nimport { reindent } from \"./utils.js\";\nexport const name = \"core/reindent\";\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","/**\n * This module handles the creation of the h1#title of a spec and\n * makes sure the <title> always matches the h1.\n *\n * If no h1#title is included, then the <title> becomes the h1#title.\n *\n * When a h1#title is included, it always takes precedence over the\n * <title> of a spec. An error will be displayed in case of\n * any mismatch.\n *\n */\n\nimport { getIntlData, norm, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/title\";\n\nconst localizationStrings = {\n en: {\n default_title: \"No Title\",\n },\n de: {\n default_title: \"Kein Titel\",\n },\n zh: {\n default_title: \"ę— ę ‡é¢˜\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {HTMLElement} */\n const h1Elem =\n document.querySelector(\"h1#title\") || html`<h1 id=\"title\"></h1>`;\n\n // check existing element is ok to use\n if (h1Elem.isConnected && h1Elem.textContent.trim() === \"\") {\n const msg =\n \"The document is missing a title, so using a default title. \" +\n \"To fix this, please give your document a `<title>`. \" +\n \"If you need special markup in the document's title, \" +\n 'please use a `<h1 id=\"title\">`.';\n const title = \"Document is missing a title\";\n showError(msg, name, { title, elements: [h1Elem] });\n }\n\n // Decorate the spec title\n if (!h1Elem.id) h1Elem.id = \"title\";\n h1Elem.classList.add(\"title\");\n\n setDocumentTitle(conf, h1Elem);\n\n // This will get relocated by a template later.\n document.body.prepend(h1Elem);\n}\n\nfunction setDocumentTitle(conf, h1Elem) {\n // If the h1 is newly created, it won't be connected. In this case\n // we use the <title> or a localized fallback.\n if (!h1Elem.isConnected) {\n h1Elem.textContent = document.title || `${l10n.default_title}`;\n }\n // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.textContent);\n\n if (conf.isPreview && conf.prNumber) {\n const prUrl = conf.prUrl || `${conf.github.repoURL}pull/${conf.prNumber}`;\n const { childNodes } = html`\n Preview of PR <a href=\"${prUrl}\">#${conf.prNumber}</a>:\n `;\n h1Elem.prepend(...childNodes);\n documentTitle = `Preview of PR #${conf.prNumber}: ${documentTitle}`;\n }\n\n document.title = documentTitle;\n\n // conf.title is deperecated - we are keeping this here just to\n // retain backwards compat as we think the ePub generator\n // relies on it.\n conf.title = documentTitle;\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"core/templates/show-link\";\n\n/**\n * @param {object} link\n * @param {string} link.key\n * @param {string} [link.class]\n * @param {LinkData[]} [link.data]\n */\nexport default function showLink(link) {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n showWarning(msg, name);\n console.warn(msg, link);\n return;\n }\n return html`\n <dt class=\"${link.class ? link.class : null}\">${link.key}</dt>\n ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n `;\n}\n\n/**\n * @typedef {object} LinkData\n * @property {string} [LinkData.class]\n * @property {string} [LinkData.href]\n * @property {string} [LinkData.value]\n * @param {LinkData} data\n */\nfunction showLinkData(data) {\n return html`<dd class=\"${data.class ? data.class : null}\">\n ${data.href\n ? html`<a href=\"${data.href}\">${data.value || data.href}</a>`\n : data.value}\n </dd>`;\n}\n","// @ts-check\nimport { docLink, showError } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst name = \"core/templates/show-logo\";\n\n/**\n * Logo mapper. Takes a logo structure and converts it to HTML.\n *\n * @param {object} logo\n * @param {string} logo.src\n * @param {string} logo.url\n * @param {string} logo.alt\n * @param {string} [logo.id]\n * @param {number} [logo.width]\n * @param {number} [logo.height]\n * @param {number} index\n */\nexport default function showLogo(logo, index) {\n /** @type {HTMLAnchorElement} */\n const a = html`<a href=\"${logo.url || null}\" class=\"logo\"\n ><img\n alt=\"${logo.alt || null}\"\n crossorigin\n height=\"${logo.height || null}\"\n id=\"${logo.id || null}\"\n src=\"${logo.src || null}\"\n width=\"${logo.width || null}\"\n />\n </a>`;\n if (!logo.alt) {\n const src = logo.src ? `, with \\`src\\` ${logo.src}, ` : \"\";\n const msg = `Logo at index ${index}${src} is missing required \"\\`alt\\`\" property.`;\n const hint = docLink`Add the missing \"\\`alt\\`\" property describing the logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n if (!logo.src) {\n const msg = `Logo at index ${index} is missing \"\\`src\\`\" property.`;\n const hint = docLink`The \\`src\\` property is required on every logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n return a;\n}\n","// @ts-check\n\nconst name = \"core/templates/show-people\";\n\nimport {\n W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n until(date) {\n return html` Until ${date} `;\n },\n },\n es: {\n until(date) {\n return html` Hasta ${date} `;\n },\n },\n ko: {\n until(date) {\n return html` ${date} ģ“ģ „ `;\n },\n },\n ja: {\n until(date) {\n return html` ${date} 仄前 `;\n },\n },\n de: {\n until(date) {\n return html` bis ${date} `;\n },\n },\n zh: {\n until(date) {\n return html` ē›“到 ${date} `;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst orcidIcon = () =>\n html`<svg\n width=\"16\"\n height=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n >\n <style>\n .st1 {\n fill: #fff;\n }\n </style>\n <path\n d=\"M256 128c0 70.7-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0s128 57.3 128 128z\"\n fill=\"#a6ce39\"\n />\n <path\n class=\"st1\"\n d=\"M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z\"\n />\n </svg>`;\n\n/**\n * @param {Conf} conf\n * @param {\"editors\" | \"authors\" | \"formerEditors\"} propName - the name of the property of the people to render.\n */\nexport default function showPeople(conf, propName) {\n const people = conf[propName];\n if (!Array.isArray(people) || !people.length) return; // nothing to show...\n\n const validatePerson = personValidator(propName);\n return people.filter(validatePerson).map(personToHTML);\n}\n\n/**\n * @param {Person} person\n */\nfunction personToHTML(person) {\n // The following are treated as opt-in HTML by hyperHTML\n // we need to deprecate this!\n const personName = [person.name];\n const company = [person.company];\n const editorId = person.w3cid || null;\n const contents = [];\n if (person.mailto) {\n person.url = `mailto:${person.mailto}`;\n }\n if (person.url) {\n const url = new URL(person.url, document.location.href);\n const classList =\n url.protocol === \"mailto:\"\n ? \"ed_mailto u-email email p-name\"\n : \"u-url url p-name fn\";\n contents.push(\n html`<a class=\"${classList}\" href=\"${person.url}\">${personName}</a>`\n );\n } else {\n contents.push(html`<span class=\"p-name fn\">${personName}</span>`);\n }\n if (person.orcid) {\n contents.push(\n html`<a class=\"p-name orcid\" href=\"${person.orcid}\">${orcidIcon()}</a>`\n );\n }\n if (person.company) {\n const hCard = \"p-org org h-org\";\n const companyElem = person.companyURL\n ? html`<a class=\"${hCard}\" href=\"${person.companyURL}\">${company}</a>`\n : html`<span class=\"${hCard}\">${company}</span>`;\n contents.push(html` (${companyElem})`);\n }\n if (person.note) {\n contents.push(document.createTextNode(` (${person.note})`));\n }\n if (person.extras) {\n contents.push(...person.extras.map(extra => html`, ${renderExtra(extra)}`));\n }\n const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(retiredDate))}</time\n >`;\n contents.push(html` - ${l10n.until(time)} `);\n }\n const dd = html`<dd\n class=\"editor p-author h-card vcard\"\n data-editor-id=\"${editorId}\"\n >\n ${contents}\n </dd>`;\n return dd;\n}\n\nfunction renderExtra(extra) {\n const classVal = extra.class || null;\n const { name, href } = extra;\n return href\n ? html`<a href=\"${href}\" class=\"${classVal}\">${name}</a>`\n : html`<span class=\"${classVal}\">${name}</span>`;\n}\n\n/**\n *\n * @param {string} prop\n */\nfunction personValidator(prop) {\n /**\n * @param {Person} person\n * @param {Number} index\n */\n return function validatePerson(person, index) {\n const docsUrl = \"https://respec.org/docs/\";\n const seePersonHint = `See [person](${docsUrl}#person) configuration for available options.`;\n const preamble =\n `Error processing the [person object](${docsUrl}#person) ` +\n `at index ${index} of the \"[\\`${prop}\\`](${docsUrl}#${prop})\" configuration option.`;\n\n if (!person.name) {\n const msg = `${preamble} Missing required property \\`\"name\"\\`.`;\n showError(msg, name, { hint: seePersonHint });\n return false;\n }\n\n if (person.orcid) {\n const { orcid } = person;\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n\n if (orcidUrl.origin !== \"https://orcid.org\") {\n const msg = `${preamble} ORCID \"${person.orcid}\" at index ${index} is invalid.`;\n const hint = `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`;\n showError(msg, name, { hint });\n return false;\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n const msg = `${preamble} ORCID \"${orcidId}\" has wrong format.`;\n const hint = `ORCIDs have the format \"1234-1234-1234-1234.\"`;\n showError(msg, name, { hint });\n return false;\n }\n\n if (!checkOrcidChecksum(orcid)) {\n const msg = `${preamble} ORCID \"${orcid}\" failed checksum check.`;\n const hint = \"Please check that the ORCID is valid.\";\n showError(msg, name, { hint });\n return false;\n }\n\n // canonical form\n person.orcid = orcidUrl.href;\n }\n\n if (person.retiredDate && !isValidConfDate(person.retiredDate)) {\n const msg = `${preamble} The property \"\\`retiredDate\\`\" is not a valid date.`;\n showError(msg, name, {\n hint: `The expected format is YYYY-MM-DD. ${seePersonHint}`,\n });\n return false;\n }\n\n if (\n person.hasOwnProperty(\"extras\") &&\n !validateExtras(person.extras, seePersonHint, preamble)\n ) {\n return false;\n }\n\n if (person.url && person.mailto) {\n const msg = `${preamble} Has both \"url\" and \"mailto\" property.`;\n showWarning(msg, name, {\n hint: `Please choose either \"url\" or \"mailto\" (\"url\" is preferred). ${seePersonHint}`,\n });\n }\n\n if (person.companyURL && !person.company) {\n const msg = `${preamble} Has a \"\\`companyURL\\`\" property but no \"\\`company\\`\" property.`;\n showWarning(msg, name, {\n hint: `Please add a \"\\`company\\`\" property. ${seePersonHint}.`,\n });\n }\n return true;\n };\n}\n\n/**\n *\n * @param {PersonExtras[]} extras\n * @param {string} hint\n * @param {string} preamble\n */\nfunction validateExtras(extras, hint, preamble) {\n if (!Array.isArray(extras)) {\n showError(\n `${preamble}. A person's \"extras\" member must be an array.`,\n name,\n { hint }\n );\n return false;\n }\n return extras.every((extra, index) => {\n switch (true) {\n case typeof extra !== \"object\":\n showError(\n `${preamble}. Member \"extra\" at index ${index} is not an object.`,\n name,\n {\n hint,\n }\n );\n return false;\n case !extra.hasOwnProperty(\"name\"):\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} is missing required \"name\" member.`,\n name,\n { hint }\n );\n return false;\n case typeof extra.name === \"string\" && extra.name.trim() === \"\":\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} \"name\" can't be empty.`,\n name,\n { hint }\n );\n return false;\n }\n return true;\n });\n}\n\n/**\n * @param {string} orcid\n * @returns {boolean}\n */\nfunction checkOrcidChecksum(orcid) {\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcid[orcid.length - 1];\n const remainder = orcid\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n return lastDigit === lastDigitShould;\n}\n","// @ts-check\nimport { getIntlData } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nconst localizationStrings = {\n en: {\n author: \"Author:\",\n authors: \"Authors:\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest approved version:\",\n this_version: \"This version:\",\n issue_tracker: \"Issue Tracker:\",\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nfunction getSpecSubTitleElem(conf) {\n let specSubTitleElem = document.querySelector(\"h2#subtitle\");\n\n if (specSubTitleElem && specSubTitleElem.parentElement) {\n specSubTitleElem.remove();\n conf.subtitle = specSubTitleElem.textContent.trim();\n } else if (conf.subtitle) {\n specSubTitleElem = document.createElement(\"h2\");\n specSubTitleElem.textContent = conf.subtitle;\n specSubTitleElem.id = \"subtitle\";\n }\n if (specSubTitleElem) {\n specSubTitleElem.classList.add(\"subtitle\");\n }\n return specSubTitleElem;\n}\n\nexport default conf => {\n return html`<div class=\"head\">\n ${conf.specStatus !== \"PD\" ? conf.logos.map(showLogo) : \"\"}\n ${document.querySelector(\"h1#title\")} ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.textStatus} -\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\n <dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\">${conf.thisVersion}</a>\n </dd>\n <dt>${l10n.issue_tracker}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.issueTracker}\">${conf.issueTracker}</a>\n </dd>\n <dt>${conf.multipleEditors ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>${conf.multipleAuthors ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${renderCopyright(conf)}\n <hr />\n </div>`;\n};\n\nfunction renderCopyright(conf) {\n // If there is already a copyright, let's relocate it.\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n return existingCopyright;\n }\n return html`<p class=\"copyright\">\n Copyright ${conf.publishYear},\n <a href=\"https://www.w3.org/\"\n ><abbr title=\"The Alliance for Open Media\">AOM</abbr></a\n ><br />\n Licensing information is available at http://aomedia.org/license/<br />\n The MATERIALS ARE PROVIDED ā€œAS IS.ā€ The Alliance for Open Media, its\n members,and its contributors expressly disclaim any warranties (express,\n implied, or otherwise), including implied warranties of merchantability,\n non-infringement, fitness for a particular purpose, or title, related to the\n materials. The entire risk as to implementing or otherwise using the\n materials is assumed by the implementer and user. IN NO EVENT WILL THE\n ALLIANCE FOR OPEN MEDIA, ITS MEMBERS, OR CONTRIBUTORS BE LIABLE TO ANY OTHER\n PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL, INCIDENTAL, OR\n CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF ACTION OF ANY KIND\n WITH RESPECT TO THIS DELIVERABLE OR ITS GOVERNING AGREEMENT, WHETHER BASED\n ON BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND\n WHETHER OR NOT THE OTHER MEMBER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n DAMAGE.\n </p>`;\n}\n","// @ts-check\n// Module aom/headers\n// Generate the headers material based on the provided configuration.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n// - editors: an array of people editing the document (at least one is required). People\n// are defined using:\n// - name: the person's name (required)\n// - url: URI for the person's home page\n// - company: the person's company\n// - companyURL: the URI for the person's company\n// - mailto: the person's email\n// - note: a note on the person (e.g. former editor)\n// - authors: an array of people who are contributing authors of the document.\n// - formerEditors: an array of people that had earlier edited the document but no longer edit.\n// - subtitle: a subtitle for the specification\n// - publishDate: the date to use for the publication, default to document.lastModified, and\n// failing that to now. The format is YYYY-MM-DD or a Date object.\n// - alternateFormats: a list of alternate formats for the document, each of which being\n// defined by:\n// - uri: the URI to the alternate\n// - label: a label for the alternate\n// - lang: optional language\n// - type: optional MIME type\n// - logos: a list of logos to use instead of the W3C logo, each of which being defined by:\n// - src: the URI to the logo (target of <img src=>)\n// - alt: alternate text for the image (<img alt=>), defaults to \"Logo\" or \"Logo 1\", \"Logo 2\", ...\n// if src is not specified, this is the text of the \"logo\"\n// - height: optional height of the logo (<img height=>)\n// - width: optional width of the logo (<img width=>)\n// - url: the URI to the organization represented by the logo (target of <a href=>)\n// - id: optional id for the logo, permits custom CSS (wraps logo in <span id=>)\n// - each logo element must specify either src or alt\n// - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc).\n// Example of usage: [{key: \"foo\", href:\"https://b\"}, {key: \"bar\", href:\"https://\"}].\n// Allowed values are:\n// - key: the key for the <dt> (e.g., \"Bug Tracker\"). Required.\n// - value: The value that will appear in the <dd> (e.g., \"GitHub\"). Optional.\n// - href: a URL for the value (e.g., \"https://foo.com/issues\"). Optional.\n// - class: a string representing CSS classes. Optional.\n// - license: can be one of the following\n// - \"aom\"\nimport { ISODate, showError } from \"../core/utils.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { pub } from \"../core/pubsubhub.js\";\n\nexport const name = \"aom/headers\";\n\nconst status2text = {\n PD: \"Pre-Draft\",\n WGD: \"AOM Work Group Draft\",\n WGA: \"AOM Working Group Approved Draft\",\n FD: \"AOM Final Deliverable\",\n};\n\nconst AOMDate = new Intl.DateTimeFormat([\"en-US\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n});\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg =\n `[\\`${prop}\\`](https://github.com/speced/respec/wiki/${prop}) ` +\n `is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"Missing required configuration: `specStatus`\";\n showError(msg, name);\n }\n conf.title = document.title || \"No title\";\n if (!conf.subtitle) conf.subtitle = \"\";\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.thisVersion = `https://aomediacodec.github.io/${conf.shortName}/`;\n conf.issueTracker = `https://github.com/AOMediaCodec/${conf.shortName}/issues/`;\n conf.publishYear = conf.publishDate.getUTCFullYear();\n conf.publishHumanDate = AOMDate.format(conf.publishDate);\n const peopCheck = function (it) {\n if (!it.name) {\n const msg = \"All authors and editors must have a name.\";\n showError(msg, name);\n }\n };\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\n conf.editors.forEach(peopCheck);\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n }\n if (!conf.editors || conf.editors.length === 0) {\n const msg = \"At least one editor is required\";\n showError(msg, name);\n }\n if (conf.formerEditors.length) {\n conf.formerEditors.forEach(peopCheck);\n }\n if (conf.authors) {\n conf.authors.forEach(peopCheck);\n }\n conf.multipleEditors = conf.editors && conf.editors.length > 1;\n conf.multipleFormerEditors = conf.formerEditors.length > 1;\n conf.multipleAuthors = conf.authors && conf.authors.length > 1;\n // (conf.alternateFormats || []).forEach(it => {\n // if (!it.uri || !it.label) {\n // const msg = \"All alternate formats must have a uri and a label.\";\n // showError(msg, name);\n // }\n // });\n if (conf.copyrightStart && conf.copyrightStart == conf.publishYear)\n conf.copyrightStart = \"\";\n conf.textStatus = status2text[conf.specStatus];\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n // configuration done - yay!\n\n // insert into document\n const header = headersTmpl(conf);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // Requested by https://github.com/speced/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: `${conf.longStatus} ${conf.publishHumanDate}`,\n });\n}\n","// @ts-check\n// Module aom/abstract\n// Handle the abstract section properly.\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"aom/abstract\";\n\nconst localizationStrings = {\n en: {\n abstract: \"Abstract\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run() {\n const abs = document.getElementById(\"abstract\");\n if (!abs) {\n const msg = `Document must have one element with \\`id=\"abstract\"`;\n showError(msg, name);\n return;\n }\n abs.classList.add(\"introductory\");\n let abstractHeading = document.querySelector(\"#abstract>h2\");\n if (abstractHeading) {\n return;\n }\n abstractHeading = document.createElement(\"h2\");\n abstractHeading.textContent = l10n.abstract;\n abs.prepend(abstractHeading);\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Module core/data-abbr\n// - Finds all elements with data-abbr attribute and processes them.\nimport { showError } from \"./utils.js\";\nexport const name = \"core/dfn-abbr\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = document.querySelectorAll(\"[data-abbr]\");\n for (const elem of elements) {\n const { localName } = elem;\n switch (localName) {\n case \"dfn\":\n processDfnElement(elem);\n break;\n default: {\n const msg = `\\`data-abbr\\` attribute not supported on \\`${localName}\\` elements.`;\n showError(msg, name, {\n elements: [elem],\n title: \"Error: unsupported.\",\n });\n }\n }\n }\n}\n/**\n * @param {HTMLElement} dfn\n */\nfunction processDfnElement(dfn) {\n const abbr = generateAbbreviation(dfn);\n // get normalized <dfn> textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (<abbr title=\"${fullForm}\">${abbr}</abbr>)`\n );\n const lt = dfn.dataset.lt || \"\";\n dfn.dataset.lt = lt\n .split(\"|\")\n .filter(i => i.trim())\n .concat(abbr)\n .join(\"|\");\n}\n\nfunction generateAbbreviation(elem) {\n if (elem.dataset.abbr) return elem.dataset.abbr;\n // Generates abbreviation from textContent\n // e.g., \"Permanent Account Number\" -> \"PAN\"\n return elem.textContent\n .match(/\\b([a-z])/gi)\n .join(\"\")\n .toUpperCase();\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/speced/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"ģ°øģ”°\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参ē…§ē”Øå‚č€ƒę–‡ēŒ®\",\n norm_references: \"č¦ēƄēš„å‚č€ƒę–‡ēŒ®\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n de: {\n info_references: \"WeiterfĆ¼hrende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"éžč§„čŒƒę€§å¼•ē”Ø\",\n norm_references: \"č§„čŒƒę€§å¼•ē”Ø\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n if (!output.endsWith(\".\")) output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMƜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NƖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDƜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKƖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;\"?<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn or a `a`, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn,a\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn|abstract-op\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n /** @param {string} str */\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","// @ts-check\n// Module aom/conformance\n// Handle the conformance section properly.\nimport { getIntlData, htmlJoinAnd, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"aom/conformance\";\n\nconst localizationStrings = {\n en: {\n conformance: \"Conformance\",\n normativity:\n \"As well as sections marked as non-normative, all authoring guidelines, \" +\n \"diagrams, examples, and notes in this specification are non-normative. \" +\n \"Everything else in this specification is normative.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n The key word${plural ? \"s\" : \"\"} ${keywords} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n when, and only when, they appear in all capitals, as shown here.\n </p>`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = [...Object.keys(rfc2119Usage)];\n // Add RFC2119 to bibliography\n if (terms.length) {\n conf.normativeReferences.add(\"RFC2119\");\n conf.normativeReferences.add(\"RFC8174\");\n }\n // Put in the 2119 clause and reference\n const keywords = htmlJoinAnd(\n terms.sort(),\n item => html`<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h1>${l10n.conformance}</h1>\n <p>${l10n.normativity}</p>\n ${terms.length ? l10n.keywordInterpretation(keywords, plural) : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance && !conformance.classList.contains(\"override\")) {\n processConformance(conformance, conf);\n }\n // Warn when there are RFC2119/RFC8174 keywords, but not conformance section\n if (!conformance && Object.keys(rfc2119Usage).length) {\n const msg = `Document uses RFC2119 keywords but lacks a conformance section.`;\n const hint = 'Please add a `<section id=\"conformance\">`.';\n showWarning(msg, name, { hint });\n }\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"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`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"ģ˜ˆģ‹œ\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-color: var(--warning-border, #f11);\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n background: var(--warning-bg, #fbe9e9);\n color: black;\n color: var(--text, black);\n}\n\n.warning-title:before {\n content: \"āš \"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"ę³Ø\",\n editors_note: \"ē·Ø者ę³Ø\",\n feature_at_risk: \"(å¤‰ę›“ć®åÆčƒ½ę€§ć®ć‚ć‚‹ę©Ÿčƒ½) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 恮要ē“„\",\n no_issues_in_spec: \"ć“ć®ä»•ę§˜ć«ćÆęœŖč§£ę±ŗ恮 issues ćÆå«ć¾ć‚Œć¦ć„ć¾ć›ć‚“ļ¼Ž\",\n warning: \"č­¦å‘Š\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"CuestiĆ³n\",\n issue_summary: \"Resumen de la cuestiĆ³n\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificaciĆ³n.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthƤlt keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"ē¼–者ę³Ø\",\n feature_at_risk: \"ļ¼ˆęœ‰åÆčƒ½å˜åŠØēš„ē‰¹ę€§ļ¼‰Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue ꀻē»“\",\n no_issues_in_spec: \"ęœ¬č§„čŒƒäø­ęœŖ列å‡ŗ任何 issue怂\",\n note: \"ę³Ø\",\n warning: \"č­¦å‘Š\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"꜀č‰Æå®Ÿę–½ä¾‹ \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"ęœ€ä½³å®žč·µ \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"å›³ć®ćƒŖć‚¹ćƒˆ\",\n },\n ko: {\n fig: \"ź·øė¦¼ \",\n list_of_figures: \"ź·øė¦¼ ėŖ©ė”\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范äø­åŒ…含ēš„图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of the specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n *\n * @module core/data-cite\n */\n\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to the current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n * @type {string}\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * Gets the link properties for the given citation details.\n * @param {CiteDetails} citeDetails - The citation details.\n * @returns {Promise<LinkProps|null>} The link properties or null if not found.\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/speced/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n\n return { href, title };\n}\n\n/**\n * Links the given element with the provided link properties and citation details.\n * @param {HTMLElement} elem - The element to link.\n * @param {LinkProps} linkProps - The link properties.\n * @param {CiteDetails} citeDetails - The citation details.\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n anchor.dataset.cite = citeDetails.key;\n anchor.dataset.citePath = citeDetails.path;\n anchor.dataset.citeFrag = citeDetails.frag;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting a linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * Converts the given raw key to citation details.\n * @param {HTMLElement} elem - The element containing the citation details.\n * @returns {CiteDetails} The citation details.\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as a fragment\n return toCiteDetails(elem);\n }\n\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\n/**\n * Runs the data-cite processing on elements with the data-cite attribute.\n */\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetches and updates `biblio` with entries corresponding to the given elements.\n * @param {HTMLElement[]} elems - The elements requiring biblio entries.\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/**\n * Cleans up the data-cite attributes from the document.\n * @param {Document} doc - The document to cleanup.\n */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ć®é‡č¤‡å®šē¾©`;\n },\n duplicateTitle: \"恓恮ꖇę›øå†…ć§č¤‡ę•°å›žå®šē¾©ć•ć‚Œć¦ć„ć¾ć™ļ¼Ž\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthƤlt mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ēš„重复定义`;\n },\n duplicateTitle: \"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n for (const type of linkType.split(\"|\")) {\n if (dfnsByType.get(type)) {\n return dfnsByType.get(type);\n }\n }\n return dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name, { cause: error });\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大ēŗ²\",\n },\n ko: {\n toc: \"ėŖ©ģ°Ø\",\n },\n ja: {\n toc: \"ē›®ę¬”\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at Ā§1, we will keep Ā§1.1 but not Ā§1.1.1\n // Similarly, `data-max-toc=1` will keep Ā§1, but not Ā§1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"ģ“ ė¶€ė¶„ģ€ ė¹„ź·œė²”ģ ģž…ė‹ˆė‹¤.\",\n },\n ja: {\n informative: \"恓恮ēƀćÆä»•ę§˜ć«ćÆå«ć¾ć‚Œć¾ć›ć‚“ļ¼Ž\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"äæå­˜ć™ć‚‹\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"åƼå‡ŗ\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"šŸ’¾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关äŗŽ\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"ć“ć‚Œć«ć¤ć„ć¦\",\n },\n de: {\n about_respec: \"Ɯber\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ā„¹ļø\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/speced/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/speced/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\nimport { html } from \"../core/import-maps.js\";\n\nexport const name = \"core/seo\";\n\nexport function run(conf) {\n if (conf.gitRevision) {\n // This allows to set a git revision of the source used to produce the\n // generated content. Typically, this would be set when generating the\n // static HTML via a build process.\n // 'revision' is the name recommended in https://wiki.whatwg.org/wiki/MetaExtensions\n const metaElem = html`<meta\n name=\"revision\"\n content=\"${conf.gitRevision}\"\n />`;\n document.head.appendChild(metaElem);\n }\n\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","/*\nOne Light for ReSpec, with better color contrast\nAdapted from Atom One Light by Daniel Gamage (https://github.com/highlightjs/highlight.js/blob/c0b6ddbaaf7/src/styles/atom-one-light.css>\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n --base: #fafafa;\n --mono-1: #383a42;\n --mono-2: #686b77;\n --mono-3: #717277;\n --hue-1: #0b76c5;\n --hue-2: #336ae3;\n --hue-3: #a626a4;\n --hue-4: #42803c;\n --hue-5: #ca4706;\n --hue-5-2: #c91243;\n --hue-6: #986801;\n --hue-6-2: #9a6a01;\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n .hljs {\n --base: #282c34;\n --mono-1: #abb2bf;\n --mono-2: #818896;\n --mono-3: #5c6370;\n --hue-1: #56b6c2;\n --hue-2: #61aeee;\n --hue-3: #c678dd;\n --hue-4: #98c379;\n --hue-5: #e06c75;\n --hue-5-2: #be5046;\n --hue-6: #d19a66;\n --hue-6-2: #e6c07b;\n }\n}\n\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n color: var(--mono-1, #383a42);\n background: #fafafa;\n background: var(--base, #fafafa);\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n color: var(--mono-3, #717277);\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n color: var(--hue-3, #a626a4);\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n color: var(--hue-5, #ca4706);\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n color: var(--hue-1, #0b76c5);\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n color: var(--hue-4, #42803c);\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n color: var(--hue-6-2, #9a6a01);\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n color: var(--hue-6, #986801);\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n color: var(--hue-2, #336ae3);\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n var.respec-hl {\n filter: saturate(0.9) brightness(0.9)\n }\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within the algorithm or the encompassing section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\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","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar {\n position: relative;\n cursor: pointer;\n}\n\nvar[data-type]::before,\nvar[data-type]::after {\n position: absolute;\n left: 50%;\n top: -6px;\n opacity: 0;\n transition: opacity 0.4s;\n pointer-events: none;\n}\n\n/* the triangle or arrow or caret or whatever */\nvar[data-type]::before {\n content: \"\";\n transform: translateX(-50%);\n border-width: 4px 6px 0 6px;\n border-style: solid;\n border-color: transparent;\n border-top-color: #222;\n}\n\n/* actual text */\nvar[data-type]::after {\n content: attr(data-type);\n transform: translateX(-50%) translateY(-100%);\n background: #222;\n text-align: center;\n /* additional styling */\n font-family: \"Dank Mono\", \"Fira Code\", monospace;\n font-style: normal;\n padding: 6px;\n border-radius: 3px;\n color: #daca88;\n text-indent: 0;\n font-weight: normal;\n}\n\nvar[data-type]:hover::after,\nvar[data-type]:hover::before {\n opacity: 1;\n}\n`;\n","// @ts-check\n/**\n * Module core/data-type\n * Propagates data type of a <var> to subsequent instances within a section.\n * Also adds the CSS for the data type tooltip.\n * Set `conf.highlightVars = true` to enable.\n */\nimport css from \"../styles/datatype.css.js\";\n\nexport const name = \"core/data-type\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n\n let section = null;\n const varMap = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const variables = document.querySelectorAll(\"section var\");\n for (const varElem of variables) {\n const currentSection = varElem.closest(\"section\");\n if (section !== currentSection) {\n section = currentSection;\n varMap.clear();\n }\n if (varElem.dataset.type) {\n varMap.set(varElem.textContent.trim(), varElem.dataset.type);\n continue;\n }\n const type = varMap.get(varElem.textContent.trim());\n if (type) varElem.dataset.type = type;\n }\n}\n","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n:root {\n --assertion-border: #aaa;\n --assertion-bg: #eee;\n --assertion-text: black;\n}\n\n.assert {\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n border-color: #aaa;\n border-color: var(--assertion-border);\n background: #eee;\n background: var(--assertion-bg);\n color: black;\n color: var(--assertion-text);\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n :root {\n --assertion-border: #444;\n --assertion-bg: var(--borderedblock-bg);\n --assertion-text: var(--text);\n }\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"Ā§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/speced/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n background: var(--indextable-hover-bg, #fff);\n color: black;\n color: var(--text, black);\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: 0 1em 3em -0.4em var(--tocsidebar-shadow, rgba(0, 0, 0, 0.3)),\n 0 0 1px 1px var(--tocsidebar-shadow, rgba(0, 0, 0, 0.05));\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n border-bottom-color: var(--indextable-hover-bg, #fff);\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n /* TODO: need slightly darker shade */\n border-bottom-color: var(--indextable-hover-bg, #a2a9b1);\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n color: var(--text, #000);\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n color: var(--text, #333);\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => {\n return html`<li>\n ${toLinkProps(entry).map(link => {\n return html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a\n >${\" \"}`;\n })}\n </li>`;\n };\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `Ā§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/speced/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"ģ°øģ—¬\",\n },\n zh: {\n file_a_bug: \"反馈错čÆÆ\",\n participate: \"参äøŽļ¼š\",\n },\n ja: {\n commit_history: \"å¤‰ę›“å±„ę­“\",\n file_a_bug: \"問锌報告\",\n participate: \"å‚åŠ ę–¹ę³•ļ¼š\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${ghURL.href}).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","// @ts-check\n/**\n * Fetches commits between two commitish (tag or commit) - `from` and `to=HEAD`\n * and shows them as a list of \"changes during\" those commitish. If a filter\n * function is provided by the user, it is used to filter the commits that are\n * to be shown. Otherwise, all commits are shown.\n *\n * @typedef {{message: string, hash: string}} Commit\n */\nimport { github } from \"../github.js\";\nimport { html } from \"../import-maps.js\";\nimport { showError } from \"../utils.js\";\n\nexport const name = \"rs-changelog\";\n\nexport const element = class ChangelogElement extends HTMLElement {\n constructor() {\n super();\n this.props = {\n from: this.getAttribute(\"from\"),\n to: this.getAttribute(\"to\") || \"HEAD\",\n /** @type {(commit: Commit) => boolean} */\n filter:\n typeof window[this.getAttribute(\"filter\")] === \"function\"\n ? window[this.getAttribute(\"filter\")]\n : () => true,\n };\n }\n\n connectedCallback() {\n const { from, to, filter } = this.props;\n html.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error =>\n showError(error.message, name, { elements: [this], cause: error })\n )\n .finally(() => {\n this.dispatchEvent(new CustomEvent(\"done\"));\n }),\n placeholder: \"Loading list of commits...\",\n }}\n </ul>\n `;\n }\n};\n\nasync function fetchCommits(from, to, filter) {\n /** @type {Commit[]} */\n let commits;\n try {\n const gh = await github;\n if (!gh) {\n throw new Error(\"`respecConfig.github` is not set\");\n }\n const url = new URL(\"commits\", `${gh.apiBase}/${gh.fullName}/`);\n url.searchParams.set(\"from\", from);\n url.searchParams.set(\"to\", to);\n\n const res = await fetch(url.href);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n commits = await res.json();\n if (!commits.length) {\n throw new Error(`No commits between ${from}..${to}.`);\n }\n commits = commits.filter(filter);\n } catch (error) {\n const msg = `Error loading commits from GitHub. ${error.message}`;\n throw new Error(msg, { cause: error });\n }\n return commits;\n}\n\nasync function toHTML(commits) {\n const { repoURL } = await github;\n return commits.map(commit => {\n const [message, prNumber = null] = commit.message.split(/\\(#(\\d+)\\)/, 2);\n const commitURL = `${repoURL}commit/${commit.hash}`;\n const prURL = prNumber ? `${repoURL}pull/${prNumber}` : null;\n const pr = prNumber && html` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return html`<li><a href=\"${commitURL}\">${message.trim()}</a>${pr}</li>`;\n });\n}\n","// @ts-check\n/**\n * Registers custom elements and waits for them to finish their processing.\n *\n * Every custom element file exports:\n * - `name`: registered name of the custom element, prefixed with `rs-`.\n * - `element`: class defintion of the custom element.\n *\n * Every custom element must dispatch a CustomEvent 'done' that tells the\n * element has finished its processing, with or without errors.\n *\n * @typedef {{ name: string, element: CustomElementConstructor }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements/index\";\n\nexport async function run() {\n // prepare and register elements\n CUSTOM_ELEMENTS.forEach(el => {\n customElements.define(el.name, el.element);\n });\n\n // wait for each element to be ready\n const selectors = CUSTOM_ELEMENTS.map(el => el.name).join(\", \");\n const elems = document.querySelectorAll(selectors);\n const readyPromises = [...elems].map(\n el => new Promise(res => el.addEventListener(\"done\", res, { once: true }))\n );\n await Promise.all(readyPromises);\n}\n","export const name = \"core/dfn-contract\";\n\nexport function run() {\n addContractDefaults();\n addDefinitionPointers();\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n\n// - Sets data-defines on well-known definition content patterns\nfunction addDefinitionPointers() {\n // A dl with class hasdefinitions associated the dfn in each dt\n // the definition in the following sibling element\n /** @type NodeListOf<HTMLElement> */\n const describedDTs = document.querySelectorAll(\n \"dl.definitions dt:has(dfn[data-dfn-type])\"\n );\n for (const dt of describedDTs) {\n const dfnId = dt.querySelector(\"dfn[data-dfn-type]\").id;\n const dfnContent = /** @type {HTMLElement | null} */ (\n dt.nextElementSibling\n );\n if (dfnContent && !dfnContent.dataset.defines && dfnId) {\n dfnContent.dataset.defines = `#${dfnId}`;\n }\n }\n\n // an element with class \"definition\" is marked as defining the term\n // found in the element\n /** @type NodeListOf<HTMLElement> */\n const definitionContainers = document.querySelectorAll(\n \".definition:has(dfn[data-dfn-type])\"\n );\n for (const el of definitionContainers) {\n const dfn = el.querySelector(\"dfn[data-dfn-type]\");\n if (dfn.id && !el.dataset.defines) {\n el.dataset.defines = `#${dfn.id}`;\n }\n }\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ \\`<meta>\\` ꠇē­¾`,\n hint: `å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ \\`<head>\\` éƒØ分ā€”ā€” \\`<meta charset=\"utf-8\">\\` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂\",\n hint: \"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * Checks that there is a section that has at least privacy and/or\n * security and considerations.\n *\n * The rule is \"privacy\" or \"security\", and \"considerations\", in any order,\n * case-insensitive, multi-line check.\n *\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"privsec-section\";\nexport const name = \"core/linter-rules/privsec-section\";\n\nconst localizationStrings = {\n en: {\n msg: \"Document must have a 'Privacy and/or Security' Considerations section.\",\n hint:\n \"Add a privacy and/or security considerations section. \" +\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nfunction hasPriSecConsiderations(doc) {\n return Array.from(doc.querySelectorAll(\"h2, h3, h4, h5, h6\")).some(\n ({ textContent: text }) => {\n const saysPrivOrSec = /(privacy|security)/im.test(text);\n const saysConsiderations = /(considerations)/im.test(text);\n return (saysPrivOrSec && saysConsiderations) || saysPrivOrSec;\n }\n );\n}\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n if (conf.isRecTrack && !hasPriSecConsiderations(document)) {\n showWarning(l10n.msg, name, { hint: l10n.hint });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,\n hint: \"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","instanceOfAny","constructors","some","c","idbProxyableTypes","cursorAdvanceMethods","transactionDoneMap","WeakMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","replaceTraps","wrapFunction","func","IDBCursor","prototype","advance","continue","continuePrimaryKey","includes","args","apply","unwrap","this","request","transformCachableValue","tx","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","addEventListener","cacheDonePromiseForTransaction","IDBDatabase","IDBObjectStore","IDBIndex","Proxy","IDBRequest","promise","success","result","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","transaction","store","index","shift","oldTraps","advanceMethodProps","methodMap","advanceResults","ittrProxiedCursorToOriginalProxy","cursorIteratorTraps","cachedFunc","iterate","cursor","openCursor","proxiedCursor","delete","isIteratorProp","Symbol","asyncIterator","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","catch","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","_getDefaults","breaks","extensions","gfm","hooks","pedantic","renderer","silent","tokenizer","walkTokens","_defaults","changeDefaults","newDefaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape$1","encode","unescapeTest","unescape","_","n","charAt","String","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","valSource","getRegex","cleanUrl","href","encodeURI","e","noopTest","exec","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","i","trim","length","pop","splice","push","rtrim","invert","l","suffLen","currChar","slice","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","_Tokenizer","options","rules","constructor","space","src","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","anyPunctuation","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","bull","isordered","ordered","start","loose","items","itemRegex","itemContents","endsWithBlankLine","endEarly","line","t","repeat","nextLine","indent","trimStart","search","blankLine","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","rawLine","ischecked","istask","task","checked","trimEnd","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","headers","aligns","rows","item","header","align","row","cell","lheading","paragraph","escape","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","indexOf","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","emStrongLDelim","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","emStrongRDelimAst","emStrongRDelimUnd","lastIndex","lastCharLength","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","bullet","_paragraph","_blockLabel","_tag","_comment","blockNormal","gfmTable","blockGfm","blockPedantic","_punctuation","_inlineComment","_inlineLabel","inlineNormal","blockSkip","reflinkSearch","inlinePedantic","inlineGfm","inlineBreaks","normal","_Lexer","inlineQueue","Object","create","lex","lexInline","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","call","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","charCodeAt","console","keepPrevChar","keys","lastIndexOf","startInline","_Renderer","infostring","quote","body","listitem","checkbox","tablerow","content","tablecell","flags","strong","em","cleanHref","out","image","_TextRenderer","_Parser","textRenderer","parse","parseInline","renderers","genericToken","ret","parser","headingToken","codeToken","tableToken","j","k","blockquoteToken","listToken","itemBody","unshift","htmlToken","paragraphToken","textToken","escapeToken","tagToken","linkToken","imageToken","strongToken","emToken","codespanToken","delToken","_Hooks","static","Set","preprocess","markdown","postprocess","processAllTokens","markedInstance","defaults","setOptions","parseMarkdown","Parser","Renderer","TextRenderer","Lexer","Tokenizer","Hooks","use","values","concat","childTokens","flat","pack","opts","ext","prevRenderer","extLevel","rendererProp","rendererFunc","tokenizerProp","tokenizerFunc","prevTokenizer","hooksProp","hooksFunc","prevHook","passThroughHooks","arg","packWalktokens","origOpt","warn","throwError","onError","toString","message","msg","marked","getDefaultExportFromCjs","x","__esModule","hasOwnProperty","marked$1","getDefaults","hasRequiredPluralize","pluralize$2","exports","module","pluralizeExports","root","pluralize","pluralize$1","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","arguments","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","configurable","o","random","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","v","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","detail","CustomEvent","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ne","re","ie","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","sort","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","setTimeout","addedNodes","removedNodes","dispatchEvent","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","key","serialize","_pluralize","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","startsWith","W3CDate","nonNormativeSelector","createResourceHint","URL","baseURI","linkElem","rel","hint","origin","corsMode","location","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","cause","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","getElementsByTagName","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parent","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","markAsOffending","toJSON","stack","details","showError","pluginName","pub","makePluginUtils","toMDCode","codedJoinOr","quotes","docLink","strings","reindent","endsWith","linkingText","lines","indents","leastIndent","subscriptions","EventTarget","topic","self","JSON","stringify","postMessage","sub","cb","once","ev","removeList","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","toHTML","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodeURIComponent","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","utils","err","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$h","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","buttonId","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","locationHash","l10n$p","style$1","dataInclude","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","saveHtml","aboutRespec","seo","highlight","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","dfnContract","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","newHash","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","aomDefaults","logos","alt","height","width","license","licenseInfo","computeProps","css$f","noReSpecCSS","resourceHints","createResourceHints","createBaseStyle","meta","delimiter","separator","toKeyValuePairs","createMetaViewport","styleFile","noToc","attachFixupScript","finalStyleURL","linkURL","urls","frag","reduce","nextLink","linkCSS","exportDoc","w3cStyle","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","default_title","zh","h1Elem","isConnected","tempElem","documentTitle","isPreview","prNumber","prUrl","github","repoURL","setDocumentTitle","showLink","class","showLinkData","showLogo","logo","until","date","es","ko","ja","orcidIcon","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","remainder","Number","acc","lastDigitInt","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","Date","extras","every","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","protocol","hCard","companyElem","note","classVal","renderExtra","time","author","authors","editor","editors","former_editor","former_editors","latest_editors_draft","latest_published_version","this_version","issue_tracker","headersTmpl","specSubTitleElem","subtitle","getSpecSubTitleElem","textStatus","dashDate","publishHumanDate","thisVersion","issueTracker","multipleEditors","formerEditors","multipleFormerEditors","multipleAuthors","otherLinks","existingCopyright","publishYear","renderCopyright","status2text","PD","WGD","WGA","FD","AOMDate","publishDate","fallbackDate","isFinite","formattedDate","validateDateAndRecover","lastModified","shortName","getUTCFullYear","peopCheck","copyrightStart","publishISODate","toISOString","generatedSubtitle","longStatus","abs","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","base","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","range","IDBKeyRange","lowerBound","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","addAll","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","clear","storeNames","stores","clearStorePromises","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","nl","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","normativity","keywordInterpretation","processConformance","terms","contains","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","closestType","computeExport","export","titles","pluralizeDfn","dfnTexts","dfns","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$d","makeTitle","num","report","number","div","inAside","exampleTitle","css$b","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","handleIssues","ins","ghIssues","getIssueNumber","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","issueBase","atRiskBase","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","issuesURL","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","apiBase","issueNumbers","fullName","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","decorateTableOfFigures","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","citePath","citeFrag","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","about_respec","getEntriesByType","duration","round","perfEntryToTR","gitRevision","metaElem","firstParagraph","css$9","fetchBase","_documentCurrentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","css$5","varMap","variables","currentSection","css$3","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","file_a_bug","participate","commit_history","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","dfnsWithNoType","exportableDfns","addContractDefaults","describedDTs","dfnId","dfnContent","defines","definitionContainers","addDefinitionPointers","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"qHACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,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G,QAC3G,CAAC,8FAA+F,QAChG,CAAC,0BAA2B,OAC5B,CAAC,+BAAgC,QACjC,CAAC,sBAAuB,QACxB,CAAC,oBAAqB,UACtB,CAAC,eAAgB,MACjB,CAAC,YAAa,MACd,CAAC,QAAS,QACVvH,SAAQ,SAAUuH,GAClB,OAAOR,EAAU4B,gBAAgBpB,EAAK,GAAIA,EAAK,GACrD,IAKI,CAEE,YACA,SACA,SACA,MACA,WACA,UACA,OACA,YACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,SACA,WACA,YACA,MACA,SACA,YACA,YACA,YACA,WACA,WACA,MACA,UACA,UACA,WACA,WACA,eACA,SACA,SACA,YACA,WACA,YACA,cACA,QACA,UACA,QACA,SACA,aACA,YACA,WACA,OACA,QACA,OACA,QACA,QACA,MACA,QACA,OACA,OACA,YACA,OACA,WACA,SACA,SACA,YACA,WACA,OACA,WACA,OACA,SACA,WACA,SACA,SACA,WACA,SACA,WACA,UACA,QACA,QACA,SACA,UACA,iBACA,QACA,OACA,SACA,UACA,UACA,aACA,WACA,MACA,eAEA,gBACA,SACA,SACA,YACA,WACA,QACA,WACAvH,QAAQ+G,EAAU6B,oBAEb7B,CACX,KAlfkCL,GAAYC,SAwf1CI,GAAyBZ,GAAwBU,ICxgBfkC,GAAU,SAASC,GAAgB,IAAIhQ,EAAE,CAAE,EAAC,IAAIA,EAAEnO,QAAQA,OAAO,CAAC,MAAMsJ,GAAG6E,EAAEnO,QAAQ,SAASmO,EAAE7E,GAAG,IAAIjB,EAAEiB,EAAE8U,eAAeC,EAAE/U,EAAEmS,eAAetR,EAAEmU,EAAEld,UAAU,OAAO+I,EAAEpF,OAAO,SAASuE,GAAG,OAAO1H,KAAKb,IAAIuI,WAAWA,EAAE1H,KAAKwG,EAAE,EAAE+B,EAAE/J,IAAI,SAASkJ,GAAG,OAAO1H,KAAKb,IAAIuI,GAAGA,EAAE1H,KAAKwG,QA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GAEjDjsB,QAAOyd,GAAQA,EAAIqI,SAAS,QAAUmG,EAAKxO,IAAiB,WAARA,IAEpDzd,QAAOyd,GACN,IAAIiB,IAAIuN,EAAKxO,GAAM2F,OAAOnE,SAASplB,MAAMA,KAAKykB,WAAW,aAG7D,GAAIimC,EAAiBzpD,OAAQ,CAC3B,MAAMoL,EAAO+Z,GAAQskC,GAAkB9mC,GAAOkI,EAAO,GAAG,IAAIlI,SAC5DmD,GAAY7wB,GAAK8b,IAAKtc,GAAM,CAAEuvB,KAAM/uB,GAAK+uB,KAAO5Y,GACpD,CACA","x_google_ignoreList":[2,3,4,6]} \ No newline at end of file diff --git a/builds/respec-dini.js b/builds/respec-dini.js index 6a02d7d6f3..8866729d7f 100644 --- a/builds/respec-dini.js +++ b/builds/respec-dini.js @@ -1,6 +1,6 @@ -window.respecVersion="35.1.2",function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=!!window.require;if(!t){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function n(e,n){t||(window.require.modules[e]=n)}const r=new EventTarget;function o(e,t){if(r.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const n=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function s(e,t,n={once:!1}){r.addEventListener(e,(e=>t(e.detail)),n)}n("core/pubsubhub",{sub:s});const i=["githubToken","githubUser"];const a=document.documentElement;a?.hasAttribute("lang")||(a.lang="en",a.hasAttribute("dir")||(a.dir="ltr"));const c={},l=a?.lang??"en";var u=Object.freeze({__proto__:null,l10n:c,lang:l,name:"core/l10n",run:function(e){e.l10n=c[l]||c.en}});const d=(e,t)=>t.some((t=>e instanceof t));let p,f;const h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return x(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function y(e){b=e(b)}function w(e){return(f||(f=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(k(this),t),x(this.request)}:function(...t){return x(e.apply(k(this),t))}}function v(e){return"function"==typeof e?w(e):(e instanceof IDBTransaction&&function(e){if(h.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)}));h.set(e,t)}(e),d(e,p||(p=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,b):e)}function x(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(x(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)}));return g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=v(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const k=e=>g.get(e);const $=["get","getKey","getAll","getAllKeys","count"],_=["put","add","delete","clear"],E=new Map;function C(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(E.get(t))return E.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=_.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!$.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let i=s.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),o&&s.done]))[0]};return E.set(t,s),s}y((e=>({...e,get:(t,n,r)=>C(t,n)||e.get(t,n,r),has:(t,n)=>!!C(t,n)||e.has(t,n)})));const S=["continue","continuePrimaryKey","advance"],L={},A=new WeakMap,T=new WeakMap,R={get(e,t){if(!S.includes(t))return e[t];let n=L[t];return n||(n=L[t]=function(...e){A.set(this,T.get(this)[t](...e))}),n}};async function*N(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,R);for(T.set(n,t),g.set(n,k(t));t;)yield n,t=await(A.get(n)||t.continue()),A.delete(n)}function P(e,t){return t===Symbol.asyncIterator&&d(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&d(e,[IDBIndex,IDBObjectStore])}y((e=>({...e,get:(t,n,r)=>P(t,n)?N:e.get(t,n,r),has:(t,n)=>P(t,n)||e.has(t,n)})));var j=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),x(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=x(i);return r&&i.addEventListener("upgradeneeded",(e=>{r(x(i.result),e.oldVersion,e.newVersion,x(i.transaction),e)})),n&&i.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{s&&e.addEventListener("close",(()=>s())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:k,wrap:x});const D=/^[!#$%&'*+-.^`|~\w]+$/,O=/[\u000A\u000D\u0009\u0020]/u,z=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function I(e,t,n){(t&&""!==t&&!e.has(t)&&z.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function q(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let M={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function F(e){M=e}const B=/[&<>"']/,H=new RegExp(B.source,"g"),W=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,U=new RegExp(W.source,"g"),Z={"&":"&","<":"<",">":">",'"':""","'":"'"},V=e=>Z[e];function K(e,t){if(t){if(B.test(e))return e.replace(H,V)}else if(W.test(e))return e.replace(U,V);return e}const Y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function X(e){return e.replace(Y,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Q=/(^|[^\[])\^/g;function G(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(Q,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}function J(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const ee={exec:()=>null};function te(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function ne(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const s=e.charAt(r-o-1);if(s!==t||n){if(s===t||!n)break;o++}else o++}return e.slice(0,r-o)}function re(e,t,n,r){const o=t.href,s=t.title?K(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:s,text:i,tokens:r.inlineTokens(i)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:s,text:K(i)}}class oe{options;rules;lexer;constructor(e){this.options=e||M}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ne(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=ne(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");e=ne(e.replace(/^ *>[ \t]?/gm,""),"\n");const n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const s=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let i="",a="",c=!1;for(;e;){let n=!1;if(!(t=s.exec(e)))break;if(this.rules.block.hr.test(e))break;i=t[0],e=e.substring(i.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),l=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=r.slice(u),u+=t[1].length);let d=!1;if(!r&&/^ *$/.test(l)&&(i+=l+"\n",e=e.substring(l.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const c=e.split("\n",1)[0];if(l=c,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),o.test(l))break;if(s.test(l))break;if(t.test(l))break;if(n.test(e))break;if(l.search(/[^ ]/)>=u||!l.trim())a+="\n"+l.slice(u);else{if(d)break;if(r.search(/[^ ]/)>=4)break;if(o.test(r))break;if(s.test(r))break;if(n.test(r))break;a+="\n"+l}d||l.trim()||(d=!0),i+=c+"\n",e=e.substring(c.length+1),r=l.slice(u)}}o.loose||(c?o.loose=!0:/\n *\n *$/.test(i)&&(c=!0));let p,f=null;this.options.gfm&&(f=/^\[[ xX]\] /.exec(a),f&&(p="[ ] "!==f[0],a=a.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:i,task:!!f,checked:p,loose:!1,text:a,tokens:[]}),o.raw+=i}o.items[o.items.length-1].raw=i.trimEnd(),o.items[o.items.length-1].text=a.trimEnd(),o.raw=o.raw.trimEnd();for(let e=0;e<o.items.length;e++)if(this.lexer.state.top=!1,o.items[e].tokens=this.lexer.blockTokens(o.items[e].text,[]),!o.loose){const t=o.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));o.loose=n}if(o.loose)for(let e=0;e<o.items.length;e++)o.items[e].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=te(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),o=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?s.align.push("right"):/^ *:-+: *$/.test(e)?s.align.push("center"):/^ *:-+ *$/.test(e)?s.align.push("left"):s.align.push(null);for(const e of n)s.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of o)s.rows.push(te(e,s.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:K(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=ne(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),re(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return re(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let o,s,i=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(s=[...o].length,r[3]||r[4]){i+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){a+=s;continue}if(i-=s,i>0)continue;s=Math.min(s,s+i+a);const t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+s);if(Math.min(n,s)%2){const e=c.slice(1,-1);return{type:"em",raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}const l=c.slice(2,-2);return{type:"strong",raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=K(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=K(t[1]),n="mailto:"+e):(e=K(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=K(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=K(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:K(t[0]),{type:"text",raw:t[0],text:e}}}}const se=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ie=/(?:[*+-]|\d{1,9}[.)])/,ae=G(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ie).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),ce=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,le=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ue=G(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",le).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),de=G(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ie).getRegex(),pe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",fe=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,he=G("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",fe).replace("tag",pe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),me=G(ce).replace("hr",se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex(),ge={blockquote:G(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",me).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:ue,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:se,html:he,lheading:ae,list:de,newline:/^(?: *(?:\n|$))+/,paragraph:me,table:ee,text:/^[^\n]+/},be=G("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex(),ye={...ge,table:be,paragraph:G(ce).replace("hr",se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",be).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex()},we={...ge,html:G("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",fe).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ee,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:G(ce).replace("hr",se).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ae).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ve=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xe=/^( {2,}|\\)\n(?!\s*$)/,ke="\\p{P}\\p{S}",$e=G(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,ke).getRegex(),_e=G(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,ke).getRegex(),Ee=G("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,ke).getRegex(),Ce=G("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,ke).getRegex(),Se=G(/\\([punct])/,"gu").replace(/punct/g,ke).getRegex(),Le=G(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ae=G(fe).replace("(?:--\x3e|$)","--\x3e").getRegex(),Te=G("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ae).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Re=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ne=G(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Re).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Pe=G(/^!?\[(label)\]\[(ref)\]/).replace("label",Re).replace("ref",le).getRegex(),je=G(/^!?\[(ref)\](?:\[\])?/).replace("ref",le).getRegex(),De={_backpedal:ee,anyPunctuation:Se,autolink:Le,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:xe,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:ee,emStrongLDelim:_e,emStrongRDelimAst:Ee,emStrongRDelimUnd:Ce,escape:ve,link:Ne,nolink:je,punctuation:$e,reflink:Pe,reflinkSearch:G("reflink|nolink(?!\\()","g").replace("reflink",Pe).replace("nolink",je).getRegex(),tag:Te,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:ee},Oe={...De,link:G(/^!?\[(label)\]\((.*?)\)/).replace("label",Re).getRegex(),reflink:G(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Re).getRegex()},ze={...De,escape:G(ve).replace("])","~|])").getRegex(),url:G(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ie={...ze,br:G(xe).replace("{2,}","*").getRegex(),text:G(ze.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qe={normal:ge,gfm:ye,pedantic:we},Me={normal:De,gfm:ze,breaks:Ie,pedantic:Oe};class Fe{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||M,this.options.tokenizer=this.options.tokenizer||new oe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:qe.normal,inline:Me.normal};this.options.pedantic?(t.block=qe.pedantic,t.inline=Me.pedantic):this.options.gfm&&(t.block=qe.gfm,this.options.breaks?t.inline=Me.breaks:t.inline=Me.gfm),this.tokenizer.rules=t}static get rules(){return{block:qe,inline:Me}}static lex(e,t){return new Fe(t).lex(e)}static lexInline(e,t){return new Fe(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){let n,r,o,s;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],s&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),s=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,s,i,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(c));)c=c.slice(0,s.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class Be{options;constructor(e){this.options=e||M}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+K(r)+'">'+(n?e:K(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:K(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const r=J(e);if(null===r)return n;let o='<a href="'+(e=r)+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>",o}image(e,t,n){const r=J(e);if(null===r)return n;let o=`<img src="${e=r}" alt="${n}"`;return t&&(o+=` title="${t}"`),o+=">",o}text(e){return e}}class He{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class We{options;renderer;textRenderer;constructor(e){this.options=e||M,this.options.renderer=this.options.renderer||new Be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new He}static parse(e,t){return new We(t).parse(e)}static parseInline(e,t){return new We(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const e=o,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(o.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=o;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,X(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=o;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=o;let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let s="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];r="";for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});s+=this.renderer.tablerow(r)}n+=this.renderer.table(t,s);continue}case"blockquote":{const e=o,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=o,t=e.ordered,r=e.start,s=e.loose;let i="";for(let t=0;t<e.items.length;t++){const n=e.items[t],r=n.checked,o=n.task;let a="";if(n.task){const e=this.renderer.checkbox(!!r);s?n.tokens.length>0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(n.tokens,s),i+=this.renderer.listitem(a,o,!!r)}n+=this.renderer.list(i,t,r);continue}case"html":{const e=o;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=o;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let s=o,i=s.tokens?this.parseInline(s.tokens):s.text;for(;r+1<e.length&&"text"===e[r+1].type;)s=e[++r],i+="\n"+(s.tokens?this.parseInline(s.tokens):s.text);n+=t?this.renderer.paragraph(i):i;continue}default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const e=this.options.extensions.renderers[o.type].call({parser:this},o);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=e||"";continue}}switch(o.type){case"escape":{const e=o;n+=t.text(e.text);break}case"html":{const e=o;n+=t.html(e.text);break}case"link":{const e=o;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=o;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=o;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=o;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=o;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=o;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=o;n+=t.text(e.text);break}default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class Ue{options;constructor(e){this.options=e||M}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}const Ze=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(Fe.lex,We.parse);parseInline=this.#e(Fe.lexInline,We.parseInline);Parser=We;Renderer=Be;TextRenderer=He;Lexer=Fe;Tokenizer=oe;Hooks=Ue;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{const o=e[r].flat(1/0);n=n.concat(this.walkTokens(o,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new Be(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const r=n,o=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new oe(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,o=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new Ue;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,o=e.hooks[r],s=t[r];Ue.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(o.call(t,e)).then((e=>s.call(t,e)));const n=o.call(t,e);return s.call(t,n)}:t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Fe.lex(e,t??this.defaults)}parser(e,t){return We.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const o={...r},s={...this.defaults,...o};!0===this.defaults.async&&!1===o.async&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const i=this.#t(!!s.silent,!!s.async);if(null==n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then((t=>e(t,s))).then((e=>s.hooks?s.hooks.processAllTokens(e):e)).then((e=>s.walkTokens?Promise.all(this.walkTokens(e,s.walkTokens)).then((()=>e)):e)).then((e=>t(e,s))).then((e=>s.hooks?s.hooks.postprocess(e):e)).catch(i);try{s.hooks&&(n=s.hooks.preprocess(n));let r=e(n,s);s.hooks&&(r=s.hooks.processAllTokens(r)),s.walkTokens&&this.walkTokens(r,s.walkTokens);let o=t(r,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(e){return i(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+K(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Ve(e,t){return Ze.parse(e,t)}Ve.options=Ve.setOptions=function(e){return Ze.setOptions(e),Ve.defaults=Ze.defaults,F(Ve.defaults),Ve},Ve.getDefaults=q,Ve.defaults=M,Ve.use=function(...e){return Ze.use(...e),Ve.defaults=Ze.defaults,F(Ve.defaults),Ve},Ve.walkTokens=function(e,t){return Ze.walkTokens(e,t)},Ve.parseInline=Ze.parseInline,Ve.Parser=We,Ve.parser=We.parse,Ve.Renderer=Be,Ve.TextRenderer=He,Ve.Lexer=Fe,Ve.lexer=Fe.lex,Ve.Tokenizer=oe,Ve.Hooks=Ue,Ve.parse=Ve,Ve.options,Ve.setOptions,Ve.use,Ve.walkTokens,Ve.parseInline,We.parse,Fe.lex;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ye,Xe={exports:{}};Ye=Xe,function(e,t){Ye.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function s(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(t[0],(function(n,r){var o,s,a=(o=t[1],s=arguments,o.replace(/\$(\d{1,2})/g,(function(e,t){return s[t]||""})));return i(""===n?e[r-1]:n,a)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var s=r[o];if(s[0].test(t))return a(t,s)}return t}function l(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?i(r,o):e.hasOwnProperty(o)?i(r,e[o]):c(o,r,n)}}function u(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(o,o,n)===o}}function d(e,t,n){return(n?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=l(o,r,e),d.isPlural=u(o,r,e),d.singular=l(r,o,t),d.isSingular=u(r,o,t),d.addPluralRule=function(t,n){e.push([s(t),n])},d.addSingularRule=function(e,n){t.push([s(e),n])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},d.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),o[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return d.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return d.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return d.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eĆ©]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d}));var Qe=Ke(Xe.exports),Ge=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=s.prototype;return o.delete=function(e){return this.has(e)&&delete e[this._]},o.get=function(e){return this.has(e)?e[this._]:void 0},o.has=function(e){return r.call(e,this._)},o.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},s;function s(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(i,this)}function i(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=o.prototype;function o(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=o}(Math.random(),Object.defineProperty)}function o(e,t,n,r,o,s){for(var i=("selectedIndex"in t),a=i;r<o;){var c,l=e(n[r],1);t.insertBefore(l,s),i&&a&&l.selected&&(a=!a,c=t.selectedIndex,t.selectedIndex=c<0?r:d.call(t.querySelectorAll("option"),l)),r++}}function s(e,t){return e==t}function i(e){return e}function a(e,t,n,r,o,s,i){var a=s-o;if(a<1)return-1;for(;a<=n-t;){for(var c=t,l=o;c<n&&l<s&&i(e[c],r[l]);)c++,l++;if(l===s)return t;t=c+1}return-1}function c(e,t,n,r,o){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:o}function l(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,o=t;r<o;){var s=(r+o)/2>>>0;n<e[s]?o=s:r=1+s}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||s,d=r.node||i,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,y=0;g<m&&y<b&&u(t[g],n[y]);)g++,y++;for(;g<m&&y<b&&u(t[m-1],n[b-1]);)m--,b--;var w=g===m,v=y===b;if(w&&v)return n;if(w&&y<b)return o(d,e,n,y,b,c(d,t,g,h,f)),n;if(v&&g<m)return l(d,t,g,m),n;var x=m-g,k=b-y,$=-1;if(x<k){if(-1<($=a(n,y,b,t,g,m,u)))return o(d,e,n,y,$,d(t[g],0)),o(d,e,n,$+x,b,c(d,t,m,h,f)),n}else if(k<x&&-1<($=a(t,g,m,n,y,b,u)))return l(d,t,g,$),l(d,t,$+k,m),n;return x<2||k<2?(o(d,e,n,y,b,d(t[g],0)),l(d,t,g,m)):x==k&&function(e,t,n,r,o,s){for(;r<o&&s(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?o(d,e,n,y,b,c(d,t,m,h,f)):function(e,t,n,r,s,i,a,c,u,d,f,h,m){!function(e,t,n,r,s,i,a,c,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:s++,f++;break;case 1:d.push(r[s]),o(t,n,r,s++,s,f<c?t(i[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(i[a])?a++:l(t,i,a++,a)}}(function(e,t,n,r,o,s,i){var a,c,l,u,d,p,f=n+s,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(c=(l=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;l<s&&c<n&&i(r[o+l],e[t+c]);)l++,c++;if(l===s&&c===n)break e;d[b+a]=l}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<l&&0<c&&i(r[o+l-1],e[t+c-1]);)m[g--]=0,l--,c--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=l-c)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(c--,m[g--]=1):(l--,m[g--]=-1)}return m}(n,r,i,a,c,d,h)||function(e,t,n,r,o,s,i,a){var c=0,l=r<a?r:a,u=Array(l++),d=Array(l);d[0]=-1;for(var f=1;f<l;f++)d[f]=i;for(var h=o.slice(s,i),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(c=p(d,l,g=b+s))&&(d[c]=g,u[c]={newi:m,oldi:g,prev:u[c-1]})}for(c=--l,--i;d[c]>i;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var v=w.newi,x=w.oldi;v<n;)y[--l]=1,--n;for(;x<i;)y[--l]=-1,--i;y[--l]=0,--n,--i,w=w.prev}for(;t<=n;)y[--l]=1,--n;for(;s<=i;)y[--l]=-1,--i;return y}(n,r,s,i,a,c,u,d),e,t,n,r,a,c,f,m)}(d,e,n,y,b,k,t,g,m,x,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,y={};try{y.Map=Map}catch(u){y.Map=function(){var e=0,t=[],n=[];return{delete:function(o){var s=r(o);return s&&(t.splice(e,1),n.splice(e,1)),s},forEach:function(e,r){t.forEach((function(t,o){e.call(r,n[o],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(o,s){return n[r(o)?e:t.push(o)-1]=s,this}};function r(n){return-1<(e=t.indexOf(n))}}}var w=y.Map;function v(){return this}function x(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var $,_,E,C,S,L,A={},T={},R=[],N=T.hasOwnProperty,P=0,j={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in T||(P=R.push(e)),T[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<P;n++){var r=R[n];if(N.call(e,r))return T[r](e[r],t)}}},D=Array.isArray||(_=($={}.toString).call([]),function(e){return $.call(e)===_}),O=(E=e,C="fragment",L="content"in I(S="template")?function(e){var t=I(S);return t.innerHTML=e,t.content}:function(e){var t,n=I(C),r=I(S);return z(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=I(C),n=I("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",z(t,n.firstChild.childNodes),t}:L)(e)});function z(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function I(e){return e===C?E.createDocumentFragment():E.createElementNS("http://www.w3.org/1999/xhtml",e)}var q,M,F,B,H,W,U,Z,V,K=(M="appendChild",F="cloneNode",B="createTextNode",W=(H="importNode")in(q=e),(U=q.createDocumentFragment())[M](q[B]("g")),U[M](q[B]("")),(W?q[H](U,!0):U[F](!0)).childNodes.length<2?function e(t,n){for(var r=t[F](),o=t.childNodes||[],s=o.length,i=0;n&&i<s;i++)r[M](e(o[i],n));return r}:W?q[H]:function(e,t){return e[F](!!t)}),Y="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},X="-"+Math.random().toFixed(6)+"%",Q=!1;try{Z=e.createElement("template"),V="tabindex","content"in Z&&(Z.innerHTML="<p "+V+'="'+X+'"></p>',Z.content.childNodes[0].getAttribute(V)==X)||(X="_dt: "+X.slice(1,-1)+";",Q=!0)}catch(u){}var G="\x3c!--"+X+"--\x3e",J=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,oe=" \\f\\n\\r\\t",se="[^"+oe+"\\/>\"'=]+",ie="["+oe+"]+"+se,ae="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ce="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+se.replace("\\/","")+"))?)",le=new RegExp(ae+ie+ce+"+)(["+oe+"]*/?>)","g"),ue=new RegExp(ae+ie+ce+"*)(["+oe+"]*/>)","g"),de=new RegExp("("+ie+"\\s*=\\s*)(['\"]?)"+G+"\\2","gi");function pe(e,t,n,r){return"<"+t+n.replace(de,fe)+r}function fe(e,t,n){return t+(n||'"')+X+(n||'"')}function he(e,t,n){return re.test(t)?e:"<"+t+n+"></"+t+">"}var me=Q?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function ge(t,n,r,o){for(var s=t.childNodes,i=s.length,a=0;a<i;){var c=s[a];switch(c.nodeType){case ee:var l=o.concat(a);!function(t,n,r,o){for(var s,i=t.attributes,a=[],c=[],l=me(i,r),u=l.length,d=0;d<u;){var p=l[d++],f=p.value===X;if(f||1<(s=p.value.split(G)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=i[m]||i[m.toLowerCase()];if(f)n.push(be(g,o,m,null));else{for(var b=s.length-2;b--;)r.shift();n.push(be(g,o,m,s))}}c.push(p)}}for(var y=((d=0)<(u=c.length)&&Q&&!("ownerSVGElement"in t));d<u;){var w=c[d++];y&&(w.value=""),t.removeAttribute(w.name)}var v=t.nodeName;if(/^script$/i.test(v)){var x=e.createElement(v);for(u=i.length,d=0;d<u;)x.setAttributeNode(i[d++].cloneNode(!0));x.textContent=t.textContent,t.parentNode.replaceChild(x,t)}}(c,n,r,l),ge(c,n,r,l);break;case J:var u=c.textContent;if(u===X)r.shift(),n.push(ne.test(t.nodeName)?ye(t,o):{type:"any",node:c,path:o.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"šŸ‘»":t.removeChild(c),a--,i--}break;case te:ne.test(t.nodeName)&&Y.call(c.textContent)===G&&(r.shift(),n.push(ye(t,o)))}a++}}function be(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function ye(e,t){return{type:"text",node:e,path:t}}var we,ve=(we=new n,{get:function(e){return we.get(e)},set:function(e,t){return we.set(e,t),t}});function xe(e,t){var n=(e.convert||function(e){return e.join(G).replace(ue,he).replace(le,pe)})(t),r=e.transform;r&&(n=r(n));var o=O(n,e.type);$e(o);var s=[];return ge(o,s,t.slice(0),[]),{content:o,updates:function(n){for(var r=[],o=s.length,i=0,a=0;i<o;){var c=s[i++],l=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,c.path);switch(c.type){case"any":r.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var u=c.sparse,d=e.attribute(l,c.name,c.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return o+=a,function(){var e=arguments.length;if(o!==e-1)throw new Error(e-1+" values instead of "+o+"\n"+t.join("${value}"));for(var s=1,i=1;s<e;){var a=r[s-i];if(a.sparse){var c=a.values,l=c[0],u=1,d=c.length;for(i+=d-2;u<d;)l+=arguments[s++]+c[u++];a.fn(l)}else a.fn(arguments[s++])}return n}}}}var ke=[];function $e(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===Y.call(r.textContent).length&&e.removeChild(r)}}var _e,Ee,Ce=(_e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Ee=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Le(n,!0)}(e,t):Le(e.style,!1)});function Se(e,t,n){return t+"-"+n.toLowerCase()}function Le(e,t){var n,r;return function(o){var s,i,a,c;switch(typeof o){case"object":if(o){if("object"===n){if(!t&&r!==o)for(i in r)i in o||(e[i]="")}else t?e.value="":e.cssText="";for(i in s=t?{}:e,o)a="number"!=typeof(c=o[i])||_e.test(i)?c:c+"px",!t&&/^--/.test(i)?s.setProperty(i,a):s[i]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Ee,Se),":",e[t],";");return n.join("")}(r=s):r=o;break}default:r!=o&&(n="string",r=o,t?e.value=o||"":e.cssText=o||"")}}}var Ae,Te,Re=(Ae=[].slice,(Te=Ne.prototype).ELEMENT_NODE=1,Te.nodeType=111,Te.remove=function(e){var t,n=this.childNodes,r=this.firstChild,o=this.lastChild;return this._=null,e&&2===n.length?o.parentNode.removeChild(o):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(o),t.deleteContents()),r},Te.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,o=0,s=r.length;o<s;o++)t.appendChild(r[o]);return t},Ne);function Ne(e){var t=this.childNodes=Ae.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Pe(e){return{html:e}}function je(e,t){switch(e.nodeType){case We:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case He:return je(e.render(),t);default:return e}}function De(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(Pe).then(t):Promise.resolve(j.invoke(e,t)).then(t)}function Oe(e){return null!=e&&"then"in e}var ze,Ie,qe,Me,Fe,Be="ownerSVGElement",He=v.prototype.nodeType,We=Re.prototype.nodeType,Ue=(Ie=(ze={Event:b,WeakSet:u}).Event,qe=ze.WeakSet,Me=!0,Fe=null,function(e){return Me&&(Me=!Me,Fe=new qe,function(e){var t=new qe,n=new qe;try{new MutationObserver(i).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,o=[],s=function(e){o.push(e),clearTimeout(r),r=setTimeout((function(){i(o.splice(r=0,o.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){s({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){s({addedNodes:[e.target],removedNodes:[]})}),!0)}function i(e){for(var r,o=e.length,s=0;s<o;s++)a((r=e[s]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var o,s=new Ie(t),i=e.length,a=0;a<i;1===(o=e[a++]).nodeType&&function e(t,n,r,o,s){Fe.has(t)&&!o.has(t)&&(s.delete(t),o.add(t),t.dispatchEvent(n));for(var i=t.children||[],a=i.length,c=0;c<a;e(i[c++],n,r,o,s));}(o,s,t,n,r));}}(e.ownerDocument)),Fe.add(e),e}),Ze=/^(?:form|list)$/i,Ve=[].slice;function Ke(t){return this.type=t,function(t){var n=ke,r=$e;return function(o){var s,i,a;return n!==o&&(s=t,i=n=o,a=ve.get(i)||ve.set(i,xe(s,i)),r=a.updates(K.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ye=!(Ke.prototype={attribute:function(e,t,n){var r,o=Be in e;if("style"===t)return Ce(e,n,o);if("."===t.slice(0,1))return l=e,u=t.slice(1),o?function(e){try{l[u]=e}catch(t){l.setAttribute(u,e)}}:function(e){l[u]=e};if("?"===t.slice(0,1))return i=e,a=t.slice(1),function(e){c!==!!e&&((c=!!e)?i.setAttribute(a,""):i.removeAttribute(a))};if(/^on/.test(t)){var s=t.slice(2);return"connected"===s||"disconnected"===s?Ue(e):t.toLowerCase()in e&&(s=s.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(s,r,!1),(r=t)&&e.addEventListener(s,t,!1))}}if("data"===t||!o&&t in e&&!Ze.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in j.attributes)return function(n){var o=j.attributes[t](e,n);r!==o&&(null==(r=o)?e.removeAttribute(t):e.setAttribute(t,o))};var i,a,c,l,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:je,before:e},o=Be in e?"svg":"html",s=!1;return function i(a){switch(typeof a){case"string":case"number":case"boolean":s?n!==a&&(n=a,t[0].textContent=a):(s=!0,n=a,t=h(e.parentNode,t,[(c=a,e.ownerDocument.createTextNode(c))],r));break;case"function":i(a(e));break;case"object":case"undefined":if(null==a){s=!1,t=h(e.parentNode,t,[],r);break}default:if(s=!1,D(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":i({html:a});break;case"object":if(D(a[0])&&(a=a.concat.apply([],a)),Oe(a[0])){Promise.all(a).then(i);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Ve.call(a.childNodes):[a],r):Oe(a)?a.then(i):"placeholder"in a?De(a,i):"text"in a?i(String(a.text)):"any"in a?i(a.any):"html"in a?t=h(e.parentNode,t,Ve.call(O([].concat(a.html).join(""),o).childNodes),r):i("length"in a?Ve.call(a):j.invoke(a,i))}var c}},text:function(e){var t;return function n(r){var o;t!==r&&("object"==(o=typeof(t=r))&&r?Oe(r)?r.then(n):"placeholder"in r?De(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Ve.call(r).join(""):j.invoke(r,n)):"function"==o?n(r(e)):e.textContent=null==r?"":r)}}}),Xe=function(t){var r,o,s,i,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),c=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||c?(o={},s=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return o[t]||(o[t]=e)},Xe=c?s:(i=new n,function(e){return i.get(e)||(n=s(t=e),i.set(t,n),n);var t,n})):Ye=!0,Qe(t)};function Qe(e){return Ye?e:Xe(e)}function Ge(e){for(var t=arguments.length,n=[Qe(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Je=new n,et=function(e){var t,n,r;return function(){var o=Ge.apply(null,arguments);return r!==o[0]?(r=o[0],n=new Ke(e),t=nt(n.apply(n,o))):n.apply(n,o),t}},tt=function(e,t){var n=t.indexOf(":"),r=Je.get(e),o=t;return-1<n&&(o=t.slice(n+1),t=t.slice(0,n)||"html"),r||Je.set(e,r={}),r[o]||(r[o]=et(t))},nt=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Re(t):e},rt=new n;function ot(){var e=rt.get(this),t=Ge.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ke(Be in this?"svg":"html");rt.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,it,at,ct,lt=j.define,ut=Ke.prototype;function dt(e){return arguments.length<2?null==e?et("html"):"string"==typeof e?dt.wire(null,e):"raw"in e?et("html")(e):"nodeType"in e?dt.bind(e):tt(e,"html"):("raw"in e?et("html"):dt.wire).apply(null,arguments)}return dt.Component=v,dt.bind=function(e){return ot.bind(e)},dt.define=lt,dt.diff=h,(dt.hyper=dt).observe=Ue,dt.tagger=ut,dt.wire=function(e,t){return null==e?et(t||"html"):tt(e,t||"html")},dt._={WeakMap:n,WeakSet:u},st=et,it=new n,at=Object.create,ct=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,o){var s,i,a,c=t.get(e)||ct(e,t);switch(typeof o){case"object":case"function":var l=c.w||(c.w=new n);return l.get(o)||(s=l,i=o,a=new e(r),s.set(i,a),a);default:var u=c.p||(c.p=at(null));return u[o]||(u[o]=new e(r))}}(this,it.get(e)||(r=e,o=new w,it.set(r,o),o),e,null==t?"default":t);var r,o}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:x("html",st),svg:x("svg",st),state:x("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var o in r)n[o]=r[o];return!1!==t&&this.render(),this}}}),dt}(document);const Je=Ge,et=j,tt=Ve,nt=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(e=e.trim(),!e)throw new TypeError("Invalid input.");let t="",n="",r="",o=null,s=new Map,i="type",a=Array.from(e);for(let e=0;e<a.length;e++){const c=a[e];switch(i){case"type":if("/"===c){i="subtype";continue}t+=c;break;case"subtype":if(";"===c){i="param-start";continue}n+=c;break;case"param-start":if(O.test(c)||";"===c)continue;r+=c,i="param-name";break;case"param-name":if("="===c||";"===c){if("="===c){i="param-value",o=null;continue}s.set(r.toLowerCase(),null),r="";continue}r+=c;break;case"param-value":if('"'==c){i="collect-quoted-string";continue}if(";"===c){o=o.trimEnd(),i="param-start",I(s,r,o),r="";continue}o="string"==typeof o?o+c:c;break;case"collect-quoted-string":if('"'===c){I(s,r,o),i="ignore-input-until-next-param",r="",o=null;continue}if("\\"===c)continue;o="string"==typeof o?o+c:c;break;case"ignore-input-until-next-param":if(";"!==c)continue;i="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${i} `)}}r&&I(s,r,o);if(""===t.trim()||!D.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!D.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(s.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?D.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},rt=Qe,ot=/-/g,st=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),it="en"===l||l.startsWith("en-")?"en-AU":l,at=new Intl.DateTimeFormat(it,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===it?"2-digit":"numeric"}),ct=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function lt(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function ut(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function dt(e,t="long"){const n=new Intl.ListFormat(l,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:o})=>"element"===n&&t?t(o,r++,e):o))}}const pt=dt("conjunction"),ft=dt("disjunction");function ht(e,t){return pt(e,t).join("")}function mt(e){return e.trim().replace(/\s+/g," ")}function gt(e,t=l){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=function(e,t,n=l){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function bt(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){Pt(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function yt(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>Je`${e}, `));return Je`${r}${n[n.length-1]}`}function wt(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=r?n:n.toLowerCase();if(o=o.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),o?!/\.$/.test(o)&&/^[a-z]/i.test(t||o)||(o=`x${o}`):o="generatedID",t&&(o=`${t}-${o}`),e.ownerDocument.getElementById(o)){let t=0,n=`${o}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${o}-${t}`;o=n}return e.id=o,o}function vt(e){const t=new Set,n="ltNodefault"in e.dataset?"":mt(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>mt(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(mt(e))))}return[...t]}function xt(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function kt(e,t){const n=t.closest(ct);let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function $t(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function _t(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function Et(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class Ct extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function St(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{xt(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),Lt(t),t}function Lt(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...At(t)])e.remove()}function*At(e){for(;e.nextNode();)yield e.currentNode}class Tt extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class Rt extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||wt(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:s,title:i,details:a}=this;return{message:e,name:t,plugin:r,hint:o,elements:s,title:i,details:a,stack:n}}}function Nt(e,t,n={}){const r={...n,isWarning:!1};o("error",new Rt(e,t,r))}function Pt(e,t,n={}){const r={...n,isWarning:!0};o("warn",new Rt(e,t,r))}function jt(e){return{showError:(t,n)=>Nt(t,e,n),showWarning:(t,n)=>Pt(t,e,n)}}function Dt(e){return e?`\`${e}\``:""}function Ot(e,{quotes:t}={quotes:!1}){return ft(e,t?e=>{return Dt((t=e,String(t)?`"${t}"`:""));var t}:Dt).join("")}function zt(e,...t){return It(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,s]=r.slice(1,-1).split("|");if(s){return`${e}[${o}](${new URL(s,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`})).join(""))}function It(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter((e=>e.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}const qt=new Map([["text/html","html"],["application/xml","xml"]]);function Mt(e,t=document){const n=qt.get(e);if(!n){const t=[...qt.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Ft(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Ft(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;Lt(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),ut(r);const s=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&s.appendChild(i);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=Je`<meta charset="utf-8" />`);s.appendChild(a);const c=`ReSpec ${window.respecVersion||"Developer Channel"}`,l=Je` - <meta name="generator" content="${c}" /> - `;s.appendChild(l),t.prepend(s),o("beforesave",r)}(n);let r="";if("xml"===e)r=(new XMLSerializer).serializeToString(n);else!function(e){e.querySelectorAll("style").forEach((e=>{e.innerHTML=`\n${e.innerHTML}\n`})),e.querySelectorAll("head > *").forEach((e=>{e.outerHTML=`\n${e.outerHTML}`}))}(n),n.doctype&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML;return r}n("core/exporter",{rsDocToDataURL:Mt});class Bt{constructor(){this._respecDonePromise=new Promise((e=>{s("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],s("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),s("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return Ft("html",document)}}const Ht="core/post-process";const Wt="core/pre-process";const Ut="core/base-runner";async function Zt(e){!function(){const e=new Bt;Object.defineProperty(document,"respec",{value:e})}(),o("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),s("amend-user-config",n),s("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of i)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)}))}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter((([e,t])=>!!e&&!!t)).map((([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let o;try{o=JSON.parse(r)}catch{o=r}return[n,o]})),r=Object.fromEntries(n);Object.assign(e,r),o("amend-user-config",r)}(respecConfig),performance.mark(`${Ut}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Nt("Every item in `preProcess` must be a JS function.",Wt),t})).map((async(t,n)=>{const r=jt(`${Wt}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){Nt(`Function ${t.name} threw an error during \`preProcess\`.`,Wt,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}}(respecConfig);const t=e.filter((e=>{return(t=e)&&(t.run||t.Plugin);var t}));t.forEach((e=>!e.name&&console.warn("Plugin lacks name:",e))),await async function(e,t){for(const n of e.filter((e=>e.prepare)))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise((async(r,o)=>{const s=setTimeout((()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),o(new Error(t))}),15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){o(e)}finally{clearTimeout(s),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}}))}catch(e){console.error(e)}}}(t,respecConfig),o("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter((e=>{const t="function"==typeof e;return t||Nt("Every item in `postProcess` must be a JS function.",Ht),t})).map((async(t,n)=>{const r=jt(`${Ht}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){Nt(`Function ${t.name} threw an error during \`postProcess\`.`,Ht,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),o("end-all"),ut(document),performance.mark(`${Ut}-end`),performance.measure(Ut,`${Ut}-start`,`${Ut}-end`)}var Vt=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} +window.respecVersion="35.2.0",function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=!!window.require;if(!t){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function n(e,n){t||(window.require.modules[e]=n)}const r=document.documentElement;r?.hasAttribute("lang")||(r.lang="en",r.hasAttribute("dir")||(r.dir="ltr"));const o={},s=r?.lang??"en";var i=Object.freeze({__proto__:null,l10n:o,lang:s,name:"core/l10n",run:function(e){e.l10n=o[s]||o.en}});const a=(e,t)=>t.some((t=>e instanceof t));let c,l;const u=new WeakMap,d=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return b(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){f=e(f)}function m(e){return(l||(l=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(y(this),t),b(this.request)}:function(...t){return b(e.apply(y(this),t))}}function g(e){return"function"==typeof e?m(e):(e instanceof IDBTransaction&&function(e){if(u.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)}));u.set(e,t)}(e),a(e,c||(c=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,f):e)}function b(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(b(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)}));return p.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=g(e);return t!==e&&(d.set(e,t),p.set(t,e)),t}const y=e=>p.get(e);const w=["get","getKey","getAll","getAllKeys","count"],v=["put","add","delete","clear"],x=new Map;function k(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(x.get(t))return x.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=v.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!w.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let i=s.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),o&&s.done]))[0]};return x.set(t,s),s}h((e=>({...e,get:(t,n,r)=>k(t,n)||e.get(t,n,r),has:(t,n)=>!!k(t,n)||e.has(t,n)})));const $=["continue","continuePrimaryKey","advance"],_={},E=new WeakMap,C=new WeakMap,S={get(e,t){if(!$.includes(t))return e[t];let n=_[t];return n||(n=_[t]=function(...e){E.set(this,C.get(this)[t](...e))}),n}};async function*L(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,S);for(C.set(n,t),p.set(n,y(t));t;)yield n,t=await(E.get(n)||t.continue()),E.delete(n)}function A(e,t){return t===Symbol.asyncIterator&&a(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&a(e,[IDBIndex,IDBObjectStore])}h((e=>({...e,get:(t,n,r)=>A(t,n)?L:e.get(t,n,r),has:(t,n)=>A(t,n)||e.has(t,n)})));var T=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),b(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=b(i);return r&&i.addEventListener("upgradeneeded",(e=>{r(b(i.result),e.oldVersion,e.newVersion,b(i.transaction),e)})),n&&i.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{s&&e.addEventListener("close",(()=>s())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:y,wrap:b});const R=/^[!#$%&'*+-.^`|~\w]+$/,N=/[\u000A\u000D\u0009\u0020]/u,P=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function j(e,t,n){(t&&""!==t&&!e.has(t)&&P.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function D(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let O={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function z(e){O=e}const I=/[&<>"']/,q=new RegExp(I.source,"g"),M=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,F=new RegExp(M.source,"g"),B={"&":"&","<":"<",">":">",'"':""","'":"'"},H=e=>B[e];function W(e,t){if(t){if(I.test(e))return e.replace(q,H)}else if(M.test(e))return e.replace(F,H);return e}const U=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Z(e){return e.replace(U,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const V=/(^|[^\[])\^/g;function K(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(V,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}function Y(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const X={exec:()=>null};function Q(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function G(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const s=e.charAt(r-o-1);if(s!==t||n){if(s===t||!n)break;o++}else o++}return e.slice(0,r-o)}function J(e,t,n,r){const o=t.href,s=t.title?W(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:s,text:i,tokens:r.inlineTokens(i)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:s,text:W(i)}}class ee{options;rules;lexer;constructor(e){this.options=e||O}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:G(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=G(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");e=G(e.replace(/^ *>[ \t]?/gm,""),"\n");const n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const s=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let i="",a="",c=!1;for(;e;){let n=!1;if(!(t=s.exec(e)))break;if(this.rules.block.hr.test(e))break;i=t[0],e=e.substring(i.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),l=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=r.slice(u),u+=t[1].length);let d=!1;if(!r&&/^ *$/.test(l)&&(i+=l+"\n",e=e.substring(l.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const c=e.split("\n",1)[0];if(l=c,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),o.test(l))break;if(s.test(l))break;if(t.test(l))break;if(n.test(e))break;if(l.search(/[^ ]/)>=u||!l.trim())a+="\n"+l.slice(u);else{if(d)break;if(r.search(/[^ ]/)>=4)break;if(o.test(r))break;if(s.test(r))break;if(n.test(r))break;a+="\n"+l}d||l.trim()||(d=!0),i+=c+"\n",e=e.substring(c.length+1),r=l.slice(u)}}o.loose||(c?o.loose=!0:/\n *\n *$/.test(i)&&(c=!0));let p,f=null;this.options.gfm&&(f=/^\[[ xX]\] /.exec(a),f&&(p="[ ] "!==f[0],a=a.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:i,task:!!f,checked:p,loose:!1,text:a,tokens:[]}),o.raw+=i}o.items[o.items.length-1].raw=i.trimEnd(),o.items[o.items.length-1].text=a.trimEnd(),o.raw=o.raw.trimEnd();for(let e=0;e<o.items.length;e++)if(this.lexer.state.top=!1,o.items[e].tokens=this.lexer.blockTokens(o.items[e].text,[]),!o.loose){const t=o.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));o.loose=n}if(o.loose)for(let e=0;e<o.items.length;e++)o.items[e].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=Q(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),o=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?s.align.push("right"):/^ *:-+: *$/.test(e)?s.align.push("center"):/^ *:-+ *$/.test(e)?s.align.push("left"):s.align.push(null);for(const e of n)s.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of o)s.rows.push(Q(e,s.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:W(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=G(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),J(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return J(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let o,s,i=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(s=[...o].length,r[3]||r[4]){i+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){a+=s;continue}if(i-=s,i>0)continue;s=Math.min(s,s+i+a);const t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+s);if(Math.min(n,s)%2){const e=c.slice(1,-1);return{type:"em",raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}const l=c.slice(2,-2);return{type:"strong",raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=W(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=W(t[1]),n="mailto:"+e):(e=W(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=W(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=W(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:W(t[0]),{type:"text",raw:t[0],text:e}}}}const te=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ne=/(?:[*+-]|\d{1,9}[.)])/,re=K(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ne).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),oe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,se=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ie=K(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",se).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ae=K(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ne).getRegex(),ce="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",le=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ue=K("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",le).replace("tag",ce).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),de=K(oe).replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce).getRegex(),pe={blockquote:K(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",de).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:ie,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:te,html:ue,lheading:re,list:ae,newline:/^(?: *(?:\n|$))+/,paragraph:de,table:X,text:/^[^\n]+/},fe=K("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce).getRegex(),he={...pe,table:fe,paragraph:K(oe).replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",fe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce).getRegex()},me={...pe,html:K("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",le).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:X,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:K(oe).replace("hr",te).replace("heading"," *#{1,6} *[^\n]").replace("lheading",re).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ge=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,be=/^( {2,}|\\)\n(?!\s*$)/,ye="\\p{P}\\p{S}",we=K(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,ye).getRegex(),ve=K(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,ye).getRegex(),xe=K("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,ye).getRegex(),ke=K("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,ye).getRegex(),$e=K(/\\([punct])/,"gu").replace(/punct/g,ye).getRegex(),_e=K(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ee=K(le).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ce=K("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ee).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Se=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Le=K(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Se).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ae=K(/^!?\[(label)\]\[(ref)\]/).replace("label",Se).replace("ref",se).getRegex(),Te=K(/^!?\[(ref)\](?:\[\])?/).replace("ref",se).getRegex(),Re={_backpedal:X,anyPunctuation:$e,autolink:_e,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:be,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:X,emStrongLDelim:ve,emStrongRDelimAst:xe,emStrongRDelimUnd:ke,escape:ge,link:Le,nolink:Te,punctuation:we,reflink:Ae,reflinkSearch:K("reflink|nolink(?!\\()","g").replace("reflink",Ae).replace("nolink",Te).getRegex(),tag:Ce,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:X},Ne={...Re,link:K(/^!?\[(label)\]\((.*?)\)/).replace("label",Se).getRegex(),reflink:K(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Se).getRegex()},Pe={...Re,escape:K(ge).replace("])","~|])").getRegex(),url:K(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},je={...Pe,br:K(be).replace("{2,}","*").getRegex(),text:K(Pe.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},De={normal:pe,gfm:he,pedantic:me},Oe={normal:Re,gfm:Pe,breaks:je,pedantic:Ne};class ze{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||O,this.options.tokenizer=this.options.tokenizer||new ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:De.normal,inline:Oe.normal};this.options.pedantic?(t.block=De.pedantic,t.inline=Oe.pedantic):this.options.gfm&&(t.block=De.gfm,this.options.breaks?t.inline=Oe.breaks:t.inline=Oe.gfm),this.tokenizer.rules=t}static get rules(){return{block:De,inline:Oe}}static lex(e,t){return new ze(t).lex(e)}static lexInline(e,t){return new ze(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){let n,r,o,s;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],s&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),s=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,s,i,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(c));)c=c.slice(0,s.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class Ie{options;constructor(e){this.options=e||O}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+W(r)+'">'+(n?e:W(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:W(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const r=Y(e);if(null===r)return n;let o='<a href="'+(e=r)+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>",o}image(e,t,n){const r=Y(e);if(null===r)return n;let o=`<img src="${e=r}" alt="${n}"`;return t&&(o+=` title="${t}"`),o+=">",o}text(e){return e}}class qe{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class Me{options;renderer;textRenderer;constructor(e){this.options=e||O,this.options.renderer=this.options.renderer||new Ie,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new qe}static parse(e,t){return new Me(t).parse(e)}static parseInline(e,t){return new Me(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const e=o,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(o.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=o;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,Z(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=o;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=o;let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let s="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];r="";for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});s+=this.renderer.tablerow(r)}n+=this.renderer.table(t,s);continue}case"blockquote":{const e=o,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=o,t=e.ordered,r=e.start,s=e.loose;let i="";for(let t=0;t<e.items.length;t++){const n=e.items[t],r=n.checked,o=n.task;let a="";if(n.task){const e=this.renderer.checkbox(!!r);s?n.tokens.length>0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(n.tokens,s),i+=this.renderer.listitem(a,o,!!r)}n+=this.renderer.list(i,t,r);continue}case"html":{const e=o;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=o;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let s=o,i=s.tokens?this.parseInline(s.tokens):s.text;for(;r+1<e.length&&"text"===e[r+1].type;)s=e[++r],i+="\n"+(s.tokens?this.parseInline(s.tokens):s.text);n+=t?this.renderer.paragraph(i):i;continue}default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const e=this.options.extensions.renderers[o.type].call({parser:this},o);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=e||"";continue}}switch(o.type){case"escape":{const e=o;n+=t.text(e.text);break}case"html":{const e=o;n+=t.html(e.text);break}case"link":{const e=o;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=o;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=o;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=o;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=o;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=o;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=o;n+=t.text(e.text);break}default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class Fe{options;constructor(e){this.options=e||O}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}const Be=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(ze.lex,Me.parse);parseInline=this.#e(ze.lexInline,Me.parseInline);Parser=Me;Renderer=Ie;TextRenderer=qe;Lexer=ze;Tokenizer=ee;Hooks=Fe;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{const o=e[r].flat(1/0);n=n.concat(this.walkTokens(o,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new Ie(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const r=n,o=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new ee(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,o=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new Fe;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,o=e.hooks[r],s=t[r];Fe.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(o.call(t,e)).then((e=>s.call(t,e)));const n=o.call(t,e);return s.call(t,n)}:t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ze.lex(e,t??this.defaults)}parser(e,t){return Me.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const o={...r},s={...this.defaults,...o};!0===this.defaults.async&&!1===o.async&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const i=this.#t(!!s.silent,!!s.async);if(null==n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then((t=>e(t,s))).then((e=>s.hooks?s.hooks.processAllTokens(e):e)).then((e=>s.walkTokens?Promise.all(this.walkTokens(e,s.walkTokens)).then((()=>e)):e)).then((e=>t(e,s))).then((e=>s.hooks?s.hooks.postprocess(e):e)).catch(i);try{s.hooks&&(n=s.hooks.preprocess(n));let r=e(n,s);s.hooks&&(r=s.hooks.processAllTokens(r)),s.walkTokens&&this.walkTokens(r,s.walkTokens);let o=t(r,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(e){return i(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+W(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function He(e,t){return Be.parse(e,t)}function We(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}He.options=He.setOptions=function(e){return Be.setOptions(e),He.defaults=Be.defaults,z(He.defaults),He},He.getDefaults=D,He.defaults=O,He.use=function(...e){return Be.use(...e),He.defaults=Be.defaults,z(He.defaults),He},He.walkTokens=function(e,t){return Be.walkTokens(e,t)},He.parseInline=Be.parseInline,He.Parser=Me,He.parser=Me.parse,He.Renderer=Ie,He.TextRenderer=qe,He.Lexer=ze,He.lexer=ze.lex,He.Tokenizer=ee,He.Hooks=Fe,He.parse=He,He.options,He.setOptions,He.use,He.walkTokens,He.parseInline,Me.parse,ze.lex;var Ue,Ze={exports:{}};var Ve,Ke=(Ue||(Ue=1,Ve=Ze,function(e,t){Ve.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function s(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(t[0],(function(n,r){var o,s,a=(o=t[1],s=arguments,o.replace(/\$(\d{1,2})/g,(function(e,t){return s[t]||""})));return i(""===n?e[r-1]:n,a)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var s=r[o];if(s[0].test(t))return a(t,s)}return t}function l(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?i(r,o):e.hasOwnProperty(o)?i(r,e[o]):c(o,r,n)}}function u(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(o,o,n)===o}}function d(e,t,n){return(n?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=l(o,r,e),d.isPlural=u(o,r,e),d.singular=l(r,o,t),d.isSingular=u(r,o,t),d.addPluralRule=function(t,n){e.push([s(t),n])},d.addSingularRule=function(e,n){t.push([s(e),n])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},d.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),o[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return d.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return d.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return d.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eĆ©]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d}))),Ze.exports),Ye=We(Ke),Xe=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=s.prototype;return o.delete=function(e){return this.has(e)&&delete e[this._]},o.get=function(e){return this.has(e)?e[this._]:void 0},o.has=function(e){return r.call(e,this._)},o.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},s;function s(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(i,this)}function i(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=o.prototype;function o(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=o}(Math.random(),Object.defineProperty)}function o(e,t,n,r,o,s){for(var i=("selectedIndex"in t),a=i;r<o;){var c,l=e(n[r],1);t.insertBefore(l,s),i&&a&&l.selected&&(a=!a,c=t.selectedIndex,t.selectedIndex=c<0?r:d.call(t.querySelectorAll("option"),l)),r++}}function s(e,t){return e==t}function i(e){return e}function a(e,t,n,r,o,s,i){var a=s-o;if(a<1)return-1;for(;a<=n-t;){for(var c=t,l=o;c<n&&l<s&&i(e[c],r[l]);)c++,l++;if(l===s)return t;t=c+1}return-1}function c(e,t,n,r,o){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:o}function l(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,o=t;r<o;){var s=(r+o)/2>>>0;n<e[s]?o=s:r=1+s}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||s,d=r.node||i,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,y=0;g<m&&y<b&&u(t[g],n[y]);)g++,y++;for(;g<m&&y<b&&u(t[m-1],n[b-1]);)m--,b--;var w=g===m,v=y===b;if(w&&v)return n;if(w&&y<b)return o(d,e,n,y,b,c(d,t,g,h,f)),n;if(v&&g<m)return l(d,t,g,m),n;var x=m-g,k=b-y,$=-1;if(x<k){if(-1<($=a(n,y,b,t,g,m,u)))return o(d,e,n,y,$,d(t[g],0)),o(d,e,n,$+x,b,c(d,t,m,h,f)),n}else if(k<x&&-1<($=a(t,g,m,n,y,b,u)))return l(d,t,g,$),l(d,t,$+k,m),n;return x<2||k<2?(o(d,e,n,y,b,d(t[g],0)),l(d,t,g,m)):x==k&&function(e,t,n,r,o,s){for(;r<o&&s(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?o(d,e,n,y,b,c(d,t,m,h,f)):function(e,t,n,r,s,i,a,c,u,d,f,h,m){!function(e,t,n,r,s,i,a,c,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:s++,f++;break;case 1:d.push(r[s]),o(t,n,r,s++,s,f<c?t(i[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(i[a])?a++:l(t,i,a++,a)}}(function(e,t,n,r,o,s,i){var a,c,l,u,d,p,f=n+s,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(c=(l=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;l<s&&c<n&&i(r[o+l],e[t+c]);)l++,c++;if(l===s&&c===n)break e;d[b+a]=l}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<l&&0<c&&i(r[o+l-1],e[t+c-1]);)m[g--]=0,l--,c--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=l-c)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(c--,m[g--]=1):(l--,m[g--]=-1)}return m}(n,r,i,a,c,d,h)||function(e,t,n,r,o,s,i,a){var c=0,l=r<a?r:a,u=Array(l++),d=Array(l);d[0]=-1;for(var f=1;f<l;f++)d[f]=i;for(var h=o.slice(s,i),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(c=p(d,l,g=b+s))&&(d[c]=g,u[c]={newi:m,oldi:g,prev:u[c-1]})}for(c=--l,--i;d[c]>i;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var v=w.newi,x=w.oldi;v<n;)y[--l]=1,--n;for(;x<i;)y[--l]=-1,--i;y[--l]=0,--n,--i,w=w.prev}for(;t<=n;)y[--l]=1,--n;for(;s<=i;)y[--l]=-1,--i;return y}(n,r,s,i,a,c,u,d),e,t,n,r,a,c,f,m)}(d,e,n,y,b,k,t,g,m,x,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,y={};try{y.Map=Map}catch(u){y.Map=function(){var e=0,t=[],n=[];return{delete:function(o){var s=r(o);return s&&(t.splice(e,1),n.splice(e,1)),s},forEach:function(e,r){t.forEach((function(t,o){e.call(r,n[o],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(o,s){return n[r(o)?e:t.push(o)-1]=s,this}};function r(n){return-1<(e=t.indexOf(n))}}}var w=y.Map;function v(){return this}function x(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var $,_,E,C,S,L,A={},T={},R=[],N=T.hasOwnProperty,P=0,j={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in T||(P=R.push(e)),T[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<P;n++){var r=R[n];if(N.call(e,r))return T[r](e[r],t)}}},D=Array.isArray||(_=($={}.toString).call([]),function(e){return $.call(e)===_}),O=(E=e,C="fragment",L="content"in I(S="template")?function(e){var t=I(S);return t.innerHTML=e,t.content}:function(e){var t,n=I(C),r=I(S);return z(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=I(C),n=I("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",z(t,n.firstChild.childNodes),t}:L)(e)});function z(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function I(e){return e===C?E.createDocumentFragment():E.createElementNS("http://www.w3.org/1999/xhtml",e)}var q,M,F,B,H,W,U,Z,V,K=(M="appendChild",F="cloneNode",B="createTextNode",W=(H="importNode")in(q=e),(U=q.createDocumentFragment())[M](q[B]("g")),U[M](q[B]("")),(W?q[H](U,!0):U[F](!0)).childNodes.length<2?function e(t,n){for(var r=t[F](),o=t.childNodes||[],s=o.length,i=0;n&&i<s;i++)r[M](e(o[i],n));return r}:W?q[H]:function(e,t){return e[F](!!t)}),Y="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},X="-"+Math.random().toFixed(6)+"%",Q=!1;try{Z=e.createElement("template"),V="tabindex","content"in Z&&(Z.innerHTML="<p "+V+'="'+X+'"></p>',Z.content.childNodes[0].getAttribute(V)==X)||(X="_dt: "+X.slice(1,-1)+";",Q=!0)}catch(u){}var G="\x3c!--"+X+"--\x3e",J=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,oe=" \\f\\n\\r\\t",se="[^"+oe+"\\/>\"'=]+",ie="["+oe+"]+"+se,ae="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ce="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+se.replace("\\/","")+"))?)",le=new RegExp(ae+ie+ce+"+)(["+oe+"]*/?>)","g"),ue=new RegExp(ae+ie+ce+"*)(["+oe+"]*/>)","g"),de=new RegExp("("+ie+"\\s*=\\s*)(['\"]?)"+G+"\\2","gi");function pe(e,t,n,r){return"<"+t+n.replace(de,fe)+r}function fe(e,t,n){return t+(n||'"')+X+(n||'"')}function he(e,t,n){return re.test(t)?e:"<"+t+n+"></"+t+">"}var me=Q?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function ge(t,n,r,o){for(var s=t.childNodes,i=s.length,a=0;a<i;){var c=s[a];switch(c.nodeType){case ee:var l=o.concat(a);!function(t,n,r,o){for(var s,i=t.attributes,a=[],c=[],l=me(i,r),u=l.length,d=0;d<u;){var p=l[d++],f=p.value===X;if(f||1<(s=p.value.split(G)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=i[m]||i[m.toLowerCase()];if(f)n.push(be(g,o,m,null));else{for(var b=s.length-2;b--;)r.shift();n.push(be(g,o,m,s))}}c.push(p)}}for(var y=((d=0)<(u=c.length)&&Q&&!("ownerSVGElement"in t));d<u;){var w=c[d++];y&&(w.value=""),t.removeAttribute(w.name)}var v=t.nodeName;if(/^script$/i.test(v)){var x=e.createElement(v);for(u=i.length,d=0;d<u;)x.setAttributeNode(i[d++].cloneNode(!0));x.textContent=t.textContent,t.parentNode.replaceChild(x,t)}}(c,n,r,l),ge(c,n,r,l);break;case J:var u=c.textContent;if(u===X)r.shift(),n.push(ne.test(t.nodeName)?ye(t,o):{type:"any",node:c,path:o.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"šŸ‘»":t.removeChild(c),a--,i--}break;case te:ne.test(t.nodeName)&&Y.call(c.textContent)===G&&(r.shift(),n.push(ye(t,o)))}a++}}function be(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function ye(e,t){return{type:"text",node:e,path:t}}var we,ve=(we=new n,{get:function(e){return we.get(e)},set:function(e,t){return we.set(e,t),t}});function xe(e,t){var n=(e.convert||function(e){return e.join(G).replace(ue,he).replace(le,pe)})(t),r=e.transform;r&&(n=r(n));var o=O(n,e.type);$e(o);var s=[];return ge(o,s,t.slice(0),[]),{content:o,updates:function(n){for(var r=[],o=s.length,i=0,a=0;i<o;){var c=s[i++],l=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,c.path);switch(c.type){case"any":r.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var u=c.sparse,d=e.attribute(l,c.name,c.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return o+=a,function(){var e=arguments.length;if(o!==e-1)throw new Error(e-1+" values instead of "+o+"\n"+t.join("${value}"));for(var s=1,i=1;s<e;){var a=r[s-i];if(a.sparse){var c=a.values,l=c[0],u=1,d=c.length;for(i+=d-2;u<d;)l+=arguments[s++]+c[u++];a.fn(l)}else a.fn(arguments[s++])}return n}}}}var ke=[];function $e(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===Y.call(r.textContent).length&&e.removeChild(r)}}var _e,Ee,Ce=(_e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Ee=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Le(n,!0)}(e,t):Le(e.style,!1)});function Se(e,t,n){return t+"-"+n.toLowerCase()}function Le(e,t){var n,r;return function(o){var s,i,a,c;switch(typeof o){case"object":if(o){if("object"===n){if(!t&&r!==o)for(i in r)i in o||(e[i]="")}else t?e.value="":e.cssText="";for(i in s=t?{}:e,o)a="number"!=typeof(c=o[i])||_e.test(i)?c:c+"px",!t&&/^--/.test(i)?s.setProperty(i,a):s[i]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Ee,Se),":",e[t],";");return n.join("")}(r=s):r=o;break}default:r!=o&&(n="string",r=o,t?e.value=o||"":e.cssText=o||"")}}}var Ae,Te,Re=(Ae=[].slice,(Te=Ne.prototype).ELEMENT_NODE=1,Te.nodeType=111,Te.remove=function(e){var t,n=this.childNodes,r=this.firstChild,o=this.lastChild;return this._=null,e&&2===n.length?o.parentNode.removeChild(o):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(o),t.deleteContents()),r},Te.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,o=0,s=r.length;o<s;o++)t.appendChild(r[o]);return t},Ne);function Ne(e){var t=this.childNodes=Ae.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Pe(e){return{html:e}}function je(e,t){switch(e.nodeType){case We:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case He:return je(e.render(),t);default:return e}}function De(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(Pe).then(t):Promise.resolve(j.invoke(e,t)).then(t)}function Oe(e){return null!=e&&"then"in e}var ze,Ie,qe,Me,Fe,Be="ownerSVGElement",He=v.prototype.nodeType,We=Re.prototype.nodeType,Ue=(Ie=(ze={Event:b,WeakSet:u}).Event,qe=ze.WeakSet,Me=!0,Fe=null,function(e){return Me&&(Me=!Me,Fe=new qe,function(e){var t=new qe,n=new qe;try{new MutationObserver(i).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,o=[],s=function(e){o.push(e),clearTimeout(r),r=setTimeout((function(){i(o.splice(r=0,o.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){s({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){s({addedNodes:[e.target],removedNodes:[]})}),!0)}function i(e){for(var r,o=e.length,s=0;s<o;s++)a((r=e[s]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var o,s=new Ie(t),i=e.length,a=0;a<i;1===(o=e[a++]).nodeType&&function e(t,n,r,o,s){Fe.has(t)&&!o.has(t)&&(s.delete(t),o.add(t),t.dispatchEvent(n));for(var i=t.children||[],a=i.length,c=0;c<a;e(i[c++],n,r,o,s));}(o,s,t,n,r));}}(e.ownerDocument)),Fe.add(e),e}),Ze=/^(?:form|list)$/i,Ve=[].slice;function Ke(t){return this.type=t,function(t){var n=ke,r=$e;return function(o){var s,i,a;return n!==o&&(s=t,i=n=o,a=ve.get(i)||ve.set(i,xe(s,i)),r=a.updates(K.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ye=!(Ke.prototype={attribute:function(e,t,n){var r,o=Be in e;if("style"===t)return Ce(e,n,o);if("."===t.slice(0,1))return l=e,u=t.slice(1),o?function(e){try{l[u]=e}catch(t){l.setAttribute(u,e)}}:function(e){l[u]=e};if("?"===t.slice(0,1))return i=e,a=t.slice(1),function(e){c!==!!e&&((c=!!e)?i.setAttribute(a,""):i.removeAttribute(a))};if(/^on/.test(t)){var s=t.slice(2);return"connected"===s||"disconnected"===s?Ue(e):t.toLowerCase()in e&&(s=s.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(s,r,!1),(r=t)&&e.addEventListener(s,t,!1))}}if("data"===t||!o&&t in e&&!Ze.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in j.attributes)return function(n){var o=j.attributes[t](e,n);r!==o&&(null==(r=o)?e.removeAttribute(t):e.setAttribute(t,o))};var i,a,c,l,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:je,before:e},o=Be in e?"svg":"html",s=!1;return function i(a){switch(typeof a){case"string":case"number":case"boolean":s?n!==a&&(n=a,t[0].textContent=a):(s=!0,n=a,t=h(e.parentNode,t,[(c=a,e.ownerDocument.createTextNode(c))],r));break;case"function":i(a(e));break;case"object":case"undefined":if(null==a){s=!1,t=h(e.parentNode,t,[],r);break}default:if(s=!1,D(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":i({html:a});break;case"object":if(D(a[0])&&(a=a.concat.apply([],a)),Oe(a[0])){Promise.all(a).then(i);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Ve.call(a.childNodes):[a],r):Oe(a)?a.then(i):"placeholder"in a?De(a,i):"text"in a?i(String(a.text)):"any"in a?i(a.any):"html"in a?t=h(e.parentNode,t,Ve.call(O([].concat(a.html).join(""),o).childNodes),r):i("length"in a?Ve.call(a):j.invoke(a,i))}var c}},text:function(e){var t;return function n(r){var o;t!==r&&("object"==(o=typeof(t=r))&&r?Oe(r)?r.then(n):"placeholder"in r?De(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Ve.call(r).join(""):j.invoke(r,n)):"function"==o?n(r(e)):e.textContent=null==r?"":r)}}}),Xe=function(t){var r,o,s,i,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),c=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||c?(o={},s=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return o[t]||(o[t]=e)},Xe=c?s:(i=new n,function(e){return i.get(e)||(n=s(t=e),i.set(t,n),n);var t,n})):Ye=!0,Qe(t)};function Qe(e){return Ye?e:Xe(e)}function Ge(e){for(var t=arguments.length,n=[Qe(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Je=new n,et=function(e){var t,n,r;return function(){var o=Ge.apply(null,arguments);return r!==o[0]?(r=o[0],n=new Ke(e),t=nt(n.apply(n,o))):n.apply(n,o),t}},tt=function(e,t){var n=t.indexOf(":"),r=Je.get(e),o=t;return-1<n&&(o=t.slice(n+1),t=t.slice(0,n)||"html"),r||Je.set(e,r={}),r[o]||(r[o]=et(t))},nt=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Re(t):e},rt=new n;function ot(){var e=rt.get(this),t=Ge.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ke(Be in this?"svg":"html");rt.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,it,at,ct,lt=j.define,ut=Ke.prototype;function dt(e){return arguments.length<2?null==e?et("html"):"string"==typeof e?dt.wire(null,e):"raw"in e?et("html")(e):"nodeType"in e?dt.bind(e):tt(e,"html"):("raw"in e?et("html"):dt.wire).apply(null,arguments)}return dt.Component=v,dt.bind=function(e){return ot.bind(e)},dt.define=lt,dt.diff=h,(dt.hyper=dt).observe=Ue,dt.tagger=ut,dt.wire=function(e,t){return null==e?et(t||"html"):tt(e,t||"html")},dt._={WeakMap:n,WeakSet:u},st=et,it=new n,at=Object.create,ct=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,o){var s,i,a,c=t.get(e)||ct(e,t);switch(typeof o){case"object":case"function":var l=c.w||(c.w=new n);return l.get(o)||(s=l,i=o,a=new e(r),s.set(i,a),a);default:var u=c.p||(c.p=at(null));return u[o]||(u[o]=new e(r))}}(this,it.get(e)||(r=e,o=new w,it.set(r,o),o),e,null==t?"default":t);var r,o}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:x("html",st),svg:x("svg",st),state:x("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var o in r)n[o]=r[o];return!1!==t&&this.render(),this}}}),dt}(document);const Qe=Xe,Ge=T,Je=He,et=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(e=e.trim(),!e)throw new TypeError("Invalid input.");let t="",n="",r="",o=null,s=new Map,i="type",a=Array.from(e);for(let e=0;e<a.length;e++){const c=a[e];switch(i){case"type":if("/"===c){i="subtype";continue}t+=c;break;case"subtype":if(";"===c){i="param-start";continue}n+=c;break;case"param-start":if(N.test(c)||";"===c)continue;r+=c,i="param-name";break;case"param-name":if("="===c||";"===c){if("="===c){i="param-value",o=null;continue}s.set(r.toLowerCase(),null),r="";continue}r+=c;break;case"param-value":if('"'==c){i="collect-quoted-string";continue}if(";"===c){o=o.trimEnd(),i="param-start",j(s,r,o),r="";continue}o="string"==typeof o?o+c:c;break;case"collect-quoted-string":if('"'===c){j(s,r,o),i="ignore-input-until-next-param",r="",o=null;continue}if("\\"===c)continue;o="string"==typeof o?o+c:c;break;case"ignore-input-until-next-param":if(";"!==c)continue;i="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${i} `)}}r&&j(s,r,o);if(""===t.trim()||!R.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!R.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(s.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?R.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},tt=Ye,nt=/-/g,rt=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),ot="en"===s||s.startsWith("en-")?"en-AU":s,st=new Intl.DateTimeFormat(ot,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===ot?"2-digit":"numeric"}),it=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function at(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function ct(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function lt(e,t="long"){const n=new Intl.ListFormat(s,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:o})=>"element"===n&&t?t(o,r++,e):o))}}const ut=lt("conjunction"),dt=lt("disjunction");function pt(e,t){return ut(e,t).join("")}function ft(e){return e.trim().replace(/\s+/g," ")}function ht(e,t=s){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=function(e,t,n=s){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function mt(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){Rt(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace.",cause:e})}}}return e}function gt(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>Qe`${e}, `));return Qe`${r}${n[n.length-1]}`}function bt(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=r?n:n.toLowerCase();if(o=o.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),o?!/\.$/.test(o)&&/^[a-z]/i.test(t||o)||(o=`x${o}`):o="generatedID",t&&(o=`${t}-${o}`),e.ownerDocument.getElementById(o)){let t=0,n=`${o}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${o}-${t}`;o=n}return e.id=o,o}function yt(e){const t=new Set,n="ltNodefault"in e.dataset?"":ft(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>ft(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(ft(e))))}return[...t]}function wt(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function vt(e,t){const n=t.closest(it);let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function xt(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function kt(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function $t(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class _t extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function Et(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{wt(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),Ct(t),t}function Ct(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...St(t)])e.remove()}function*St(e){for(;e.nextNode();)yield e.currentNode}class Lt extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class At extends Error{constructor(e,t,n){super(e,{...n.cause&&{cause:n.cause}});const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||bt(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:s,title:i,details:a}=this;return{message:e,name:t,plugin:r,hint:o,elements:s,title:i,details:a,stack:n,...this.cause instanceof Error&&{cause:{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}}}}}function Tt(e,t,n={}){const r={...n,isWarning:!1};It("error",new At(e,t,r))}function Rt(e,t,n={}){const r={...n,isWarning:!0};It("warn",new At(e,t,r))}function Nt(e){return{showError:(t,n)=>Tt(t,e,n),showWarning:(t,n)=>Rt(t,e,n)}}function Pt(e){return e?`\`${e}\``:""}function jt(e,{quotes:t}={quotes:!1}){return dt(e,t?e=>{return Pt((t=e,String(t)?`"${t}"`:""));var t}:Pt).join("")}function Dt(e,...t){return Ot(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,s]=r.slice(1,-1).split("|");if(s){return`${e}[${o}](${new URL(s,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`})).join(""))}function Ot(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter((e=>e.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}const zt=new EventTarget;function It(e,t){if(zt.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const n=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function qt(e,t,n={once:!1}){zt.addEventListener(e,(async n=>{try{await t(n.detail)}catch(t){Tt(`Error in handler for topic "${e}": ${t.message}`,`sub:${e}`,{cause:t})}}),n)}n("core/pubsubhub",{sub:qt});const Mt=["githubToken","githubUser"];const Ft=new Map([["text/html","html"],["application/xml","xml"]]);function Bt(e,t=document){const n=Ft.get(e);if(!n){const t=[...Ft.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Ht(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Ht(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;Ct(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),ct(r);const o=e.createDocumentFragment(),s=e.querySelector("meta[name='viewport']");s&&t.firstChild!==s&&o.appendChild(s);let i=e.querySelector("meta[charset], meta[content*='charset=']");i||(i=Qe`<meta charset="utf-8" />`);o.appendChild(i);const a=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=Qe` + <meta name="generator" content="${a}" /> + `;o.appendChild(c),t.prepend(o),It("beforesave",r)}(n);let r="";if("xml"===e)r=(new XMLSerializer).serializeToString(n);else!function(e){e.querySelectorAll("style").forEach((e=>{e.innerHTML=`\n${e.innerHTML}\n`})),e.querySelectorAll("head > *").forEach((e=>{e.outerHTML=`\n${e.outerHTML}`}))}(n),n.doctype&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML;return r}n("core/exporter",{rsDocToDataURL:Bt});class Wt{constructor(){this._respecDonePromise=new Promise((e=>{qt("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],qt("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),qt("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return Ht("html",document)}}const Ut="core/post-process";const Zt="core/pre-process";const Vt="core/base-runner";async function Kt(e){!function(){const e=new Wt;Object.defineProperty(document,"respec",{value:e})}(),It("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),qt("amend-user-config",n),qt("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of Mt)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)}))}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter((([e,t])=>!!e&&!!t)).map((([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let o;try{o=JSON.parse(r)}catch{o=r}return[n,o]})),r=Object.fromEntries(n);Object.assign(e,r),It("amend-user-config",r)}(respecConfig),performance.mark(`${Vt}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Tt("Every item in `preProcess` must be a JS function.",Zt),t})).map((async(t,n)=>{const r=Nt(`${Zt}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){Tt(`Function ${t.name} threw an error during \`preProcess\`.`,Zt,{hint:"See developer console.",cause:e})}}));await Promise.all(t)}}(respecConfig);const t=e.filter((e=>{return(t=e)&&(t.run||t.Plugin);var t}));t.forEach((e=>!e.name&&console.warn("Plugin lacks name:",e))),await async function(e,t){for(const n of e.filter((e=>e.prepare)))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise((async(r,o)=>{const s=setTimeout((()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),o(new Error(t))}),15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){o(e)}finally{clearTimeout(s),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}}))}catch(e){console.error(e)}}}(t,respecConfig),It("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter((e=>{const t="function"==typeof e;return t||Tt("Every item in `postProcess` must be a JS function.",Ut),t})).map((async(t,n)=>{const r=Nt(`${Ut}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){Tt(`Function ${t.name} threw an error during \`postProcess\`.`,Ut,{hint:"See developer console.",cause:e})}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),It("end-all"),ct(document),performance.mark(`${Vt}-end`),performance.measure(Vt,`${Vt}-start`,`${Vt}-end`)}var Yt=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} #respec-ui{position:fixed;display:flex;flex-direction:row-reverse;top:20px;right:20px;width:202px;text-align:right;z-index:9000} #respec-pill,.respec-info-button{height:2.4em;background:#fff;background:var(--bg,#fff);color:#787878;color:var(--tocnav-normal-text,#787878);border:1px solid #ccc;box-shadow:1px 1px 8px 0 rgba(100,100,100,.5);box-shadow:1px 1px 8px 0 var(--tocsidebar-shadow,rgba(100,100,100,.5));padding:.2em 0} .respec-info-button{border:none;opacity:.75;border-radius:2em;margin-right:1em;min-width:3.5em;will-change:opacity} @@ -64,37 +64,37 @@ to{margin-top:0;border:1px solid #ccc;border-radius:0;box-shadow:1px 1px 8px 0 r .respec-iframe:not(.ready){background:url(https://respec.org/xref/loader.gif) no-repeat center} .respec-iframe+a[href]{font-size:.9rem;float:right;margin:0 .5em .5em;border-bottom-width:1px} p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} -.respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const Kt=/>/gm,Yt=/&/gm;class Xt extends tt.Renderer{code(e,t,n){const{language:r,...o}=Xt.parseInfoString(t);if(/(^webidl$)/i.test(r))return`<pre class="idl">${e}</pre>`;const s=super.code(e,r,n).replace('class="language-','class="'),{example:i,illegalExample:a}=o;if(!i&&!a)return s;const c=i||a,l=`${r} ${i?"example":"illegal-example"}`;return s.replace("<pre>",`<pre title="${c}" class="${l}">`)}image(e,t,n){if(!t)return super.image(e,t,n);return String.raw` +.respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const Xt=/>/gm,Qt=/&/gm;class Gt extends Je.Renderer{code(e,t,n){const{language:r,...o}=Gt.parseInfoString(t);if(/(^webidl$)/i.test(r))return`<pre class="idl">${e}</pre>`;const s=super.code(e,r,n).replace('class="language-','class="'),{example:i,illegalExample:a}=o;if(!i&&!a)return s;const c=i||a,l=`${r} ${i?"example":"illegal-example"}`;return s.replace("<pre>",`<pre title="${c}" class="${l}">`)}image(e,t,n){if(!t)return super.image(e,t,n);return String.raw` <figure> <img src="${e}" alt="${n}" /> <figcaption>${t}</figcaption> </figure> - `}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let o;if(r)try{o=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...o}}heading(e,t,n){const r=/(.+)\s+{#([\w-]+)}$/;if(r.test(e)){const[,n,o]=e.match(r);return`<h${t} id="${o}">${n}</h${t}>`}return super.heading(e,t,n)}}const Qt={gfm:!0,renderer:new Xt};function Gt(e,t={inline:!1}){const n=It(e).replace(Kt,">").replace(Yt,"&");return t.inline?tt.parseInline(n,Qt):tt.parse(n,Qt)}function Jt(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=Gt(e.innerHTML)}const en=(tn="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(tn);return t.forEach(Jt),Array.from(t)});var tn;var nn=Object.freeze({__proto__:null,markdownToHtml:Gt,name:"core/markdown",run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void en(document.body);const r=document.getElementById("respec-ui");r.remove();const o=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),o=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),o.trim()){const t=Et(e);e.append(`\n\n${t}`)}}}(o,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),Jt(o),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(o.querySelectorAll(".nolinks a[href]")),o.append(r),document.body.replaceWith(o)}});function rn(e,t){e&&Array.from(t).forEach((([t,n])=>{e.setAttribute(`aria-${t}`,n)}))}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=Vt,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const on=Je`<div id="respec-ui" class="removeOnSave" hidden></div>`,sn=Je`<ul + `}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let o;if(r)try{o=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...o}}heading(e,t,n){const r=/(.+)\s+{#([\w-]+)}$/;if(r.test(e)){const[,n,o]=e.match(r);return`<h${t} id="${o}">${n}</h${t}>`}return super.heading(e,t,n)}}const Jt={gfm:!0,renderer:new Gt};function en(e,t={inline:!1}){const n=Ot(e).replace(Xt,">").replace(Qt,"&");return t.inline?Je.parseInline(n,Jt):Je.parse(n,Jt)}function tn(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=en(e.innerHTML)}const nn=(rn="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(rn);return t.forEach(tn),Array.from(t)});var rn;var on=Object.freeze({__proto__:null,markdownToHtml:en,name:"core/markdown",run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void nn(document.body);const r=document.getElementById("respec-ui");r.remove();const o=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),o=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),o.trim()){const t=$t(e);e.append(`\n\n${t}`)}}}(o,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),tn(o),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(o.querySelectorAll(".nolinks a[href]")),o.append(r),document.body.replaceWith(o)}});function sn(e,t){e&&Array.from(t).forEach((([t,n])=>{e.setAttribute(`aria-${t}`,n)}))}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=Yt,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const an=Qe`<div id="respec-ui" class="removeOnSave" hidden></div>`,cn=Qe`<ul id="respec-menu" role="menu" aria-labelledby="respec-pill" hidden -></ul>`,an=Je`<button +></ul>`,ln=Qe`<button class="close-button" - onclick=${()=>yn.closeModal()} + onclick=${()=>vn.closeModal()} title="Close" > āŒ -</button>`;let cn,ln;window.addEventListener("load",(()=>mn(sn)));const un=[],dn=[],pn={};s("start-all",(()=>document.body.prepend(on)),{once:!0}),s("end-all",(()=>document.body.prepend(on)),{once:!0});const fn=Je`<button id="respec-pill" disabled>ReSpec</button>`;function hn(){sn.classList.toggle("respec-hidden"),sn.classList.toggle("respec-visible"),sn.hidden=!sn.hidden}function mn(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",(e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))}))}on.appendChild(fn),fn.addEventListener("click",(e=>{e.stopPropagation(),fn.setAttribute("aria-expanded",String(sn.hidden)),hn(),sn.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{sn.hidden||hn()})),on.appendChild(sn),sn.addEventListener("keydown",(e=>{"Escape"!==e.key||sn.hidden||(fn.setAttribute("aria-expanded",String(sn.hidden)),hn(),fn.focus())}));const gn=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function bn(e,t,n,r){t.push(e),pn.hasOwnProperty(n)||(pn[n]=function(e,t,n){const r=`respec-pill-${e}`,o=Je`<button +</button>`;let un,dn;window.addEventListener("load",(()=>bn(cn)));const pn=[],fn=[],hn={};qt("start-all",(()=>document.body.prepend(an)),{once:!0}),qt("end-all",(()=>document.body.prepend(an)),{once:!0});const mn=Qe`<button id="respec-pill" disabled>ReSpec</button>`;function gn(){cn.classList.toggle("respec-hidden"),cn.classList.toggle("respec-visible"),cn.hidden=!cn.hidden}function bn(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",(e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))}))}an.appendChild(mn),mn.addEventListener("click",(e=>{e.stopPropagation(),mn.setAttribute("aria-expanded",String(cn.hidden)),gn(),cn.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{cn.hidden||gn()})),an.appendChild(cn),cn.addEventListener("keydown",(e=>{"Escape"!==e.key||cn.hidden||(mn.setAttribute("aria-expanded",String(cn.hidden)),gn(),mn.focus())}));const yn=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function wn(e,t,n,r){t.push(e),hn.hasOwnProperty(n)||(hn[n]=function(e,t,n){const r=`respec-pill-${e}`,o=Qe`<button id="${r}" class="respec-info-button" - ></button>`;o.addEventListener("click",(()=>{o.setAttribute("aria-expanded","true");const r=Je`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(wn(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),r.appendChild(n)}yn.freshModal(n,r,o)}));const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return rn(o,s),o}(n,t,r),on.appendChild(pn[n]));const o=pn[n];o.textContent=t.length;const s=1===t.length?rt.singular(r):r;rn(o,new Map([["label",`${t.length} ${s}`]]))}rn(fn,gn);const yn={show(){try{on.hidden=!1}catch(e){console.error(e)}},hide(){on.hidden=!0},enable(){fn.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,s=Je`<button id="${o}" class="respec-option"> + ></button>`;o.addEventListener("click",(()=>{o.setAttribute("aria-expanded","true");const r=Qe`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(xn(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),r.appendChild(n)}vn.freshModal(n,r,o)}));const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return sn(o,s),o}(n,t,r),an.appendChild(hn[n]));const o=hn[n];o.textContent=t.length;const s=1===t.length?tt.singular(r):r;sn(o,new Map([["label",`${t.length} ${s}`]]))}sn(mn,yn);const vn={show(){try{an.hidden=!1}catch(e){console.error(e)}},hide(){an.hidden=!0},enable(){mn.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,s=Qe`<button id="${o}" class="respec-option"> <span class="respec-cmd-icon" aria-hidden="true">${r}</span> ${e}ā€¦ - </button>`,i=Je`<li role="menuitem">${s}</li>`;return i.addEventListener("click",t),sn.appendChild(i),s},error(e){bn(e,un,"error","ReSpec Errors")},warning(e){bn(e,dn,"warning","ReSpec Warnings")},closeModal(e){ln&&(ln.classList.remove("respec-show-overlay"),ln.classList.add("respec-hide-overlay"),ln.addEventListener("transitionend",(()=>{ln.remove(),ln=null}))),e&&e.setAttribute("aria-expanded","false"),cn&&(cn.remove(),cn=null,fn.focus())},freshModal(e,t,n){cn&&cn.remove(),ln&&ln.remove(),ln=Je`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,o=`${r}-heading`;cn=Je`<div + </button>`,i=Qe`<li role="menuitem">${s}</li>`;return i.addEventListener("click",t),cn.appendChild(i),s},error(e){wn(e,pn,"error","ReSpec Errors")},warning(e){wn(e,fn,"warning","ReSpec Warnings")},closeModal(e){dn&&(dn.classList.remove("respec-show-overlay"),dn.classList.add("respec-hide-overlay"),dn.addEventListener("transitionend",(()=>{dn.remove(),dn=null}))),e&&e.setAttribute("aria-expanded","false"),un&&(un.remove(),un=null,mn.focus())},freshModal(e,t,n){un&&un.remove(),dn&&dn.remove(),dn=Qe`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,o=`${r}-heading`;un=Qe`<div id="${r}" class="respec-modal removeOnSave" role="dialog" aria-labelledby="${o}" > - ${an} + ${ln} <h3 id="${o}">${e}</h3> <div class="inside">${t}</div> - </div>`;const s=new Map([["labelledby",o]]);rn(cn,s),document.body.append(ln,cn),ln.addEventListener("click",(()=>this.closeModal(n))),ln.classList.toggle("respec-show-overlay"),cn.hidden=!1,mn(cn)}};function wn(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${Gt(`<p class="respec-hint"><strong>How to fix:</strong> ${It(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred <strong>${e.elements.length}</strong> times at:</p>\n ${Gt(e.elements.map(vn).join("\n"))}`:"",o=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";var s;return`${Gt(`**${s=e.message,s.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/</g,"<")}**`,{inline:!0})}${n}${r}${o}${t}`}function vn(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function xn(e){try{yn.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await Zt(e)}finally{yn.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&yn.closeModal()})),window.respecUI=yn,s("error",(e=>yn.error(e))),s("warn",(e=>yn.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const kn=[Promise.resolve().then((function(){return $n})),Promise.resolve().then((function(){return u})),Promise.resolve().then((function(){return Sn})),Promise.resolve().then((function(){return Tn})),Promise.resolve().then((function(){return Pn})),Promise.resolve().then((function(){return Fn})),Promise.resolve().then((function(){return nn})),Promise.resolve().then((function(){return Bn})),Promise.resolve().then((function(){return Un})),Promise.resolve().then((function(){return cr})),Promise.resolve().then((function(){return dr})),Promise.resolve().then((function(){return pr})),Promise.resolve().then((function(){return mr})),Promise.resolve().then((function(){return Eo})),Promise.resolve().then((function(){return Ao})),Promise.resolve().then((function(){return qo})),Promise.resolve().then((function(){return Mo})),Promise.resolve().then((function(){return Wo})),Promise.resolve().then((function(){return Yo})),Promise.resolve().then((function(){return es})),Promise.resolve().then((function(){return rs})),Promise.resolve().then((function(){return Ur})),Promise.resolve().then((function(){return $s})),Promise.resolve().then((function(){return fs})),Promise.resolve().then((function(){return no})),Promise.resolve().then((function(){return Es})),Promise.resolve().then((function(){return zn})),Promise.resolve().then((function(){return Cs})),Promise.resolve().then((function(){return js})),Promise.resolve().then((function(){return Os})),Promise.resolve().then((function(){return Is})),Promise.resolve().then((function(){return Hs})),Promise.resolve().then((function(){return Ys})),Promise.resolve().then((function(){return Xs})),Promise.resolve().then((function(){return ri})),Promise.resolve().then((function(){return ci})),Promise.resolve().then((function(){return hi})),Promise.resolve().then((function(){return gi})),Promise.resolve().then((function(){return yi})),Promise.resolve().then((function(){return Ci})),Promise.resolve().then((function(){return Ai})),Promise.resolve().then((function(){return Di})),Promise.resolve().then((function(){return Oi})),Promise.resolve().then((function(){return qi})),Promise.resolve().then((function(){return Hi})),Promise.resolve().then((function(){return Vi})),Promise.resolve().then((function(){return Xi})),Promise.resolve().then((function(){return Ji})),Promise.resolve().then((function(){return na})),Promise.resolve().then((function(){return sa}))];Promise.all(kn).then((e=>xn(e))).catch((e=>console.error(e)));var $n=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){window.location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(window.location.hash).slice(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}window.location.hash=`#${e}`}))}});const _n={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},En=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["cc-by-sa",{name:"Creative Commons Attribution-ShareAlike 4.0 International Public License",short:"CC-BY-SA",url:"https://creativecommons.org/licenses/by-sa/4.0/legalcode"}]]),Cn={format:"markdown",isED:!1,isNoTrack:!0,isPR:!1,lint:{"privsec-section":!0,"wpt-tests-exist":!1},logos:[],prependW3C:!1,doJsonLd:!1,license:"cc-by",shortName:"X",showPreviousVersion:!1};var Sn=Object.freeze({__proto__:null,name:"dini/defaults",run:function(e){const t=!1!==e.lint&&{..._n.lint,...Cn.lint,...e.lint};Object.assign(e,{..._n,...Cn,...e,lint:t}),Object.assign(e,function(e){return{licenseInfo:En.get(e.license)}}(e))}});var Ln=String.raw`@keyframes pop{ + </div>`;const s=new Map([["labelledby",o]]);sn(un,s),document.body.append(dn,un),dn.addEventListener("click",(()=>this.closeModal(n))),dn.classList.toggle("respec-show-overlay"),un.hidden=!1,bn(un)}};function xn(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${en(`<p class="respec-hint"><strong>How to fix:</strong> ${Ot(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred <strong>${e.elements.length}</strong> times at:</p>\n ${en(e.elements.map(kn).join("\n"))}`:"",o=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";var s;return`${en(`**${s=e.message,s.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/</g,"<")}**`,{inline:!0})}${n}${r}${o}${t}`}function kn(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function $n(e){try{vn.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await Kt(e)}finally{vn.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&vn.closeModal()})),window.respecUI=vn,qt("error",(e=>vn.error(e))),qt("warn",(e=>vn.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const _n=[Promise.resolve().then((function(){return En})),Promise.resolve().then((function(){return i})),Promise.resolve().then((function(){return An})),Promise.resolve().then((function(){return Nn})),Promise.resolve().then((function(){return Dn})),Promise.resolve().then((function(){return Hn})),Promise.resolve().then((function(){return on})),Promise.resolve().then((function(){return Wn})),Promise.resolve().then((function(){return Vn})),Promise.resolve().then((function(){return ur})),Promise.resolve().then((function(){return fr})),Promise.resolve().then((function(){return hr})),Promise.resolve().then((function(){return br})),Promise.resolve().then((function(){return So})),Promise.resolve().then((function(){return Ro})),Promise.resolve().then((function(){return Fo})),Promise.resolve().then((function(){return Bo})),Promise.resolve().then((function(){return Zo})),Promise.resolve().then((function(){return Qo})),Promise.resolve().then((function(){return ns})),Promise.resolve().then((function(){return ss})),Promise.resolve().then((function(){return Vr})),Promise.resolve().then((function(){return Es})),Promise.resolve().then((function(){return ms})),Promise.resolve().then((function(){return oo})),Promise.resolve().then((function(){return Ss})),Promise.resolve().then((function(){return qn})),Promise.resolve().then((function(){return Ls})),Promise.resolve().then((function(){return Os})),Promise.resolve().then((function(){return Is})),Promise.resolve().then((function(){return Ms})),Promise.resolve().then((function(){return Us})),Promise.resolve().then((function(){return Qs})),Promise.resolve().then((function(){return Gs})),Promise.resolve().then((function(){return si})),Promise.resolve().then((function(){return ui})),Promise.resolve().then((function(){return gi})),Promise.resolve().then((function(){return yi})),Promise.resolve().then((function(){return vi})),Promise.resolve().then((function(){return Li})),Promise.resolve().then((function(){return Ri})),Promise.resolve().then((function(){return zi})),Promise.resolve().then((function(){return Ii})),Promise.resolve().then((function(){return Fi})),Promise.resolve().then((function(){return Ui})),Promise.resolve().then((function(){return Yi})),Promise.resolve().then((function(){return Gi})),Promise.resolve().then((function(){return ta})),Promise.resolve().then((function(){return oa})),Promise.resolve().then((function(){return aa}))];Promise.all(_n).then((e=>$n(e))).catch((e=>console.error(e)));var En=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){window.location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(window.location.hash).slice(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}window.location.hash=`#${e}`}))}});const Cn={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},Sn=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["cc-by-sa",{name:"Creative Commons Attribution-ShareAlike 4.0 International Public License",short:"CC-BY-SA",url:"https://creativecommons.org/licenses/by-sa/4.0/legalcode"}]]),Ln={format:"markdown",isED:!1,isNoTrack:!0,isPR:!1,lint:{"privsec-section":!0,"wpt-tests-exist":!1},logos:[],prependW3C:!1,doJsonLd:!1,license:"cc-by",shortName:"X",showPreviousVersion:!1};var An=Object.freeze({__proto__:null,name:"dini/defaults",run:function(e){const t=!1!==e.lint&&{...Cn.lint,...Ln.lint,...e.lint};Object.assign(e,{...Cn,...Ln,...e,lint:t}),Object.assign(e,function(e){return{licenseInfo:Sn.get(e.license)}}(e))}});var Tn=String.raw`@keyframes pop{ 0%{transform:scale(1,1)} 25%{transform:scale(1.25,1.25);opacity:.75} 100%{transform:scale(1,1)} @@ -135,14 +135,14 @@ dd{margin-left:0} } @media print{ .removeOnSave{display:none} -}`;const An=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Ln,document.head.appendChild(e),e}();var Tn=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&An.remove()}});const Rn="dini/style";const Nn=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2016/fixup.js",as:"script"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2016/base.css",as:"style"}],t=document.createDocumentFragment();for(const n of e.map(lt))t.appendChild(n);return t}();Nn.appendChild(function(){const e=document.createElement("link");return e.rel="stylesheet",e.href="https://www.w3.org/StyleSheets/TR/2016/base.css",e.classList.add("removeOnSave"),e}()),document.head.querySelector("meta[name=viewport]")||Nn.prepend(function(){const e=document.createElement("meta");return e.name="viewport",e.content=function(e,t=", ",n="="){return Array.from(Object.entries(e)).map((([e,t])=>`${e}${n}${JSON.stringify(t)}`)).join(t)}({width:"device-width","initial-scale":"1","shrink-to-fit":"no"}).replace(/"/g,""),e}()),document.head.prepend(Nn);var Pn=Object.freeze({__proto__:null,name:Rn,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",Pt(t,Rn)}let t="";switch(e.specStatus.toUpperCase()){case"UNOFFICIAL":t="W3C-UD";break;case"BASE":t="base.css"}e.noToc||s("end-all",(()=>{!function(e,t){const n=e.createElement("script");location.hash&&n.addEventListener("load",(()=>{window.location.href=location.hash}),{once:!0}),n.src=`https://www.w3.org/scripts/TR/${t}/fixup.js`,e.body.appendChild(n)}(document,"2016")}),{once:!0});const n=`https://www.w3.org/StyleSheets/TR/2016/${t}`;var r;!function(e,t){const n=[].concat(t).map((t=>{const n=e.createElement("link");return n.rel="stylesheet",n.href=t,n})).reduce(((e,t)=>(e.appendChild(t),e)),e.createDocumentFragment());e.head.appendChild(n)}(document,n),s("beforesave",(r=n,e=>{const t=e.querySelector(`head link[href="${r}"]`);e.querySelector("head").append(t)}))}});class jn{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(Dn(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function Dn(e){const t=new jn(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function On(e){const t=Dn(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var zn=Object.freeze({__proto__:null,name:"core/sections",restructure:On,run:function(){On(document.body)}});const In="core/data-include";function qn(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=bt(e,r.dataset.oninclude,n),s="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let o=t;"markdown"===r&&(o=Gt(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&On(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:s}),s||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function Mn(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const o=await fetch(n);qn(await o.text(),r,n),t<3&&await Mn(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),Nt(r,In,{elements:[e]})}}));await Promise.all(r)}var Fn=Object.freeze({__proto__:null,name:In,run:async function(){await Mn(document,1)}});var Bn=Object.freeze({__proto__:null,name:"core/reindent",run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=It(e.innerHTML)}});const Hn="core/title",Wn=gt({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"ę— ę ‡é¢˜"}});var Un=Object.freeze({__proto__:null,name:Hn,run:function(e){const t=document.querySelector("h1#title")||Je`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){Nt('The document is missing a title, so using a default title. To fix this, please give your document a `<title>`. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',Hn,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||`${Wn.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=mt(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:o}=Je` +}`;const Rn=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Tn,document.head.appendChild(e),e}();var Nn=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Rn.remove()}});const Pn="dini/style";const jn=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2016/fixup.js",as:"script"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2016/base.css",as:"style"}],t=document.createDocumentFragment();for(const n of e.map(at))t.appendChild(n);return t}();jn.appendChild(function(){const e=document.createElement("link");return e.rel="stylesheet",e.href="https://www.w3.org/StyleSheets/TR/2016/base.css",e.classList.add("removeOnSave"),e}()),document.head.querySelector("meta[name=viewport]")||jn.prepend(function(){const e=document.createElement("meta");return e.name="viewport",e.content=function(e,t=", ",n="="){return Array.from(Object.entries(e)).map((([e,t])=>`${e}${n}${JSON.stringify(t)}`)).join(t)}({width:"device-width","initial-scale":"1","shrink-to-fit":"no"}).replace(/"/g,""),e}()),document.head.prepend(jn);var Dn=Object.freeze({__proto__:null,name:Pn,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",Rt(t,Pn)}let t="";switch(e.specStatus.toUpperCase()){case"UNOFFICIAL":t="W3C-UD";break;case"BASE":t="base.css"}e.noToc||qt("end-all",(()=>{!function(e,t){const n=e.createElement("script");location.hash&&n.addEventListener("load",(()=>{window.location.href=location.hash}),{once:!0}),n.src=`https://www.w3.org/scripts/TR/${t}/fixup.js`,e.body.appendChild(n)}(document,"2016")}),{once:!0});const n=`https://www.w3.org/StyleSheets/TR/2016/${t}`;var r;!function(e,t){const n=[].concat(t).map((t=>{const n=e.createElement("link");return n.rel="stylesheet",n.href=t,n})).reduce(((e,t)=>(e.appendChild(t),e)),e.createDocumentFragment());e.head.appendChild(n)}(document,n),qt("beforesave",(r=n,e=>{const t=e.querySelector(`head link[href="${r}"]`);e.querySelector("head").append(t)}))}});class On{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(zn(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function zn(e){const t=new On(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function In(e){const t=zn(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var qn=Object.freeze({__proto__:null,name:"core/sections",restructure:In,run:function(){In(document.body)}});const Mn="core/data-include";function Fn(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=mt(e,r.dataset.oninclude,n),s="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let o=t;"markdown"===r&&(o=en(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&In(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:s}),s||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function Bn(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const o=await fetch(n);Fn(await o.text(),r,n),t<3&&await Bn(e,t+1)}catch(t){Tt(`\`data-include\` failed: \`${n}\` (${t.message}).`,Mn,{elements:[e],cause:t})}}));await Promise.all(r)}var Hn=Object.freeze({__proto__:null,name:Mn,run:async function(){await Bn(document,1)}});var Wn=Object.freeze({__proto__:null,name:"core/reindent",run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Ot(e.innerHTML)}});const Un="core/title",Zn=ht({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"ę— ę ‡é¢˜"}});var Vn=Object.freeze({__proto__:null,name:Un,run:function(e){const t=document.querySelector("h1#title")||Qe`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){Tt('The document is missing a title, so using a default title. To fix this, please give your document a `<title>`. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',Un,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||`${Zn.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=ft(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:o}=Qe` Preview of PR <a href="${n}">#${e.prNumber}</a>: - `;t.prepend(...o),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});function Zn(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return Pt(t,"core/templates/show-link"),void console.warn(t,e)}return Je` + `;t.prepend(...o),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});function Kn(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return Rt(t,"core/templates/show-link"),void console.warn(t,e)}return Qe` <dt class="${e.class?e.class:null}">${e.key}</dt> - ${e.data?e.data.map(Vn):Vn(e)} - `}function Vn(e){return Je`<dd class="${e.class?e.class:null}"> - ${e.href?Je`<a href="${e.href}">${e.value||e.href}</a>`:e.value} - </dd>`}const Kn="core/templates/show-logo";function Yn(e,t){const n=Je`<a href="${e.url||null}" class="logo" + ${e.data?e.data.map(Yn):Yn(e)} + `}function Yn(e){return Qe`<dd class="${e.class?e.class:null}"> + ${e.href?Qe`<a href="${e.href}">${e.value||e.href}</a>`:e.value} + </dd>`}const Xn="core/templates/show-logo";function Qn(e,t){const n=Qe`<a href="${e.url||null}" class="logo" ><img alt="${e.alt||null}" crossorigin @@ -151,7 +151,7 @@ dd{margin-left:0} src="${e.src||null}" width="${e.width||null}" /> - </a>`;if(!e.alt){const r=zt`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;Nt(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,Kn,{hint:r,elements:[n]})}if(!e.src){const e=zt`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;Nt(`Logo at index ${t} is missing "\`src\`" property.`,Kn,{hint:e,elements:[n]})}return n}const Xn="core/templates/show-people",Qn=gt({en:{until:e=>Je` Until ${e} `},es:{until:e=>Je` Hasta ${e} `},ko:{until:e=>Je` ${e} ģ“ģ „ `},ja:{until:e=>Je` ${e} 仄前 `},de:{until:e=>Je` bis ${e} `},zh:{until:e=>Je` ē›“到 ${e} `}}),Gn=()=>Je`<svg + </a>`;if(!e.alt){const r=Dt`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;Tt(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,Xn,{hint:r,elements:[n]})}if(!e.src){const e=Dt`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;Tt(`Logo at index ${t} is missing "\`src\`" property.`,Xn,{hint:e,elements:[n]})}return n}const Gn="core/templates/show-people",Jn=ht({en:{until:e=>Qe` Until ${e} `},es:{until:e=>Qe` Hasta ${e} `},ko:{until:e=>Qe` ${e} ģ“ģ „ `},ja:{until:e=>Qe` ${e} 仄前 `},de:{until:e=>Qe` bis ${e} `},zh:{until:e=>Qe` ē›“到 ${e} `}}),er=()=>Qe`<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" @@ -170,15 +170,15 @@ dd{margin-left:0} class="st1" d="M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z" /> - </svg>`;function Jn(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(o=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,s=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${o}\`](${n}#${o})" configuration option.`;if(!e.name)return Nt(`${s} Missing required property \`"name"\`.`,Xn,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${s} ORCID "${e.orcid}" at index ${t} is invalid.`,o=`The origin should be "https://orcid.org", not "${r.origin}".`;return Nt(n,Xn,{hint:o}),!1}const o=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(o))return Nt(`${s} ORCID "${o}" has wrong format.`,Xn,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=e.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0),r=(12-n%11)%11,o=10===r?"X":String(r);return t===o}(n))return Nt(`${s} ORCID "${n}" failed checksum check.`,Xn,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(i=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(i)?new Date(i):"Invalid Date").toString())?(Nt(`${s} The property "\`retiredDate\`" is not a valid date.`,Xn,{hint:`The expected format is YYYY-MM-DD. ${r}`}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every(((e,r)=>{switch(!0){case"object"!=typeof e:return Nt(`${n}. Member "extra" at index ${r} is not an object.`,Xn,{hint:t}),!1;case!e.hasOwnProperty("name"):return Nt(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,Xn,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return Nt(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,Xn,{hint:t}),!1}return!0})):(Nt(`${n}. A person's "extras" member must be an array.`,Xn,{hint:t}),!1)}(e.extras,r,s))&&(e.url&&e.mailto&&Pt(`${s} Has both "url" and "mailto" property.`,Xn,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&Pt(`${s} Has a "\`companyURL\`" property but no "\`company\`" property.`,Xn,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var i});var o;return n.filter(r).map(er)}function er(e){const t=[e.name],n=[e.company],r=e.w3cid||null,o=[];if(e.mailto&&(e.url=`mailto:${e.mailto}`),e.url){const n="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";o.push(Je`<a class="${n}" href="${e.url}">${t}</a>`)}else o.push(Je`<span class="p-name fn">${t}</span>`);if(e.orcid&&o.push(Je`<a class="p-name orcid" href="${e.orcid}">${Gn()}</a>`),e.company){const t="p-org org h-org",r=e.companyURL?Je`<a class="${t}" href="${e.companyURL}">${n}</a>`:Je`<span class="${t}">${n}</span>`;o.push(Je` (${r})`)}e.note&&o.push(document.createTextNode(` (${e.note})`)),e.extras&&o.push(...e.extras.map((e=>Je`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?Je`<a href="${r}" class="${t}">${n}</a>`:Je`<span class="${t}">${n}</span>`}(e)}`)));const{retiredDate:s}=e;if(e.retiredDate){const e=Je`<time datetime="${s}" - >${at.format(new Date(s))}</time - >`;o.push(Je` - ${Qn.until(e)} `)}return Je`<dd + </svg>`;function tr(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(o=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,s=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${o}\`](${n}#${o})" configuration option.`;if(!e.name)return Tt(`${s} Missing required property \`"name"\`.`,Gn,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${s} ORCID "${e.orcid}" at index ${t} is invalid.`,o=`The origin should be "https://orcid.org", not "${r.origin}".`;return Tt(n,Gn,{hint:o}),!1}const o=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(o))return Tt(`${s} ORCID "${o}" has wrong format.`,Gn,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=e.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0),r=(12-n%11)%11,o=10===r?"X":String(r);return t===o}(n))return Tt(`${s} ORCID "${n}" failed checksum check.`,Gn,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(i=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(i)?new Date(i):"Invalid Date").toString())?(Tt(`${s} The property "\`retiredDate\`" is not a valid date.`,Gn,{hint:`The expected format is YYYY-MM-DD. ${r}`}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every(((e,r)=>{switch(!0){case"object"!=typeof e:return Tt(`${n}. Member "extra" at index ${r} is not an object.`,Gn,{hint:t}),!1;case!e.hasOwnProperty("name"):return Tt(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,Gn,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return Tt(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,Gn,{hint:t}),!1}return!0})):(Tt(`${n}. A person's "extras" member must be an array.`,Gn,{hint:t}),!1)}(e.extras,r,s))&&(e.url&&e.mailto&&Rt(`${s} Has both "url" and "mailto" property.`,Gn,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&Rt(`${s} Has a "\`companyURL\`" property but no "\`company\`" property.`,Gn,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var i});var o;return n.filter(r).map(nr)}function nr(e){const t=[e.name],n=[e.company],r=e.w3cid||null,o=[];if(e.mailto&&(e.url=`mailto:${e.mailto}`),e.url){const n="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";o.push(Qe`<a class="${n}" href="${e.url}">${t}</a>`)}else o.push(Qe`<span class="p-name fn">${t}</span>`);if(e.orcid&&o.push(Qe`<a class="p-name orcid" href="${e.orcid}">${er()}</a>`),e.company){const t="p-org org h-org",r=e.companyURL?Qe`<a class="${t}" href="${e.companyURL}">${n}</a>`:Qe`<span class="${t}">${n}</span>`;o.push(Qe` (${r})`)}e.note&&o.push(document.createTextNode(` (${e.note})`)),e.extras&&o.push(...e.extras.map((e=>Qe`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?Qe`<a href="${r}" class="${t}">${n}</a>`:Qe`<span class="${t}">${n}</span>`}(e)}`)));const{retiredDate:s}=e;if(e.retiredDate){const e=Qe`<time datetime="${s}" + >${st.format(new Date(s))}</time + >`;o.push(Qe` - ${Jn.until(e)} `)}return Qe`<dd class="editor p-author h-card vcard" data-editor-id="${r}" > ${o} - </dd>`}const tr="dini/templates/headers",nr="https://creativecommons.org/licenses/by/4.0/legalcode",rr=gt({en:{author:"Author:",authors:"Authors:",editor:"Editor:",editors:"Editors:",former_editor:"Former editor:",former_editors:"Former editors:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest published version:",this_version:"This version:"},ko:{author:"ģ €ģž:",authors:"ģ €ģž:",editor:"ķŽøģ§‘ģž:",editors:"ķŽøģ§‘ģž:",former_editor:"ģ“ģ „ ķŽøģ§‘ģž:",former_editors:"ģ“ģ „ ķŽøģ§‘ģž:",latest_editors_draft:"ģµœģ‹  ķŽøģ§‘ ģ“ˆģ•ˆ:",latest_published_version:"ģµœģ‹  ė²„ģ „:",this_version:"ķ˜„ģž¬ ė²„ģ „:"},zh:{author:"ä½œč€…ļ¼š",authors:"ä½œč€…ļ¼š",editor:"ē¼–č¾‘ļ¼š",editors:"ē¼–č¾‘ļ¼š",former_editor:"原ē¼–č¾‘ļ¼š",former_editors:"原ē¼–č¾‘ļ¼š",latest_editors_draft:"꜀ꖰē¼–č¾‘č‰ēØæļ¼š",latest_published_version:"ęœ€ę–°å‘åøƒē‰ˆęœ¬ļ¼š",this_version:"ęœ¬ē‰ˆęœ¬ļ¼š"},ja:{author:"著者ļ¼š",authors:"著者ļ¼š",editor:"ē·Ø者ļ¼š",editors:"ē·Ø者ļ¼š",former_editor:"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š",former_editors:"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š",latest_editors_draft:"ęœ€ę–°ć®ē·Ø集ē”Øč‰ę”ˆļ¼š",latest_published_version:"ęœ€ę–°ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š",this_version:"ć“ć®ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š"},nl:{author:"Auteur:",authors:"Auteurs:",editor:"Redacteur:",editors:"Redacteurs:",latest_editors_draft:"Laatste werkversie:",latest_published_version:"Laatst gepubliceerde versie:",this_version:"Deze versie:"},es:{author:"Autor:",authors:"Autores:",editor:"Editor:",editors:"Editores:",latest_editors_draft:"Borrador de editor mas reciente:",latest_published_version:"VersiĆ³n publicada mas reciente:",this_version:"Ɖsta versiĆ³n:"},de:{author:"Autor/in:",authors:"Autor/innen:",editor:"Redaktion:",editors:"Redaktion:",former_editor:"FrĆ¼here Mitwirkende:",former_editors:"FrĆ¼here Mitwirkende:",latest_editors_draft:"Letzter Entwurf:",latest_published_version:"Letzte publizierte Fassung:",this_version:"Diese Fassung:"}});var or=e=>Je`<div class="head"> - ${e.logos.map(Yn)} ${document.querySelector("h1#title")} + </dd>`}const rr="dini/templates/headers",or="https://creativecommons.org/licenses/by/4.0/legalcode",sr=ht({en:{author:"Author:",authors:"Authors:",editor:"Editor:",editors:"Editors:",former_editor:"Former editor:",former_editors:"Former editors:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest published version:",this_version:"This version:"},ko:{author:"ģ €ģž:",authors:"ģ €ģž:",editor:"ķŽøģ§‘ģž:",editors:"ķŽøģ§‘ģž:",former_editor:"ģ“ģ „ ķŽøģ§‘ģž:",former_editors:"ģ“ģ „ ķŽøģ§‘ģž:",latest_editors_draft:"ģµœģ‹  ķŽøģ§‘ ģ“ˆģ•ˆ:",latest_published_version:"ģµœģ‹  ė²„ģ „:",this_version:"ķ˜„ģž¬ ė²„ģ „:"},zh:{author:"ä½œč€…ļ¼š",authors:"ä½œč€…ļ¼š",editor:"ē¼–č¾‘ļ¼š",editors:"ē¼–č¾‘ļ¼š",former_editor:"原ē¼–č¾‘ļ¼š",former_editors:"原ē¼–č¾‘ļ¼š",latest_editors_draft:"꜀ꖰē¼–č¾‘č‰ēØæļ¼š",latest_published_version:"ęœ€ę–°å‘åøƒē‰ˆęœ¬ļ¼š",this_version:"ęœ¬ē‰ˆęœ¬ļ¼š"},ja:{author:"著者ļ¼š",authors:"著者ļ¼š",editor:"ē·Ø者ļ¼š",editors:"ē·Ø者ļ¼š",former_editor:"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š",former_editors:"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š",latest_editors_draft:"ęœ€ę–°ć®ē·Ø集ē”Øč‰ę”ˆļ¼š",latest_published_version:"ęœ€ę–°ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š",this_version:"ć“ć®ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š"},nl:{author:"Auteur:",authors:"Auteurs:",editor:"Redacteur:",editors:"Redacteurs:",latest_editors_draft:"Laatste werkversie:",latest_published_version:"Laatst gepubliceerde versie:",this_version:"Deze versie:"},es:{author:"Autor:",authors:"Autores:",editor:"Editor:",editors:"Editores:",latest_editors_draft:"Borrador de editor mas reciente:",latest_published_version:"VersiĆ³n publicada mas reciente:",this_version:"Ɖsta versiĆ³n:"},de:{author:"Autor/in:",authors:"Autor/innen:",editor:"Redaktion:",editors:"Redaktion:",former_editor:"FrĆ¼here Mitwirkende:",former_editors:"FrĆ¼here Mitwirkende:",latest_editors_draft:"Letzter Entwurf:",latest_published_version:"Letzte publizierte Fassung:",this_version:"Diese Fassung:"}});var ir=e=>Qe`<div class="head"> + ${e.logos.map(Qn)} ${document.querySelector("h1#title")} ${function(e){let t=document.querySelector("h2#subtitle");return t&&t.parentElement?(t.remove(),e.subtitle=t.textContent.trim()):e.subtitle&&(t=document.createElement("h2"),t.textContent=e.subtitle,t.id="subtitle"),t&&t.classList.add("subtitle"),t}(e)} <h2> ${e.textStatus} @@ -187,81 +187,81 @@ dd{margin-left:0} > </h2> <dl> - <dt>${e.multipleEditors?rr.editors:rr.editor}</dt> - ${Jn(e,"editors")} - ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?Je` + <dt>${e.multipleEditors?sr.editors:sr.editor}</dt> + ${tr(e,"editors")} + ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?Qe` <dt> - ${e.multipleFormerEditors?rr.former_editors:rr.former_editor} + ${e.multipleFormerEditors?sr.former_editors:sr.former_editor} </dt> - ${Jn(e,"formerEditors")} + ${tr(e,"formerEditors")} `:""} - ${e.authors?Je` - <dt>${e.multipleAuthors?rr.authors:rr.author}</dt> - ${Jn(e,"authors")} + ${e.authors?Qe` + <dt>${e.multipleAuthors?sr.authors:sr.author}</dt> + ${tr(e,"authors")} `:""} - ${e.otherLinks?e.otherLinks.map(Zn):""} + ${e.otherLinks?e.otherLinks.map(Kn):""} </dl> - ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;if(e.hasOwnProperty("overrideCopyright")){Pt("The `overrideCopyright` configuration option is deprecated.",tr,{hint:'Please use `<p class="copyright">` instead.'})}return e.overrideCopyright?[e.overrideCopyright]:Je`<p class="copyright"> + ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;if(e.hasOwnProperty("overrideCopyright")){Rt("The `overrideCopyright` configuration option is deprecated.",rr,{hint:'Please use `<p class="copyright">` instead.'})}return e.overrideCopyright?[e.overrideCopyright]:Qe`<p class="copyright"> Dieses Dokument ist lizensiert unter - ${n="Creative Commons Attribution 4.0 International Public License",r=nr,o="subfoot",Je`<a rel="license" href="${r}" class="${o}">${n}</a>`}. + ${n="Creative Commons Attribution 4.0 International Public License",r=or,o="subfoot",Qe`<a rel="license" href="${r}" class="${o}">${n}</a>`}. </p>`;var n,r,o}(e)} <hr /> - </div>`;const sr="dini/headers",ir=new Intl.DateTimeFormat(["de-DE"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"}),ar={unofficial:"Entwurf vom",base:"Spezifikation vom"};var cr=Object.freeze({__proto__:null,name:sr,run:function(e){if(e.isUnofficial="unofficial"===e.specStatus,e.isBasic="base"===e.specStatus,!e.specStatus){Nt("Missing required configuration: `specStatus`",sr)}e.title=document.title||"Kein Titel",e.subtitle||(e.subtitle=""),e.publishDate=function(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=st.format(r);return new Date(e)}return Nt(`[\`${t}\`](https://github.com/speced/respec/wiki/${t}) is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,sr),new Date(st.format(new Date))}(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.publishHumanDate=ir.format(e.publishDate);const t=function(e){if(!e.name){Nt("All authors and editors must have a name.",sr)}if(e.orcid)try{e.orcid=function(e){const t=new URL(e,"https://orcid.org/");if("https://orcid.org"!==t.origin)throw new Error(`The origin should be "https://orcid.org", not "${t.origin}".`);const n=t.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(n))throw new Error(`ORCIDs have the format "1234-1234-1234-1234", not "${n}"`);const r=n[n.length-1],o=(12-n.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0)%11)%11,s=10===o?"X":String(o);if(r!==s)throw new Error(`"${n}" has an invalid checksum.`);return t.href}(e.orcid)}catch(t){Nt(`"${e.orcid}" is not an ORCID. ${t.message}`,sr),delete e.orcid}};if(e.formerEditors||(e.formerEditors=[]),e.editors){e.editors.forEach(t);for(let t=0;t<e.editors.length;t++){const n=e.editors[t];"retiredDate"in n&&(e.formerEditors.push(n),e.editors.splice(t--,1))}}if(!e.editors||0===e.editors.length){Nt("At least one editor is required",sr)}e.formerEditors.length&&e.formerEditors.forEach(t),e.authors&&e.authors.forEach(t),e.multipleEditors=e.editors&&e.editors.length>1,e.multipleFormerEditors=e.formerEditors.length>1,e.multipleAuthors=e.authors&&e.authors.length>1,(e.alternateFormats||[]).forEach((e=>{if(!e.uri||!e.label){Nt("All alternate formats must have a uri and a label.",sr)}})),e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.textStatus=ar[e.specStatus],e.dashDate=st.format(e.publishDate),e.publishISODate=e.publishDate.toISOString();const n=or(e);document.body.prepend(n),document.body.classList.add("h-entry"),o("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const lr="dini/abstract",ur=gt({en:{abstract:"Abstract"},ko:{abstract:"ģš”ģ•½"},zh:{abstract:"ę‘˜č¦"},ja:{abstract:"要ē“„"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"}});var dr=Object.freeze({__proto__:null,name:lr,run:async function(){const e=document.getElementById("abstract");if(!e){return void Nt('Document must have one element with `id="abstract"',lr)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=ur.abstract,e.prepend(t))}});var pr=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=bt(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const fr="core/dfn-abbr";function hr(e){const t=(n=e).dataset.abbr?n.dataset.abbr:n.textContent.match(/\b([a-z])/gi).join("").toUpperCase();var n;const r=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${r}">${t}</abbr>)`);const o=e.dataset.lt||"";e.dataset.lt=o.split("|").filter((e=>e.trim())).concat(t).join("|")}var mr=Object.freeze({__proto__:null,name:fr,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)hr(t);else{Nt(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,fr,{elements:[t],title:"Error: unsupported."})}}}});const gr=/^[a-z]+(\s+[a-z]+)+\??$/,br=/\B"([^"]*)"\B/,yr=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,wr=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,vr=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,xr=/^(?:\w+)\??$/,kr=/^(\w+)\["([\w- ]*)"\]$/,$r=/\.?(\w+\(.*\)$)/,_r=/\/(.+)/,Er=/\[\[.+\]\]/;function Cr(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Je`<a + </div>`;const ar="dini/headers",cr=new Intl.DateTimeFormat(["de-DE"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"}),lr={unofficial:"Entwurf vom",base:"Spezifikation vom"};var ur=Object.freeze({__proto__:null,name:ar,run:function(e){if(e.isUnofficial="unofficial"===e.specStatus,e.isBasic="base"===e.specStatus,!e.specStatus){Tt("Missing required configuration: `specStatus`",ar)}e.title=document.title||"Kein Titel",e.subtitle||(e.subtitle=""),e.publishDate=function(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=rt.format(r);return new Date(e)}return Tt(`[\`${t}\`](https://github.com/speced/respec/wiki/${t}) is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,ar),new Date(rt.format(new Date))}(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.publishHumanDate=cr.format(e.publishDate);const t=function(e){if(!e.name){Tt("All authors and editors must have a name.",ar)}if(e.orcid)try{e.orcid=function(e){const t=new URL(e,"https://orcid.org/");if("https://orcid.org"!==t.origin)throw new Error(`The origin should be "https://orcid.org", not "${t.origin}".`);const n=t.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(n))throw new Error(`ORCIDs have the format "1234-1234-1234-1234", not "${n}"`);const r=n[n.length-1],o=(12-n.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0)%11)%11,s=10===o?"X":String(o);if(r!==s)throw new Error(`"${n}" has an invalid checksum.`);return t.href}(e.orcid)}catch(t){Tt(`"${e.orcid}" is not an ORCID. ${t.message}`,ar),delete e.orcid}};if(e.formerEditors||(e.formerEditors=[]),e.editors){e.editors.forEach(t);for(let t=0;t<e.editors.length;t++){const n=e.editors[t];"retiredDate"in n&&(e.formerEditors.push(n),e.editors.splice(t--,1))}}if(!e.editors||0===e.editors.length){Tt("At least one editor is required",ar)}e.formerEditors.length&&e.formerEditors.forEach(t),e.authors&&e.authors.forEach(t),e.multipleEditors=e.editors&&e.editors.length>1,e.multipleFormerEditors=e.formerEditors.length>1,e.multipleAuthors=e.authors&&e.authors.length>1,(e.alternateFormats||[]).forEach((e=>{if(!e.uri||!e.label){Tt("All alternate formats must have a uri and a label.",ar)}})),e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.textStatus=lr[e.specStatus],e.dashDate=rt.format(e.publishDate),e.publishISODate=e.publishDate.toISOString();const n=ir(e);document.body.prepend(n),document.body.classList.add("h-entry"),It("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const dr="dini/abstract",pr=ht({en:{abstract:"Abstract"},ko:{abstract:"ģš”ģ•½"},zh:{abstract:"ę‘˜č¦"},ja:{abstract:"要ē“„"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"}});var fr=Object.freeze({__proto__:null,name:dr,run:async function(){const e=document.getElementById("abstract");if(!e){return void Tt('Document must have one element with `id="abstract"',dr)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=pr.abstract,e.prepend(t))}});var hr=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=mt(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const mr="core/dfn-abbr";function gr(e){const t=(n=e).dataset.abbr?n.dataset.abbr:n.textContent.match(/\b([a-z])/gi).join("").toUpperCase();var n;const r=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${r}">${t}</abbr>)`);const o=e.dataset.lt||"";e.dataset.lt=o.split("|").filter((e=>e.trim())).concat(t).join("|")}var br=Object.freeze({__proto__:null,name:mr,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)gr(t);else{Tt(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,mr,{elements:[t],title:"Error: unsupported."})}}}});const yr=/^[a-z]+(\s+[a-z]+)+\??$/,wr=/\B"([^"]*)"\B/,vr=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,xr=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,kr=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,$r=/^(?:\w+)\??$/,_r=/^(\w+)\["([\w- ]*)"\]$/,Er=/\.?(\w+\(.*\)$)/,Cr=/\/(.+)/,Sr=/\[\[.+\]\]/;function Lr(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Qe`<a data-xref-type="_IDL_" data-link-type="idl" data-lt="${t}" ><code>${t+(r?"?":"")}</code></a - >`}function Sr(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:s}=e,{identifier:i}=n||{},a="method"===r,c=a?Je`(${yt(s,Lr)})`:null,l=a?`(${s.join(", ")})`:"";return Je`${n&&o?".":""}<a + >`}function Ar(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:s}=e,{identifier:i}=n||{},a="method"===r,c=a?Qe`(${gt(s,Tr)})`:null,l=a?`(${s.join(", ")})`:"";return Qe`${n&&o?".":""}<a data-xref-type="${r}" data-link-type="${r}" data-link-for="${i}" data-xref-for="${i}" data-lt="${`[[${t}]]${l}`}" ><code>[[${t}]]${c}</code></a - >`}function Lr(e,t,n){if(t<n.length-1)return Je`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,s=o?r[2]:r[0];return Je`${o?"...":null}<var>${s}</var>`}function Ar(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return Je`${r?".":""}<a + >`}function Tr(e,t,n){if(t<n.length-1)return Qe`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,s=o?r[2]:r[0];return Qe`${o?"...":null}<var>${s}</var>`}function Rr(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return Qe`${r?".":""}<a data-link-type="idl" data-xref-type="attribute|dict-member|const" data-link-for="${o}" data-xref-for="${o}" ><code>${n}</code></a - >`}function Tr(e){const{args:t,identifier:n,type:r,parent:o,renderParent:s}=e,{renderText:i,renderArgs:a}=e,{identifier:c}=o||{},l=yt(a||t,Lr),u=`${n}(${t.join(", ")})`;return Je`${o&&s?".":""}<a + >`}function Nr(e){const{args:t,identifier:n,type:r,parent:o,renderParent:s}=e,{renderText:i,renderArgs:a}=e,{identifier:c}=o||{},l=gt(a||t,Tr),u=`${n}(${t.join(", ")})`;return Qe`${o&&s?".":""}<a data-link-type="idl" data-xref-type="${r}" data-link-for="${c}" data-xref-for="${c}" data-lt="${u}" ><code>${i||n}</code></a - >${!i||a?Je`<code>(${l})</code>`:""}`}function Rr(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return Je`"<a + >${!i||a?Qe`<code>(${l})</code>`:""}`}function Pr(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return Qe`"<a data-link-type="idl" data-xref-type="enum-value" data-link-for="${o}" data-xref-for="${o}" data-lt="${n?null:"the-empty-string"}" ><code>${n}</code></a - >"`}function Nr(e){const{identifier:t}=e;return Je`"<a + >"`}function jr(e){const{identifier:t}=e;return Qe`"<a data-link-type="idl" data-cite="webidl" data-xref-type="exception" ><code>${t}</code></a - >"`}function Pr(e){const{identifier:t,nullable:n}=e;return Je`<a + >"`}function Dr(e){const{identifier:t,nullable:n}=e;return Qe`<a data-link-type="idl" data-cite="webidl" data-xref-type="interface" data-lt="${t}" ><code>${t+(n?"?":"")}</code></a - >`}function jr(e){let t;try{t=function(e){const t=Er.test(e),n=t?_r:$r,[r,o]=e.split(n);if(t&&r&&!o)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const s=r.split(/[./]/).concat(o).filter((e=>e&&e.trim())).map((e=>e.trim())),i=!e.includes("/"),a=[];for(;s.length;){const t=s.pop();if(yr.test(t)){const[,e,n,r,o]=t.match(yr),s=n.split(/,\s*/).filter((e=>e)),c=r?.trim(),l=o?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:s,renderParent:i,renderText:c,renderArgs:l})}else if(kr.test(t)){const[,e,n]=t.match(kr);a.push({type:"enum",identifier:e,enumValue:n,renderParent:i})}else if(br.test(t)){const[,e]=t.match(br);i?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:i})}else if(wr.test(t)){const[,e,n]=t.match(wr),r=n?"method":"attribute",o=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:o,renderParent:i})}else if(vr.test(t)&&s.length){const[,e]=t.match(vr);a.push({type:"attribute",identifier:e,renderParent:i})}else if(gr.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(!xr.test(t)||0!==s.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=Je`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Nt(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=Je(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Cr(e);t&&r.push(t);break}case"attribute":r.push(Ar(e));break;case"internal-slot":r.push(Sr(e));break;case"method":r.push(Tr(e));break;case"enum":r.push(Rr(e));break;case"exception":r.push(Nr(e));break;case"idl-primitive":r.push(Pr(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Dr=new Set(["alias","reference"]),Or=async function(){const e=await et.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[...Dr]){const r=e.transaction(n,"readwrite").store,o=IDBKeyRange.lowerBound(t);let s=await r.openCursor(o);for(;s?.value;){const e=s.value;(void 0===e.expires||e.expires<t)&&await r.delete(e.id),s=await s.continue()}}return e}();const zr={get ready(){return Or},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!Dr.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:r},async get(e,t){if(!Dr.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),o=await n.openCursor(r);return o?o.value:o},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const o={id:r,...e[r],expires:t};o.aliasOf?n.alias.push(o):n.reference.push(o)}const r=[...Dr].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!Dr.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){const o=await this.get(e,t.id);if(o?.expires<Date.now()){const{store:o}=n.transaction(e,"readwrite");await o.delete(t.id),r=!1}}const{store:o}=n.transaction(e,"readwrite");return r?await o.put(t):await o.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Dr],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},Ir={},qr=new URL("https://api.specref.org/bibrefs?refs="),Mr=lt({hint:"dns-prefetch",href:qr.origin});let Fr;document.head.appendChild(Mr);const Br=new Promise((e=>{Fr=e}));async function Hr(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter((e=>e.trim()));if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(qr.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const o=await r.json(),s=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),s):s;await zr.addAll(o,e)}catch(e){console.error(e)}return o}async function Wr(e){const t=await Br;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await Wr(n.aliasOf):n}var Ur=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map((e=>e.toLowerCase())));Array.from(this.conf.informativeReferences).filter((t=>e.has(t.toLowerCase()))).forEach((e=>this.conf.informativeReferences.delete(e)))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=Ir;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio[e].aliasOf)).filter((e=>!this.conf.localBiblio.hasOwnProperty(e)));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter((e=>!this.conf.localBiblio.hasOwnProperty(e))).concat(e).sort())),r=n.length?await async function(e){const t=[];try{await zr.ready;const n=e.map((async e=>({id:e,data:await zr.find(e)})));t.push(...await Promise.all(n))}catch(n){t.push(...e.map((e=>({id:e,data:null})))),console.warn(n)}return t}(n):[],o={hasData:[],noData:[]};r.forEach((e=>{(e.data?o.hasData:o.noData).push(e)})),o.hasData.forEach((e=>{Ir[e.id]=e.data}));const s=o.noData.map((e=>e.id));if(s.length){const e=await Hr(s,{forceUpdate:!0});Object.assign(Ir,e)}Object.assign(Ir,this.conf.localBiblio),(()=>{Fr(this.conf.biblio)})()}},biblio:Ir,name:"core/biblio",resolveRef:Wr,updateFromNetwork:Hr});const Zr="core/render-biblio",Vr=gt({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"ģ°øģ”°"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},ja:{info_references:"参ē…§ē”Øå‚č€ƒę–‡ēŒ®",norm_references:"č¦ēƄēš„å‚č€ƒę–‡ēŒ®",references:"å‚č€ƒę–‡ēŒ®"},de:{info_references:"WeiterfĆ¼hrende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"éžč§„čŒƒę€§å¼•ē”Ø",norm_references:"č§„čŒƒę€§å¼•ē”Ø",references:"å‚č€ƒę–‡ēŒ®"}}),Kr=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]),Yr=(Xr=".",e=>{const t=e.trim();return!t||t.endsWith(Xr)?t:t+Xr});var Xr;function Qr(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(Gr)),o=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),s=o.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),i=Je`<section> + >`}function Or(e){let t;try{t=function(e){const t=Sr.test(e),n=t?Cr:Er,[r,o]=e.split(n);if(t&&r&&!o)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const s=r.split(/[./]/).concat(o).filter((e=>e&&e.trim())).map((e=>e.trim())),i=!e.includes("/"),a=[];for(;s.length;){const t=s.pop();if(vr.test(t)){const[,e,n,r,o]=t.match(vr),s=n.split(/,\s*/).filter((e=>e)),c=r?.trim(),l=o?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:s,renderParent:i,renderText:c,renderArgs:l})}else if(_r.test(t)){const[,e,n]=t.match(_r);a.push({type:"enum",identifier:e,enumValue:n,renderParent:i})}else if(wr.test(t)){const[,e]=t.match(wr);i?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:i})}else if(xr.test(t)){const[,e,n]=t.match(xr),r=n?"method":"attribute",o=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:o,renderParent:i})}else if(kr.test(t)&&s.length){const[,e]=t.match(kr);a.push({type:"attribute",identifier:e,renderParent:i})}else if(yr.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(!$r.test(t)||0!==s.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=Qe`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Tt(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=Qe(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Lr(e);t&&r.push(t);break}case"attribute":r.push(Rr(e));break;case"internal-slot":r.push(Ar(e));break;case"method":r.push(Nr(e));break;case"enum":r.push(Pr(e));break;case"exception":r.push(jr(e));break;case"idl-primitive":r.push(Dr(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const zr=new Set(["alias","reference"]),Ir=async function(){const e=await Ge.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[...zr]){const r=e.transaction(n,"readwrite").store,o=IDBKeyRange.lowerBound(t);let s=await r.openCursor(o);for(;s?.value;){const e=s.value;(void 0===e.expires||e.expires<t)&&await r.delete(e.id),s=await s.continue()}}return e}();const qr={get ready(){return Ir},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!zr.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:r},async get(e,t){if(!zr.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),o=await n.openCursor(r);return o?o.value:o},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const o={id:r,...e[r],expires:t};o.aliasOf?n.alias.push(o):n.reference.push(o)}const r=[...zr].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!zr.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){const o=await this.get(e,t.id);if(o?.expires<Date.now()){const{store:o}=n.transaction(e,"readwrite");await o.delete(t.id),r=!1}}const{store:o}=n.transaction(e,"readwrite");return r?await o.put(t):await o.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...zr],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},Mr={},Fr=new URL("https://api.specref.org/bibrefs?refs="),Br=at({hint:"dns-prefetch",href:Fr.origin});let Hr;document.head.appendChild(Br);const Wr=new Promise((e=>{Hr=e}));async function Ur(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter((e=>e.trim()));if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(Fr.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const o=await r.json(),s=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),s):s;await qr.addAll(o,e)}catch(e){console.error(e)}return o}async function Zr(e){const t=await Wr;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await Zr(n.aliasOf):n}var Vr=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map((e=>e.toLowerCase())));Array.from(this.conf.informativeReferences).filter((t=>e.has(t.toLowerCase()))).forEach((e=>this.conf.informativeReferences.delete(e)))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=Mr;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio[e].aliasOf)).filter((e=>!this.conf.localBiblio.hasOwnProperty(e)));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter((e=>!this.conf.localBiblio.hasOwnProperty(e))).concat(e).sort())),r=n.length?await async function(e){const t=[];try{await qr.ready;const n=e.map((async e=>({id:e,data:await qr.find(e)})));t.push(...await Promise.all(n))}catch(n){t.push(...e.map((e=>({id:e,data:null})))),console.warn(n)}return t}(n):[],o={hasData:[],noData:[]};r.forEach((e=>{(e.data?o.hasData:o.noData).push(e)})),o.hasData.forEach((e=>{Mr[e.id]=e.data}));const s=o.noData.map((e=>e.id));if(s.length){const e=await Ur(s,{forceUpdate:!0});Object.assign(Mr,e)}Object.assign(Mr,this.conf.localBiblio),(()=>{Hr(this.conf.biblio)})()}},biblio:Mr,name:"core/biblio",resolveRef:Zr,updateFromNetwork:Ur});const Kr="core/render-biblio",Yr=ht({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"ģ°øģ”°"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},ja:{info_references:"参ē…§ē”Øå‚č€ƒę–‡ēŒ®",norm_references:"č¦ēƄēš„å‚č€ƒę–‡ēŒ®",references:"å‚č€ƒę–‡ēŒ®"},de:{info_references:"WeiterfĆ¼hrende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"éžč§„čŒƒę€§å¼•ē”Ø",norm_references:"č§„čŒƒę€§å¼•ē”Ø",references:"å‚č€ƒę–‡ēŒ®"}}),Xr=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]),Qr=(Gr=".",e=>{const t=e.trim();return!t||t.endsWith(Gr)?t:t+Gr});var Gr;function Jr(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(eo)),o=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),s=o.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),i=Qe`<section> <h3>${t}</h3> - <dl class="bibliography">${s.map(eo)}</dl> - </section>`;wt(i,"",t);const a=function(e){return e.reduce(((e,t)=>{const n=t.refcontent.id;return(e.has(n)?e.get(n):e.set(n,[]).get(n)).push(t.ref),e}),new Map)}(n);return function(e,t){e.map((({ref:e,refcontent:n})=>{const r=`#bib-${e.toLowerCase()}`,o=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(o),refcontent:n}})).forEach((({refUrl:e,elems:t,refcontent:n})=>{t.forEach((t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"}))}))}(o,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#bib-${t.toLowerCase()}"]`)].filter((({textContent:e})=>e.toLowerCase()===t.toLowerCase()));Nt(`Reference "[${t}]" not found.`,Zr,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),i}function Gr(e){let t=Ir[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Nt(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,Zr)}else n=t.aliasOf,t=Ir[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function Jr(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,o=Je`<cite + <dl class="bibliography">${s.map(no)}</dl> + </section>`;bt(i,"",t);const a=function(e){return e.reduce(((e,t)=>{const n=t.refcontent.id;return(e.has(n)?e.get(n):e.set(n,[]).get(n)).push(t.ref),e}),new Map)}(n);return function(e,t){e.map((({ref:e,refcontent:n})=>{const r=`#bib-${e.toLowerCase()}`,o=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(o),refcontent:n}})).forEach((({refUrl:e,elems:t,refcontent:n})=>{t.forEach((t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"}))}))}(o,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#bib-${t.toLowerCase()}"]`)].filter((({textContent:e})=>e.toLowerCase()===t.toLowerCase()));Tt(`Reference "[${t}]" not found.`,Kr,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),i}function eo(e){let t=Mr[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Tt(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,Kr)}else n=t.aliasOf,t=Mr[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function to(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,o=Qe`<cite ><a class="bibref" href="${r}" data-link-type="biblio">${t||n}</a></cite - >`;return t?o:Je`[${o}]`}function eo(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return Je` + >`;return t?o:Qe`[${o}]`}function no(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return Qe` <dt id="${r}">[${t}]</dt> <dd> - ${n?{html:to(n)}:Je`<em class="respec-offending-element" - >${Vr.reference_not_found}</em + ${n?{html:ro(n)}:Qe`<em class="respec-offending-element" + >${Yr.reference_not_found}</em >`} </dd> - `}function to(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${Yr(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${Kr.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var no=Object.freeze({__proto__:null,name:Zr,renderInlineCitation:Jr,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")||Je`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(Je`<h1>${Vr.references}</h1>`),r.classList.add("appendix"),n.length){const e=Qr(n,Vr.norm_references);r.appendChild(e)}if(t.length){const e=Qr(t,Vr.info_references);r.appendChild(e)}document.body.appendChild(r)}});const ro="core/inlines",oo={},so=e=>new RegExp(e.map((e=>e.source)).join("|")),io=gt({en:{rfc2119Keywords:()=>so([/\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:()=>so([/\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/])}}),ao=/(?:`[^`]+`)(?!`)/,co=/(?:{{[^}]+\?*}})/,lo=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,uo=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,po=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,fo=/(?:\[=[^=]+=\])/,ho=/(?:\[\^[^^]+\^\])/;function mo(e){const t=e.slice(2,-2).trim(),[n,r,o]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[s,i,a]=t.startsWith("/")?["element-attr",null,n]:o?["attr-value",`${n}/${r}`,o]:r?["element-attr",n,r]:["element",null,n];return Je`<code + `}function ro(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t.endsWith(".")||(t+=". ")),e.publisher&&(t=`${t} ${Qr(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${Xr.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var oo=Object.freeze({__proto__:null,name:Kr,renderInlineCitation:to,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")||Qe`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(Qe`<h1>${Yr.references}</h1>`),r.classList.add("appendix"),n.length){const e=Jr(n,Yr.norm_references);r.appendChild(e)}if(t.length){const e=Jr(t,Yr.info_references);r.appendChild(e)}document.body.appendChild(r)}});const so="core/inlines",io={},ao=e=>new RegExp(e.map((e=>e.source)).join("|")),co=ht({en:{rfc2119Keywords:()=>ao([/\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:()=>ao([/\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/])}}),lo=/(?:`[^`]+`)(?!`)/,uo=/(?:{{[^}]+\?*}})/,po=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,fo=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,ho=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,mo=/(?:\[=[^=]+=\])/,go=/(?:\[\^[^^]+\^\])/;function bo(e){const t=e.slice(2,-2).trim(),[n,r,o]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[s,i,a]=t.startsWith("/")?["element-attr",null,n]:o?["attr-value",`${n}/${r}`,o]:r?["element-attr",n,r]:["element",null,n];return Qe`<code ><a data-xref-type="${s}" data-xref-for="${i}" @@ -269,45 +269,45 @@ dd{margin-left:0} data-link-for="${i}" >${a}</a ></code - >`}function go(e){const t=mt(e),n=Je`<em class="rfc2119">${t}</em>`;return oo[t]=!0,n}function bo(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?Je`<a href="${t}" data-matched-text="${e}"></a>`:Je`<a data-cite="${t}" data-matched-text="${e}"></a>`}function yo(e,t){const n=mt(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=jr(n);return!!t.parentElement.closest("dfn,a")?$o(`\`${r.textContent}\``):r}function wo(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,s]=r.split("|").map(mt),{type:i,illegal:a}=kt(o,t.parentElement),c=Jr(o,s),l=o.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;Pt("Normative references in informative sections are not allowed. ",ro,{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 vo(e,t,n){return"ABBR"===t.parentElement.tagName?e:Je`<abbr title="${n.get(e)}">${e}</abbr>`}function xo(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return Je`<var data-type="${r}">${n}</var>`}function ko(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(mt).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const o=n.substring(0,r),s=n.substring(r+1,n.length);return[t(o),t(s)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[o,s]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],i=_o(s),a=n?mt(n):null;return Je`<a + >`}function yo(e){const t=ft(e),n=Qe`<em class="rfc2119">${t}</em>`;return io[t]=!0,n}function wo(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?Qe`<a href="${t}" data-matched-text="${e}"></a>`:Qe`<a data-cite="${t}" data-matched-text="${e}"></a>`}function vo(e,t){const n=ft(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=Or(n);return!!t.parentElement.closest("dfn,a")?Eo(`\`${r.textContent}\``):r}function xo(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,s]=r.split("|").map(ft),{type:i,illegal:a}=vt(o,t.parentElement),c=to(o,s),l=o.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;Rt("Normative references in informative sections are not allowed. ",so,{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 ko(e,t,n){return"ABBR"===t.parentElement.tagName?e:Qe`<abbr title="${n.get(e)}">${e}</abbr>`}function $o(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return Qe`<var data-type="${r}">${n}</var>`}function _o(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(ft).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const o=n.substring(0,r),s=n.substring(r+1,n.length);return[t(o),t(s)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[o,s]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],i=Co(s),a=n?ft(n):null;return Qe`<a data-link-type="dfn|abstract-op" data-link-for="${a}" data-xref-for="${a}" data-lt="${o}" >${i}</a - >`}function $o(e){const t=e.slice(1,-1);return Je`<code>${t}</code>`}function _o(e){return ao.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?$o(e):_o(e))):document.createTextNode(e)}var Eo=Object.freeze({__proto__:null,name:ro,rfc2119Usage:oo,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new Ct,e.informativeReferences=new Ct,e.respecRFC2119||(e.respecRFC2119=oo);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=mt(e),o=mt(r);t.set(n,o)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,o=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=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)),s=[];let i;for(;i=o.nextNode();)s.push(i);return s}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),s=io.rfc2119Keywords(),i=new RegExp(`(${so([s,co,lo,uo,po,fo,ao,ho,...r?[r]:[]]).source})`);for(const n of o){const r=n.data.split(i);if(1===r.length)continue;const o=document.createDocumentFragment();let a=!0;for(const i of r)if(a=!a,a)switch(!0){case i.startsWith("{{"):o.append(yo(i,n));break;case i.startsWith("[[["):o.append(bo(i));break;case i.startsWith("[["):o.append(...wo(i,n,e));break;case i.startsWith("|"):o.append(xo(i));break;case i.startsWith("[="):o.append(ko(i));break;case i.startsWith("`"):o.append($o(i));break;case i.startsWith("[^"):o.append(mo(i));break;case t.has(i):o.append(vo(i,n,t));break;case s.test(i):o.append(go(i))}else o.append(i);n.replaceWith(o)}}});const Co="dini/conformance",So=gt({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)=>Je`<p> + >`}function Eo(e){const t=e.slice(1,-1);return Qe`<code>${t}</code>`}function Co(e){return lo.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?Eo(e):Co(e))):document.createTextNode(e)}var So=Object.freeze({__proto__:null,name:so,rfc2119Usage:io,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new _t,e.informativeReferences=new _t,e.respecRFC2119||(e.respecRFC2119=io);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=ft(e),o=ft(r);t.set(n,o)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,o=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=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)),s=[];let i;for(;i=o.nextNode();)s.push(i);return s}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),s=co.rfc2119Keywords(),i=new RegExp(`(${ao([s,uo,po,fo,ho,mo,lo,go,...r?[r]:[]]).source})`);for(const n of o){const r=n.data.split(i);if(1===r.length)continue;const o=document.createDocumentFragment();let a=!0;for(const i of r)if(a=!a,a)switch(!0){case i.startsWith("{{"):o.append(vo(i,n));break;case i.startsWith("[[["):o.append(wo(i));break;case i.startsWith("[["):o.append(...xo(i,n,e));break;case i.startsWith("|"):o.append($o(i));break;case i.startsWith("[="):o.append(_o(i));break;case i.startsWith("`"):o.append(Eo(i));break;case i.startsWith("[^"):o.append(bo(i));break;case t.has(i):o.append(ko(i,n,t));break;case s.test(i):o.append(yo(i))}else o.append(i);n.replaceWith(o)}}});const Lo="dini/conformance",Ao=ht({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)=>Qe`<p> The key word${t?"s":""} ${e} in this document ${t?"are":"is"} to be interpreted as described in <a href="https://datatracker.ietf.org/doc/html/bcp14">BCP 14</a> - ${Jr("RFC2119")} ${Jr("RFC8174")} + ${to("RFC2119")} ${to("RFC8174")} when, and only when, they appear in all capitals, as shown here. - </p>`},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)=>Je`<p> + </p>`},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)=>Qe`<p> ${t?"Die SchlĆ¼sselwƶrter":"Das SchlĆ¼sselwort"} ${e} in diesem Dokument ${t?"sind":"ist"} gemƤƟ <a href="https://datatracker.ietf.org/doc/html/bcp14">BCP 14</a> - ${Jr("RFC2119")} ${Jr("RFC8174")} + ${to("RFC2119")} ${to("RFC8174")} und unter BerĆ¼cksichtigung von <a href="https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst" >2119de</a > zu interpretieren, wenn und nur wenn ${t?"sie":"es"} wie hier gezeigt durchgehend groƟ geschrieben wurde${t?"n":""}. - </p>`}});function Lo(e,t){const n=[...Object.keys(oo)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=(o=n.sort(),[].concat(pt(o,(e=>Je`<em class="rfc2119">${e}</em>`))).map((e=>"string"==typeof e?Je`${e}`:e)));var o;const s=n.length>1,i=Je` - <h1>${So.conformance}</h1> - <p>${So.normativity}</p> - ${n.length?So.keywordInterpretation(r,s):null} - `;e.prepend(...i.childNodes)}var Ao=Object.freeze({__proto__:null,name:Co,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&Lo(t,e),!t&&Object.keys(oo).length){Pt("Document uses RFC2119 keywords but lacks a conformance section.",Co,{hint:'Please add a `<section id="conformance">`.'})}}});function To(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){Nt(`Invalid ${t} name "${e}": ${o.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function Ro(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Nt(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const No=new Tt;function Po(e,t){for(const n of t)No.has(n)||No.set(n,new Set),No.get(n).add(e)}const jo="core/dfn",Do=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Ro}],["element",{requiresFor:!1,validator:To}],["element-attr",{requiresFor:!1,validator:To}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Ro}],["event",{requiresFor:!1,validator:Ro}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new nt(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return Nt(`Invalid ${t} "${e}": ${o.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:Ro}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Ro(e.slice(1,-1),t,n,r):(Nt(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Oo=[...Do.keys()];function zo(e,t){let n="";switch(!0){case Oo.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>Do.has(e))),function(e,t,n){const r=Do.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=zt`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,s=zt`Use a ${"[data-dfn-for]"} attribute to associate this with ${o}.`;Nt(e,jo,{hint:s,elements:[n]})}r.validator&&r.validator(e,t,n,jo)}(t,n,e);break;case wr.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=zt`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Nt(`Internal slot "${e}" must be associated with a WebIDL interface.`,jo,{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 o=["attribute","method"],{dfnType:s}=t.dataset;if(!o.includes(s)||r!==s){const n=zt`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,s=`The only allowed types are: ${Ot(o,{quotes:!0})}. The slot "${e}" seems to be a "${Dt(r)}"?`;return Nt(n,jo,{hint:s,elements:[t]}),"dfn"}return s}(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 Io(e){switch(!0){case e.matches(".export.no-export"):Nt(zt`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,jo,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Nt(zt`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,jo,{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 qo=Object.freeze({__proto__:null,name:jo,run:function(){for(const e of document.querySelectorAll("dfn")){const t=vt(e);if(Po(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;zo(e,n),Io(e),1===t.length&&n===mt(e.textContent)||(e.dataset.lt=t.join("|"))}}});var Mo=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=mt(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=mt(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=mt(n).toLowerCase(),o=rt.isSingular(r)?rt.plural(r):rt.singular(r);return e.has(o)&&!t.has(o)?o:""}}();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("|"),Po(e,n)}}))}});var Fo=String.raw`span.example-title{text-transform:none} + </p>`}});function To(e,t){const n=[...Object.keys(io)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=(o=n.sort(),[].concat(ut(o,(e=>Qe`<em class="rfc2119">${e}</em>`))).map((e=>"string"==typeof e?Qe`${e}`:e)));var o;const s=n.length>1,i=Qe` + <h1>${Ao.conformance}</h1> + <p>${Ao.normativity}</p> + ${n.length?Ao.keywordInterpretation(r,s):null} + `;e.prepend(...i.childNodes)}var Ro=Object.freeze({__proto__:null,name:Lo,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&To(t,e),!t&&Object.keys(io).length){Rt("Document uses RFC2119 keywords but lacks a conformance section.",Lo,{hint:'Please add a `<section id="conformance">`.'})}}});function No(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){Tt(`Invalid ${t} name "${e}": ${o.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function Po(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Tt(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const jo=new Lt;function Do(e,t){for(const n of t)jo.has(n)||jo.set(n,new Set),jo.get(n).add(e)}const Oo="core/dfn",zo=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Po}],["element",{requiresFor:!1,validator:No}],["element-attr",{requiresFor:!1,validator:No}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Po}],["event",{requiresFor:!1,validator:Po}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new et(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return Tt(`Invalid ${t} "${e}": ${o.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:Po}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Po(e.slice(1,-1),t,n,r):(Tt(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Io=[...zo.keys()];function qo(e,t){let n="";switch(!0){case Io.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>zo.has(e))),function(e,t,n){const r=zo.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=Dt`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,s=Dt`Use a ${"[data-dfn-for]"} attribute to associate this with ${o}.`;Tt(e,Oo,{hint:s,elements:[n]})}r.validator&&r.validator(e,t,n,Oo)}(t,n,e);break;case xr.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=Dt`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Tt(`Internal slot "${e}" must be associated with a WebIDL interface.`,Oo,{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 o=["attribute","method"],{dfnType:s}=t.dataset;if(!o.includes(s)||r!==s){const n=Dt`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,s=`The only allowed types are: ${jt(o,{quotes:!0})}. The slot "${e}" seems to be a "${Pt(r)}"?`;return Tt(n,Oo,{hint:s,elements:[t]}),"dfn"}return s}(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 Mo(e){switch(!0){case e.matches(".export.no-export"):Tt(Dt`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Oo,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Tt(Dt`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Oo,{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 Fo=Object.freeze({__proto__:null,name:Oo,run:function(){for(const e of document.querySelectorAll("dfn")){const t=yt(e);if(Do(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;qo(e,n),Mo(e),1===t.length&&n===ft(e.textContent)||(e.dataset.lt=t.join("|"))}}});var Bo=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=ft(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=ft(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=ft(n).toLowerCase(),o=tt.isSingular(r)?tt.plural(r):tt.singular(r);return e.has(o)&&!t.has(o)?o:""}}();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("|"),Do(e,n)}}))}});var Ho=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 Bo=gt({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"ģ˜ˆģ‹œ"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function Ho(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?Je`<span class="example-title">: ${n.title}</span>`:"";return Je`<div class="marker"> - <a class="self-link">${Bo.example}<bdi>${r}</bdi></a +aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff}`;const Wo=ht({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"ģ˜ˆģ‹œ"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function Uo(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?Qe`<span class="example-title">: ${n.title}</span>`:"";return Qe`<div class="marker"> + <a class="self-link">${Wo.example}<bdi>${r}</bdi></a >${o} - </div>`}var Wo=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(Je`<style> - ${Fo} - </style>`,document.querySelector("link"));let t=0;e.forEach((e=>{const n=e.classList.contains("illegal-example"),r={number:t,illegal:n},{title:o}=e;if("aside"===e.localName){++t;const n=Ho(e,t,r);e.prepend(n);const s=wt(e,"example",o||String(t));n.querySelector("a.self-link").href=`#${s}`}else{const n=!!e.closest("aside");n||++t,r.content=e.innerHTML,e.classList.remove("example","illegal-example");const s=e.id?e.id:null;s&&e.removeAttribute("id");const i=Ho(e,n?0:t,r),a=Je`<div class="example" id="${s}"> + </div>`}var Zo=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(Qe`<style> + ${Ho} + </style>`,document.querySelector("link"));let t=0;e.forEach((e=>{const n=e.classList.contains("illegal-example"),r={number:t,illegal:n},{title:o}=e;if("aside"===e.localName){++t;const n=Uo(e,t,r);e.prepend(n);const s=bt(e,"example",o||String(t));n.querySelector("a.self-link").href=`#${s}`}else{const n=!!e.closest("aside");n||++t,r.content=e.innerHTML,e.classList.remove("example","illegal-example");const s=e.id?e.id:null;s&&e.removeAttribute("id");const i=Uo(e,n?0:t,r),a=Qe`<div class="example" id="${s}"> ${i} ${e.cloneNode(!0)} - </div>`;wt(a,"example",o||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var Uo=String.raw`.issue-label{text-transform:initial} + </div>`;bt(a,"example",o||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var Vo=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} @@ -317,39 +317,39 @@ 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 Zo="core/issues-notes",Vo=gt({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:"č­¦å‘Š"}});function Ko(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}}(),o=document.createElement("ul");e.forEach((e=>{const{type:s,displayType:i,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),o=e.classList.contains("atrisk"),s=t?"issue":n?"warning":r?"ednote":"note",i=t?o?Vo.feature_at_risk:Vo.issue:n?Vo.warning:r?Vo.editors_note:Vo.note;return{type:s,displayType:i,isFeatureAtRisk:o}}(e),c="issue"===s,l="span"===e.localName,{number:u}=e.dataset,d={type:s,inline:l,title:e.title,number:r(e)};if(!l){const r=Je`<div class="${a?`${s} atrisk`:s}" role="${"note"===s?"note":null}"></div>`,l=document.createElement("span"),p=Je`<div role="heading" class="${`${s}-title marker`}">${l}</div>`;wt(p,"h",s);let f,h=i;if(e.id?(r.id=e.id,e.removeAttribute("id")):wt(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 Je`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return Je`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),f=t.get(u),!f){Pt(`Failed to fetch issue number ${u}.`,Zo)}f&&!d.title&&(d.title=f.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?Je`<span style="text-transform: none">: ${t.title}</span>`:"";return Je`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(Vo.issue,d,r.id))}if(l.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},o=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,o=new URL("./issues/",t);o.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const s=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[o,s,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*o+.7152*s+.0722*i>.179?"#000":"#fff"}(n),i=`background-color: #${n}; color: ${s}`,a=`GitHub label: ${r}`;return Je` <a +.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 Ko="core/issues-notes",Yo=ht({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:"č­¦å‘Š"}});function Xo(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}}(),o=document.createElement("ul");e.forEach((e=>{const{type:s,displayType:i,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),o=e.classList.contains("atrisk"),s=t?"issue":n?"warning":r?"ednote":"note",i=t?o?Yo.feature_at_risk:Yo.issue:n?Yo.warning:r?Yo.editors_note:Yo.note;return{type:s,displayType:i,isFeatureAtRisk:o}}(e),c="issue"===s,l="span"===e.localName,{number:u}=e.dataset,d={type:s,inline:l,title:e.title,number:r(e)};if(!l){const r=Qe`<div class="${a?`${s} atrisk`:s}" role="${"note"===s?"note":null}"></div>`,l=document.createElement("span"),p=Qe`<div role="heading" class="${`${s}-title marker`}">${l}</div>`;bt(p,"h",s);let f,h=i;if(e.id?(r.id=e.id,e.removeAttribute("id")):bt(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 Qe`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return Qe`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),f=t.get(u),!f){Rt(`Failed to fetch issue number ${u}.`,Ko)}f&&!d.title&&(d.title=f.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?Qe`<span style="text-transform: none">: ${t.title}</span>`:"";return Qe`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(Yo.issue,d,r.id))}if(l.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},o=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,o=new URL("./issues/",t);o.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const s=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[o,s,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*o+.7152*s+.0722*i>.179?"#000":"#fff"}(n),i=`background-color: #${n}; color: ${s}`,a=`GitHub label: ${r}`;return Qe` <a class="respec-gh-label" style="${i}" href="${o.href}" aria-label="${a}" >${r}</a - >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return Je`<span class="issue-label">: ${t}${r}</span>`}(o,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(s),m.removeAttribute("data-number"),f&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(f.bodyHTML)),r.append(p,m);const g=_t(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(Je`<p>${Vo.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${Vo.issue_summary}</h1>`)}(o)}var Yo=Object.freeze({__proto__:null,name:Zo,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 Nt(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,Zo),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github),{head:o}=document;o.insertBefore(Je`<style> - ${Uo} - </style>`,o.querySelector("link")),Ko(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const Xo="core/best-practices",Qo={en:{best_practice:"Best Practice "},ja:{best_practice:"꜀č‰Æå®Ÿę–½ä¾‹ "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"ęœ€ä½³å®žč·µ "}},Go=gt(Qo),Jo=l in Qo?l:"en";var es=Object.freeze({__proto__:null,name:Xo,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=wt(e,"bp"),o=Je`<a class="marker self-link" href="${`#${r}`}" - ><bdi lang="${Jo}">${Go.best_practice}${t+1}</bdi></a - >`;if(n){const t=Je`<li>${o}: ${St(e)}</li>`;n.appendChild(t)}const s=e.closest("div");if(!s)return void e.classList.add("advisement");s.classList.add("advisement");const i=Je`${o.cloneNode(!0)}: ${e}`;s.prepend(...i.childNodes)})),e.length)t&&(t.appendChild(Je`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){Pt("Using best practices summary (#bp-summary) but no best practices found.",Xo),t.remove()}}});const ts="core/figures",ns=gt({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 rs=Object.freeze({__proto__:null,name:ts,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;wt(e,"fig",r),$t(t,Je`<span class="fig-title"></span>`),t.prepend(Je`<a class="self-link" href="#${e.id}" - >${ns.fig}<bdi class="figno">${n+1}</bdi></a - >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{xt(e,"span").removeAttribute("href")})),Je`<li class="tofline"> + >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return Qe`<span class="issue-label">: ${t}${r}</span>`}(o,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(s),m.removeAttribute("data-number"),f&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(f.bodyHTML)),r.append(p,m);const g=kt(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(Qe`<p>${Yo.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${Yo.issue_summary}</h1>`)}(o)}var Qo=Object.freeze({__proto__:null,name:Ko,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 Tt(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,Ko),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github),{head:o}=document;o.insertBefore(Qe`<style> + ${Vo} + </style>`,o.querySelector("link")),Xo(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const Go="core/best-practices",Jo={en:{best_practice:"Best Practice "},ja:{best_practice:"꜀č‰Æå®Ÿę–½ä¾‹ "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"ęœ€ä½³å®žč·µ "}},es=ht(Jo),ts=s in Jo?s:"en";var ns=Object.freeze({__proto__:null,name:Go,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=bt(e,"bp"),o=Qe`<a class="marker self-link" href="${`#${r}`}" + ><bdi lang="${ts}">${es.best_practice}${t+1}</bdi></a + >`;if(n){const t=Qe`<li>${o}: ${Et(e)}</li>`;n.appendChild(t)}const s=e.closest("div");if(!s)return void e.classList.add("advisement");s.classList.add("advisement");const i=Qe`${o.cloneNode(!0)}: ${e}`;s.prepend(...i.childNodes)})),e.length)t&&(t.appendChild(Qe`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){Rt("Using best practices summary (#bp-summary) but no best practices found.",Go),t.remove()}}});const rs="core/figures",os=ht({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 ss=Object.freeze({__proto__:null,name:rs,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;bt(e,"fig",r),xt(t,Qe`<span class="fig-title"></span>`),t.prepend(Qe`<a class="self-link" href="#${e.id}" + >${os.fig}<bdi class="figno">${n+1}</bdi></a + >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{wt(e,"span").removeAttribute("href")})),Qe`<li class="tofline"> <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a> - </li>`}(t.id,r));else{Pt("Found a `<figure>` without a `<figcaption>`.",ts,{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=function(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}(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(Je`<h1>${ns.list_of_figures}</h1>`,Je`<ul class="tof"> + </li>`}(t.id,r));else{Rt("Found a `<figure>` without a `<figcaption>`.",rs,{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=function(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}(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(Qe`<h1>${os.list_of_figures}</h1>`,Qe`<ul class="tof"> ${e} - </ul>`))}});const os="core/data-cite",ss="__SPEC__";async function is(e){const{key:t,frag:n,path:r,href:o}=e;let s="",i="";if(t===ss)s=document.location.href;else{const e=await Wr(t);if(!e)return null;s=e.href,i=e.title}if(o)s=o;else{if(r){const e=r.startsWith("/")?`.${r}`:r;s=new URL(e,s).href}n&&(s=new URL(n,s).href)}return{href:s,title:i}}function as(e,t,n){const{href:r,title:o}=t,s=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=o),t.href=r,s){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?$t(e,t):(t.textContent=o,e.append(t)),s){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Nt("Exporting a linked external definition is not allowed.",os,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function cs(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const ls=cs("#"),us=cs("/");function ds(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:o,citeHref:s}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:o,isNormative:s}=r?ds(r):{key:ss,isNormative:!1};return t.cite=s?o:`?${o}`,t.citeFrag=n.replace("#",""),ds(e)}const i=r?`#${r}`:ls(n),a=o||us(n).split("#")[0],{type:c}=kt(n,e),l="normative"===c,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:i,path:a,href:s}}function ps(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 fs=Object.freeze({__proto__:null,THIS_SPEC:ss,name:os,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(ds).map((async e=>({entry:e,result:await Wr(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await Hr(n);r&&Object.assign(Ir,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=ds(t),r=await is(n);if(r)as(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),Pt(n,os,{elements:[t]})}}s("beforesave",ps)},toCiteDetails:ds});const hs="core/link-to-dfn",ms=[],gs={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:"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚"}},bs=gt(gs);function ys(e){const t=new Map,n=[];for(const r of No.get(e)){const{dfnType:o="dfn"}=r.dataset,s=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const i of s){if(t.has(i)&&t.get(i).has(o)){const e=t.get(i).get(o),s="dfn"===e.localName,a="dfn"===r.localName,c=o===(e.dataset.dfnType||"dfn"),l=!i&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(i);if(s&&a&&c&&l){n.push(r);continue}}t.has(i)||t.set(i,new Map),t.get(i).set(o,r),("idl"in r.dataset||"dfn"!==o)&&t.get(i).set("idl",r),wt(r,"dfn",e)}}return{result:t,duplicates:n}}function ws(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=vt(e).reduce(((e,r)=>{const o=r.split(".");return 2===o.length&&e.push({for:o[0],title:o[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 o=t.get(r.title).get(r.for),{linkType:s}=e.dataset;if(s){for(const e of s.split("|"))if(o.get(e))return o.get(e);return o.get("dfn")}{const e=r.for?"idl":"dfn";return o.get(e)||o.get("idl")}}function vs(e,t,n){let r=!1;const{linkFor:o}=e.dataset,{dfnFor:s}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(o&&!n.get(o)&&s&&!s.split(",").map((e=>e.trim())).includes(o))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"),o=xs(e)&&xs(t,n);r&&!o||$t(e,document.createElement("code"))}(e,t),!r}function xs(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 ks(e){e.forEach((e=>{Pt(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,hs,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var $s=Object.freeze({__proto__:null,name:hs,possibleExternalLinks:ms,run:async function(e){const t=function(){const e=new Tt;for(const t of No.keys()){const{result:n,duplicates:r}=ys(t);e.set(t,n),r.length>0&&Nt(bs.duplicateMsg(t),hs,{title:bs.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){ms.push(e);continue}const r=ws(e,t);if(r){vs(e,r,t)||ms.push(e)}else""===e.dataset.cite?n.push(e):ms.push(e)}ks(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${ss}$2`);const{key:r,isNormative:o}=ds(t);r!==ss&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||ks(ms)}});const _s="core/contrib";var Es=Object.freeze({__proto__:null,name:_s,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Nt(zt`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,_s)}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 o();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 Je(t)`${n.map((({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`))}`;const r=n.map((e=>e.name||e.login));t.textContent=ht(r)}(r,n):n.textContent="Failed to fetch contributors.";async function o(){const{href:n}=new URL("contributors",t);try{const t=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let o,s;if("caches"in window)try{if(o=await caches.open(r.origin),s=await o.match(n),s&&new Date(s.headers.get("Expires"))>new Date)return s}catch(e){console.error("Failed to use Cache API.",e)}const i=await fetch(n);if(!i.ok&&s)return console.warn(`Returning a stale cached response for ${r}`),s;if(o&&i.ok){const e=i.clone(),r=new Headers(i.headers),s=new Date(Date.now()+t);r.set("Expires",s.toISOString());const a=new Response(await e.blob(),{headers:r});await o.put(n,a).catch(console.error)}return i}(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 Nt("Error loading contributors from GitHub.",_s),console.error(e),null}}}(t,n)}});var Cs=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);xt(e,`h${t}`)}))}});const Ss=["h2","h3","h4","h5","h6"],Ls="core/structure",As=gt({en:{toc:"Table of Contents"},zh:{toc:"内容大ēŗ²"},ko:{toc:"ėŖ©ģ°Ø"},ja:{toc:"ē›®ę¬”"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Ts(e,t,{prefix:n=""}={}){let r=!1,o=0,s=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const i=Je`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=s,r=!0);let e=a.isIntro?"":r?Rs(s-o+1):n+s;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(s+=1,a.header.prepend(Je`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=Ps(a.header,n),o=Ts(a.subsections,t,{prefix:e});o&&r.append(o),i.append(r)}}return i}function Rs(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Ns(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(!Ss.includes(r.localName))continue;const o=r.textContent;wt(e,null,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Ns(e)})}return n}function Ps(e,t){const n=Je`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=xt(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{xt(e,"span").removeAttribute("id")})),Je`<li class="tocline">${n}</li>`}var js=Object.freeze({__proto__:null,name:Ls,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(_t(e,"section").length+1,6)}`;e.localName!==t&&xt(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)){Nt("`data-max-toc` must have a value between 0-6 (inclusive).",Ls,{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=Ts(Ns(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=Je`<nav id="toc"></nav>`,n=Je`<h2 class="introductory">${As.toc}</h2>`;wt(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 o=Je`<p role="navigation" id="back-to-top"> + </ul>`))}});const is="core/data-cite",as="__SPEC__";async function cs(e){const{key:t,frag:n,path:r,href:o}=e;let s="",i="";if(t===as)s=document.location.href;else{const e=await Zr(t);if(!e)return null;s=e.href,i=e.title}if(o)s=o;else{if(r){const e=r.startsWith("/")?`.${r}`:r;s=new URL(e,s).href}n&&(s=new URL(n,s).href)}return{href:s,title:i}}function ls(e,t,n){const{href:r,title:o}=t,s=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=o),t.href=r,s){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?xt(e,t):(t.textContent=o,e.append(t)),s){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Tt("Exporting a linked external definition is not allowed.",is,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function us(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const ds=us("#"),ps=us("/");function fs(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:o,citeHref:s}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:o,isNormative:s}=r?fs(r):{key:as,isNormative:!1};return t.cite=s?o:`?${o}`,t.citeFrag=n.replace("#",""),fs(e)}const i=r?`#${r}`:ds(n),a=o||ps(n).split("#")[0],{type:c}=vt(n,e),l="normative"===c,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:i,path:a,href:s}}function hs(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 ms=Object.freeze({__proto__:null,THIS_SPEC:as,name:is,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(fs).map((async e=>({entry:e,result:await Zr(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await Ur(n);r&&Object.assign(Mr,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=fs(t),r=await cs(n);if(r)ls(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),Rt(n,is,{elements:[t]})}}qt("beforesave",hs)},toCiteDetails:fs});const gs="core/link-to-dfn",bs=[],ys={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:"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚"}},ws=ht(ys);function vs(e){const t=new Map,n=[];for(const r of jo.get(e)){const{dfnType:o="dfn"}=r.dataset,s=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const i of s){if(t.has(i)&&t.get(i).has(o)){const e=t.get(i).get(o),s="dfn"===e.localName,a="dfn"===r.localName,c=o===(e.dataset.dfnType||"dfn"),l=!i&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(i);if(s&&a&&c&&l){n.push(r);continue}}t.has(i)||t.set(i,new Map),t.get(i).set(o,r),("idl"in r.dataset||"dfn"!==o)&&t.get(i).set("idl",r),bt(r,"dfn",e)}}return{result:t,duplicates:n}}function xs(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=yt(e).reduce(((e,r)=>{const o=r.split(".");return 2===o.length&&e.push({for:o[0],title:o[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 o=t.get(r.title).get(r.for),{linkType:s}=e.dataset;if(s){for(const e of s.split("|"))if(o.get(e))return o.get(e);return o.get("dfn")}{const e=r.for?"idl":"dfn";return o.get(e)||o.get("idl")}}function ks(e,t,n){let r=!1;const{linkFor:o}=e.dataset,{dfnFor:s}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(o&&!n.get(o)&&s&&!s.split(",").map((e=>e.trim())).includes(o))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"),o=$s(e)&&$s(t,n);r&&!o||xt(e,document.createElement("code"))}(e,t),!r}function $s(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 _s(e){e.forEach((e=>{Rt(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,gs,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var Es=Object.freeze({__proto__:null,name:gs,possibleExternalLinks:bs,run:async function(e){const t=function(){const e=new Lt;for(const t of jo.keys()){const{result:n,duplicates:r}=vs(t);e.set(t,n),r.length>0&&Tt(ws.duplicateMsg(t),gs,{title:ws.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){bs.push(e);continue}const r=xs(e,t);if(r){ks(e,r,t)||bs.push(e)}else""===e.dataset.cite?n.push(e):bs.push(e)}_s(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${as}$2`);const{key:r,isNormative:o}=fs(t);r!==as&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||_s(bs)}});const Cs="core/contrib";var Ss=Object.freeze({__proto__:null,name:Cs,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Tt(Dt`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Cs)}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 o();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 Qe(t)`${n.map((({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`))}`;const r=n.map((e=>e.name||e.login));t.textContent=pt(r)}(r,n):n.textContent="Failed to fetch contributors.";async function o(){const{href:n}=new URL("contributors",t);try{const t=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let o,s;if("caches"in window)try{if(o=await caches.open(r.origin),s=await o.match(n),s&&new Date(s.headers.get("Expires"))>new Date)return s}catch(e){console.error("Failed to use Cache API.",e)}const i=await fetch(n);if(!i.ok&&s)return console.warn(`Returning a stale cached response for ${r}`),s;if(o&&i.ok){const e=i.clone(),r=new Headers(i.headers),s=new Date(Date.now()+t);r.set("Expires",s.toISOString());const a=new Response(await e.blob(),{headers:r});await o.put(n,a).catch(console.error)}return i}(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 Tt("Error loading contributors from GitHub.",Cs,{cause:e}),null}}}(t,n)}});var Ls=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);wt(e,`h${t}`)}))}});const As=["h2","h3","h4","h5","h6"],Ts="core/structure",Rs=ht({en:{toc:"Table of Contents"},zh:{toc:"内容大ēŗ²"},ko:{toc:"ėŖ©ģ°Ø"},ja:{toc:"ē›®ę¬”"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Ns(e,t,{prefix:n=""}={}){let r=!1,o=0,s=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const i=Qe`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=s,r=!0);let e=a.isIntro?"":r?Ps(s-o+1):n+s;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(s+=1,a.header.prepend(Qe`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=Ds(a.header,n),o=Ns(a.subsections,t,{prefix:e});o&&r.append(o),i.append(r)}}return i}function Ps(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function js(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(!As.includes(r.localName))continue;const o=r.textContent;bt(e,null,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:js(e)})}return n}function Ds(e,t){const n=Qe`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=wt(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{wt(e,"span").removeAttribute("id")})),Qe`<li class="tocline">${n}</li>`}var Os=Object.freeze({__proto__:null,name:Ts,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(kt(e,"section").length+1,6)}`;e.localName!==t&&wt(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)){Tt("`data-max-toc` must have a value between 0-6 (inclusive).",Ts,{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=Ns(js(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=Qe`<nav id="toc"></nav>`,n=Qe`<h2 class="introductory">${Rs.toc}</h2>`;bt(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 o=Qe`<p role="navigation" id="back-to-top"> <a href="#title"><abbr title="Back to Top">↑</abbr></a> - </p>`;document.body.append(o)}(t)}o("toc")}});const Ds=gt({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:"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚"}});var Os=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(Je`<p><em>${Ds.informative}</em></p>`)}))}});const zs=gt({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${mt(t.textContent)}`),n}}});var Is=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||(wt(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=zs.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=Je`<div class="header-wrapper"></div>`;n.replaceWith(o);const s=Je`<a + </p>`;document.body.append(o)}(t)}It("toc")}});const zs=ht({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:"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚"}});var Is=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(Qe`<p><em>${zs.informative}</em></p>`)}))}});const qs=ht({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${ft(t.textContent)}`),n}}});var Ms=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||(bt(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=qs.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=Qe`<div class="header-wrapper"></div>`;n.replaceWith(o);const s=Qe`<a href="#${t}" class="self-link" aria-label="${r}" - ></a>`;o.append(n,s)}}});const qs="ui/save-html",Ms=gt({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"äæå­˜ć™ć‚‹"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"åƼå‡ŗ"}}),Fs=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return Mt(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return Mt(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}}];function Bs(e,t){const{id:n,href:r,ext:o,title:s,type:i}=e,a=function(e,t=""){return st.format(e).replace(ot,t)}(t.publishDate||new Date),c=[t.specStatus,t.shortName||"spec",a].join("-");return Je`<a + ></a>`;o.append(n,s)}}});const Fs="ui/save-html",Bs=ht({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"äæå­˜ć™ć‚‹"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"åƼå‡ŗ"}}),Hs=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return Bt(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return Bt(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}}];function Ws(e,t){const{id:n,href:r,ext:o,title:s,type:i}=e,a=function(e,t=""){return rt.format(e).replace(nt,t)}(t.publishDate||new Date),c=[t.specStatus,t.shortName||"spec",a].join("-");return Qe`<a href="${r}" id="${n}" download="${c}.${o}" type="${i}" class="respec-save-button" - onclick=${()=>yn.closeModal()} + onclick=${()=>vn.closeModal()} >${s}</a - >`}var Hs=Object.freeze({__proto__:null,exportDocument:function(e,t){return Pt("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",qs,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),Mt(t)},name:qs,run:function(e){const t={async show(t){await document.respec.ready;const n=Je`<div class="respec-save-buttons"> - ${Fs.map((t=>Bs(t,e)))} - </div>`;yn.freshModal(Ms.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=yn.addCommand(Ms.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","šŸ’¾"))}});const Ws=gt({en:{about_respec:"About"},zh:{about_respec:"关äŗŽ"},nl:{about_respec:"Over"},ja:{about_respec:"ć“ć‚Œć«ć¤ć„ć¦"},de:{about_respec:"Ɯber"}});window.respecVersion=window.respecVersion||"Developer Edition";const Us=document.createElement("div"),Zs=Je.bind(Us),Vs=yn.addCommand(`${Ws.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(Ks).forEach((t=>{e.push(t)}));Zs` + >`}var Us=Object.freeze({__proto__:null,exportDocument:function(e,t){return Rt("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",Fs,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),Bt(t)},name:Fs,run:function(e){const t={async show(t){await document.respec.ready;const n=Qe`<div class="respec-save-buttons"> + ${Hs.map((t=>Ws(t,e)))} + </div>`;vn.freshModal(Bs.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=vn.addCommand(Bs.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","šŸ’¾"))}});const Zs=ht({en:{about_respec:"About"},zh:{about_respec:"关äŗŽ"},nl:{about_respec:"Over"},ja:{about_respec:"ć“ć‚Œć«ć¤ć„ć¦"},de:{about_respec:"Ɯber"}});window.respecVersion=window.respecVersion||"Developer Edition";const Vs=document.createElement("div"),Ks=Qe.bind(Vs),Ys=vn.addCommand(`${Zs.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(Xs).forEach((t=>{e.push(t)}));Ks` <p> ReSpec is a document production toolchain, with a notable focus on W3C specifications. </p> @@ -373,15 +373,15 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} </thead> <tbody>${e}</tbody> </table> -`,yn.freshModal(`${Ws.about_respec} - ${window.respecVersion}`,Us,Vs)}),"Ctrl+Shift+Alt+A","ā„¹ļø");function Ks({name:e,duration:t}){return Je` +`,vn.freshModal(`${Zs.about_respec} - ${window.respecVersion}`,Vs,Ys)}),"Ctrl+Shift+Alt+A","ā„¹ļø");function Xs({name:e,duration:t}){return Qe` <tr> <td><a href="${`https://github.com/speced/respec/blob/develop/src/${e}.js`}">${e}</a></td> <td>${t}</td> </tr> - `}var Ys=Object.freeze({__proto__:null});var Xs=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=Je`<meta + `}var Qs=Object.freeze({__proto__:null});var Gs=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=Qe`<meta name="revision" content="${e.gitRevision}" - />`;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)}});var Qs=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)}});var Js=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} } @@ -396,9 +396,9 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} .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 Gs(t){const n=await fetch(new URL(`../../${t}`,e&&e.src||new URL("respec-dini.js",document.baseURI).href));return await n.text()}const Js=lt({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(Js);const ei=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return ia}))).default}catch{return Gs("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();n("core/worker",ei.then((e=>({worker:e}))));const ti=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function ni(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:ti(),languages:t},r=await ei;return r.postMessage(n),new Promise(((e,t)=>{const o=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(s){const{data:{id:i,language:a,value:c}}=s;i===n.id&&(r.removeEventListener("message",t),clearTimeout(o),e({language:a,value:c}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:o,value:s}=r;switch(e.localName){case"pre":e.classList.remove(o),e.innerHTML=`<code class="hljs${o?` ${o}`:""}">${s}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=s,e.classList.add("hljs"),o&&e.classList.add(o)}e.setAttribute("aria-busy","false")}var ri=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(ni);document.head.appendChild(Je`<style> - ${Qs} - </style>`),await Promise.all(n)}});const oi="core/list-sorter";function si(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function ii(e,t){return[...e.querySelectorAll(":scope > li")].sort(si(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function ai(e,t){return[...e.querySelectorAll(":scope > dt")].sort(si(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,o=document.createDocumentFragment();let{nextSibling:s}=t;for(;s&&s.nextSibling;){o.appendChild(s.cloneNode(!0));const{nodeType:e,nodeName:t}=s.nextSibling;if(e===n&&t===r)break;s=s.nextSibling}return o.prepend(t.cloneNode(!0)),e.appendChild(o),e}),document.createDocumentFragment())}var ci=Object.freeze({__proto__:null,name:oi,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=ai(t,n);break;case"ol":case"ul":e=ii(t,n);break;default:Pt(`ReSpec can't sort ${t.localName} elements.`,oi,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:ai,sortListItems:ii});var li=String.raw`var:hover{text-decoration:underline;cursor:pointer} +.hljs-link{text-decoration:underline}`;async function ei(t){const n=await fetch(new URL(`../../${t}`,e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-dini.js",document.baseURI).href));return await n.text()}const ti=at({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(ti);const ni=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return ca}))).default}catch{return ei("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();n("core/worker",ni.then((e=>({worker:e}))));const ri=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function oi(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:ri(),languages:t},r=await ni;return r.postMessage(n),new Promise(((e,t)=>{const o=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(s){const{data:{id:i,language:a,value:c}}=s;i===n.id&&(r.removeEventListener("message",t),clearTimeout(o),e({language:a,value:c}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:o,value:s}=r;switch(e.localName){case"pre":e.classList.remove(o),e.innerHTML=`<code class="hljs${o?` ${o}`:""}">${s}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=s,e.classList.add("hljs"),o&&e.classList.add(o)}e.setAttribute("aria-busy","false")}var si=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(oi);document.head.appendChild(Qe`<style> + ${Js} + </style>`),await Promise.all(n)}});const ii="core/list-sorter";function ai(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function ci(e,t){return[...e.querySelectorAll(":scope > li")].sort(ai(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function li(e,t){return[...e.querySelectorAll(":scope > dt")].sort(ai(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,o=document.createDocumentFragment();let{nextSibling:s}=t;for(;s&&s.nextSibling;){o.appendChild(s.cloneNode(!0));const{nodeType:e,nodeName:t}=s.nextSibling;if(e===n&&t===r)break;s=s.nextSibling}return o.prepend(t.cloneNode(!0)),e.appendChild(o),e}),document.createDocumentFragment())}var ui=Object.freeze({__proto__:null,name:ii,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=li(t,n);break;case"ol":case"ul":e=ci(t,n);break;default:Rt(`ReSpec can't sort ${t.localName} elements.`,ii,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:li,sortListItems:ci});var di=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)} @@ -412,15 +412,15 @@ 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} -}`;function ui(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=mt(e.textContent),n=e.closest(".algorithm, section"),r=pi(e),o=[...n.querySelectorAll("var")].filter((e=>mt(e.textContent)===t&&e.closest(".algorithm, section")===n)),s=o[0].classList.contains("respec-hl");if(di.set(r,s),s)return o.forEach((e=>fi(e,r))),[];o.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return o}(t),r=()=>{const e=pi(t);n.forEach((t=>fi(t,e))),[...di.keys()].forEach((e=>di.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const di=new Map([["respec-hl-c1",!0],["respec-hl-c2",!0],["respec-hl-c3",!0],["respec-hl-c4",!0],["respec-hl-c5",!0],["respec-hl-c6",!0],["respec-hl-c7",!0]]);function pi(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===di.get("respec-hl-c1")?"respec-hl-c1":[...di.keys()].find((e=>di.get(e)))||"respec-hl-c1"}function fi(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var hi=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=li,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",ui))),s("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(fi)}))}});var mi=String.raw`var{position:relative;cursor:pointer} +}`;function pi(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=ft(e.textContent),n=e.closest(".algorithm, section"),r=hi(e),o=[...n.querySelectorAll("var")].filter((e=>ft(e.textContent)===t&&e.closest(".algorithm, section")===n)),s=o[0].classList.contains("respec-hl");if(fi.set(r,s),s)return o.forEach((e=>mi(e,r))),[];o.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return o}(t),r=()=>{const e=hi(t);n.forEach((t=>mi(t,e))),[...fi.keys()].forEach((e=>fi.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const fi=new Map([["respec-hl-c1",!0],["respec-hl-c2",!0],["respec-hl-c3",!0],["respec-hl-c4",!0],["respec-hl-c5",!0],["respec-hl-c6",!0],["respec-hl-c7",!0]]);function hi(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===fi.get("respec-hl-c1")?"respec-hl-c1":[...fi.keys()].find((e=>fi.get(e)))||"respec-hl-c1"}function mi(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var gi=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=di,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",pi))),qt("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(mi)}))}});var bi=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 gi=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=mi,document.head.appendChild(t);let n=null;const r=new Map,o=document.querySelectorAll("section var");for(const e of o){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 o=r.get(e.textContent.trim());o&&(e.dataset.type=o)}}});var bi=String.raw`:root{--assertion-border:#aaa;--assertion-bg:#eee;--assertion-text:black} +var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var yi=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=bi,document.head.appendChild(t);let n=null;const r=new Map,o=document.querySelectorAll("section var");for(const e of o){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 o=r.get(e.textContent.trim());o&&(e.dataset.type=o)}}});var wi=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 yi=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(Je`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=bi,document.head.appendChild(t)}});const wi="core/anchor-expander";function vi(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Nt(`Found matching element "${t}", but it has no title or marker.`,wi,{title:"Missing title.",elements:[n]})}const o=St(r);n.append(...o.childNodes),n.classList.add("box-ref")}function xi(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Nt(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,wi,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...St(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...o),n.classList.add("fig-ref");const s=r.querySelector(".fig-title");!n.hasAttribute("title")&&s&&(n.title=mt(s.textContent))}function ki(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Nt(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,wi,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...St(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...o),n.classList.add("table-ref");const s=r.querySelector(".table-title");!n.hasAttribute("title")&&s&&(n.title=mt(s.textContent))}function $i(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)_i(r,n),Ei(r,n);else{n.textContent=n.getAttribute("href");Nt("Found matching section, but the section was lacking a heading element.",wi,{title:`No matching id in document: "${t}".`,elements:[n]})}}function _i(e,t){const n=e.querySelector(".self-link"),r=[...St(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=xt(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function Ei(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const o=t.closest(`[${n}]`);o&&o.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var Ci=Object.freeze({__proto__:null,name:wi,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":_i(n,t);break;case"section":$i(n,e,t);break;case"figure":xi(n,e,t);break;case"table":ki(n,e,t);break;case"aside":case"div":vi(n,e,t);break;default:t.textContent=t.getAttribute("href");Nt("ReSpec doesn't support expanding this kind of reference.",wi,{title:`Can't expand "#${e}".`,elements:[t]})}Ei(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Nt(`Couldn't expand inline reference. The id "${e}" is not in the document.`,wi,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var Si=String.raw`dfn{cursor:pointer} +}`;var vi=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(Qe`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=wi,document.head.appendChild(t)}});const xi="core/anchor-expander";function ki(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Tt(`Found matching element "${t}", but it has no title or marker.`,xi,{title:"Missing title.",elements:[n]})}const o=Et(r);n.append(...o.childNodes),n.classList.add("box-ref")}function $i(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Tt(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,xi,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...Et(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...o),n.classList.add("fig-ref");const s=r.querySelector(".fig-title");!n.hasAttribute("title")&&s&&(n.title=ft(s.textContent))}function _i(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Tt(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,xi,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...Et(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...o),n.classList.add("table-ref");const s=r.querySelector(".table-title");!n.hasAttribute("title")&&s&&(n.title=ft(s.textContent))}function Ei(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)Ci(r,n),Si(r,n);else{n.textContent=n.getAttribute("href");Tt("Found matching section, but the section was lacking a heading element.",xi,{title:`No matching id in document: "${t}".`,elements:[n]})}}function Ci(e,t){const n=e.querySelector(".self-link"),r=[...Et(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=wt(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function Si(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const o=t.closest(`[${n}]`);o&&o.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var Li=Object.freeze({__proto__:null,name:xi,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":Ci(n,t);break;case"section":Ei(n,e,t);break;case"figure":$i(n,e,t);break;case"table":_i(n,e,t);break;case"aside":case"div":ki(n,e,t);break;default:t.textContent=t.getAttribute("href");Tt("ReSpec doesn't support expanding this kind of reference.",xi,{title:`Can't expand "#${e}".`,elements:[t]})}Si(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Tt(`Couldn't expand inline reference. The id "${e}" is not in the document.`,xi,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var Ai=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} @@ -437,7 +437,7 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var gi=Obje .dfn-panel a[href]:hover{border-bottom-width:1px} .dfn-panel ul{padding:0} .dfn-panel li{margin-left:1em} -.dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto}`;function Li(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),o=`dfn-panel-for-${e.id}`,s=e.getAttribute("aria-label")||mt(e.textContent),i=Je` +.dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto}`;function Ti(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),o=`dfn-panel-for-${e.id}`,s=e.getAttribute("aria-label")||ft(e.textContent),i=Qe` <div class="dfn-panel" id="${o}" @@ -454,11 +454,11 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var gi=Obje aria-label="Permalink for definition: ${s}. Activate to close this dialog." >Permalink</a > - ${function(e){return e.matches("dfn[data-export]")?Je`<span + ${function(e){return e.matches("dfn[data-export]")?Qe`<span class="marker dfn-exported" title="Definition can be referenced by other specifications" >exported</span - >`:null}(e)} ${function(e,t){if(!e.hasAttribute("data-idl"))return null;for(const n of t){if(n.dataset.linkType!==e.dataset.dfnType)continue;const t=n.closest("pre.idl");if(t&&t.id){const e=`#${t.id}`;return Je`<a + >`:null}(e)} ${function(e,t){if(!e.hasAttribute("data-idl"))return null;for(const n of t){if(n.dataset.linkType!==e.dataset.dfnType)continue;const t=n.closest("pre.idl");if(t&&t.id){const e=`#${t.id}`;return Qe`<a href="${e}" class="marker idl-block" title="Jump to IDL declaration" @@ -466,20 +466,20 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var gi=Obje >`}}return null}(e,r)} </div> <p><b>Referenced in:</b></p> - ${function(e,t){if(!t.length)return Je`<ul> + ${function(e,t){if(!t.length)return Qe`<ul> <li>Not referenced in this document.</li> - </ul>`;const n=new Map;t.forEach(((t,r)=>{const o=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=o);const s=function(e){const t=e.closest("section");if(!t)return null;const n=t.querySelector("h1, h2, h3, h4, h5, h6");return n?`Ā§ ${mt(n.textContent)}`:null}(t);(n.get(s)||n.set(s,[]).get(s)).push(o)}));const r=([e,t])=>[{title:e,id:t[0],text:e}].concat(t.slice(1).map(((e,t)=>({title:`Reference ${t+2}`,text:`(${t+2})`,id:e})))),o=e=>Je`<li> - ${r(e).map((e=>Je`<a href="#${e.id}" title="${e.title}">${e.text}</a + </ul>`;const n=new Map;t.forEach(((t,r)=>{const o=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=o);const s=function(e){const t=e.closest("section");if(!t)return null;const n=t.querySelector("h1, h2, h3, h4, h5, h6");return n?`Ā§ ${ft(n.textContent)}`:null}(t);(n.get(s)||n.set(s,[]).get(s)).push(o)}));const r=([e,t])=>[{title:e,id:t[0],text:e}].concat(t.slice(1).map(((e,t)=>({title:`Reference ${t+2}`,text:`(${t+2})`,id:e})))),o=e=>Qe`<li> + ${r(e).map((e=>Qe`<a href="#${e.id}" title="${e.title}">${e.text}</a >${" "}`))} - </li>`;return Je`<ul> + </li>`;return Qe`<ul> ${[...n].map(o)} </ul>`}(t,r)} </div> - `;return i}var Ai=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(Je`<style> - ${Si} - </style>`,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(Li(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");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 aa}))).default}catch{return Gs("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Ti=new Promise(((e,t)=>{}));gt({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"ģ°øģ—¬"},zh:{file_a_bug:"反馈错čÆÆ",participate:"参äøŽļ¼š"},ja:{commit_history:"å¤‰ę›“å±„ę­“",file_a_bug:"問锌報告",participate:"å‚åŠ ę–¹ę³•ļ¼š"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});const Ri="rs-changelog",Ni=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;Je.bind(this)` + `;return i}var Ri=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(Qe`<style> + ${Ai} + </style>`,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(Ti(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");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 la}))).default}catch{return ei("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Ni=new Promise(((e,t)=>{}));ht({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"ģ°øģ—¬"},zh:{file_a_bug:"反馈错čÆÆ",participate:"参äøŽļ¼š"},ja:{commit_history:"å¤‰ę›“å±„ę­“",file_a_bug:"問锌報告",participate:"å‚åŠ ę–¹ę³•ļ¼š"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});const Pi="rs-changelog",ji=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;Qe.bind(this)` <ul> - ${{any:Pi(e,t,n).then((e=>async function(e){const{repoURL:t}=await Ti;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),o=`${t}commit/${e.hash}`,s=r&&Je` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return Je`<li><a href="${o}">${n.trim()}</a>${s}</li>`}))}(e))).catch((e=>Nt(e.message,Ri,{elements:[this]}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}} + ${{any:Di(e,t,n).then((e=>async function(e){const{repoURL:t}=await Ni;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),o=`${t}commit/${e.hash}`,s=r&&Qe` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return Qe`<li><a href="${o}">${n.trim()}</a>${s}</li>`}))}(e))).catch((e=>Tt(e.message,Pi,{elements:[this],cause:e}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}} </ul> - `}};async function Pi(e,t,n){let r;try{const o=await Ti;if(!o)throw new Error("`respecConfig.github` is not set");const s=new URL("commits",`${o.apiBase}/${o.fullName}/`);s.searchParams.set("from",e),s.searchParams.set("to",t);const i=await fetch(s.href);if(!i.ok)throw new Error(`Request to ${s} failed with status code ${i.status}`);if(r=await i.json(),!r.length)throw new Error(`No commits between ${e}..${t}.`);r=r.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw console.error(e),new Error(t)}return r}const ji=[Object.freeze({__proto__:null,element:Ni,name:Ri})];var Di=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){ji.forEach((e=>{customElements.define(e.name,e.element)}));const e=ji.map((e=>e.name)).join(", "),t=[...document.querySelectorAll(e)].map((e=>new Promise((t=>e.addEventListener("done",t,{once:!0})))));await Promise.all(t)}});var Oi=Object.freeze({__proto__:null,name:"core/dfn-contract",run:function(){!function(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}(),function(){const e=document.querySelectorAll("dl.definitions dt:has(dfn[data-dfn-type])");for(const t of e){const e=t.querySelector("dfn[data-dfn-type]").id,n=t.nextElementSibling;n&&!n.dataset.defines&&e&&(n.dataset.defines=`#${e}`)}const t=document.querySelectorAll(".definition:has(dfn[data-dfn-type])");for(const e of t){const t=e.querySelector("dfn[data-dfn-type]");t.id&&!e.dataset.defines&&(e.dataset.defines=`#${t.id}`)}}()}});const zi="core/linter-rules/check-charset",Ii=gt({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ `<meta>` ꠇē­¾",hint:'å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ `<head>` éƒØ分ā€”ā€” `<meta charset="utf-8">` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚'}});var qi=Object.freeze({__proto__:null,name:zi,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||Pt(Ii.msg,zi,{hint:Ii.hint,elements:[...t]})}});const Mi="core/linter-rules/check-punctuation",Fi=[".",":","!","?"],Bi=gt({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Fi.map((e=>`"${e}"`)).join(", ")}.`}});var Hi=Object.freeze({__proto__:null,name:Mi,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Fi.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&Pt(Bi.msg,Mi,{hint:Bi.hint,elements:n})}});const Wi="core/linter-rules/local-refs-exist",Ui=gt({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function Zi(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Vi=Object.freeze({__proto__:null,name:Wi,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Zi);t.length&&Pt(Ui.msg,Wi,{hint:Ui.hint,elements:t})}});const Ki="core/linter-rules/no-headingless-sections",Yi=gt({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂",hint:"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂"}});var Xi=Object.freeze({__proto__:null,name:Ki,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,#abstract,#sotd)")].filter((({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement)));t.length&&Pt(Yi.msg,Ki,{hint:Yi.hint,elements:t})}});const Qi="core/linter-rules/no-unused-vars",Gi=gt({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var Ji=Object.freeze({__proto__:null,name:Qi,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const o=new Map;for(const e of r){const t=mt(e.textContent);(o.get(t)||o.set(t,[]).get(t)).push(e)}for(const e of o.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&Pt(Gi.msg,Qi,{hint:Gi.hint,elements:t})}});const ea="core/linter-rules/privsec-section",ta=gt({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."}});var na=Object.freeze({__proto__:null,name:ea,run:function(e){var t;e.lint?.["privsec-section"]&&e.isRecTrack&&(t=document,!Array.from(t.querySelectorAll("h2, h3, h4, h5, h6")).some((({textContent:e})=>{const t=/(privacy|security)/im.test(e),n=/(considerations)/im.test(e);return t&&n||t})))&&Pt(ta.msg,ea,{hint:ta.hint})}});const ra="core/linter-rules/no-http-props",oa=gt({en:{msg:zt`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:zt`${"[respecConfig]"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,hint:"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š"}});var sa=Object.freeze({__proto__:null,name:ra,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter((t=>t.endsWith("URI")&&e[t]||"prevED"===t)).filter((t=>new URL(e[t],parent.location.href).href.startsWith("http://")));if(t.length){const e=ht(t,(e=>zt`${`[${e}]`}`));Pt(oa.msg,ra,{hint:oa.hint+e})}}}),ia=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'}),aa=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 <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); + `}};async function Di(e,t,n){let r;try{const o=await Ni;if(!o)throw new Error("`respecConfig.github` is not set");const s=new URL("commits",`${o.apiBase}/${o.fullName}/`);s.searchParams.set("from",e),s.searchParams.set("to",t);const i=await fetch(s.href);if(!i.ok)throw new Error(`Request to ${s} failed with status code ${i.status}`);if(r=await i.json(),!r.length)throw new Error(`No commits between ${e}..${t}.`);r=r.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw new Error(t,{cause:e})}return r}const Oi=[Object.freeze({__proto__:null,element:ji,name:Pi})];var zi=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Oi.forEach((e=>{customElements.define(e.name,e.element)}));const e=Oi.map((e=>e.name)).join(", "),t=[...document.querySelectorAll(e)].map((e=>new Promise((t=>e.addEventListener("done",t,{once:!0})))));await Promise.all(t)}});var Ii=Object.freeze({__proto__:null,name:"core/dfn-contract",run:function(){!function(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}(),function(){const e=document.querySelectorAll("dl.definitions dt:has(dfn[data-dfn-type])");for(const t of e){const e=t.querySelector("dfn[data-dfn-type]").id,n=t.nextElementSibling;n&&!n.dataset.defines&&e&&(n.dataset.defines=`#${e}`)}const t=document.querySelectorAll(".definition:has(dfn[data-dfn-type])");for(const e of t){const t=e.querySelector("dfn[data-dfn-type]");t.id&&!e.dataset.defines&&(e.dataset.defines=`#${t.id}`)}}()}});const qi="core/linter-rules/check-charset",Mi=ht({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ `<meta>` ꠇē­¾",hint:'å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ `<head>` éƒØ分ā€”ā€” `<meta charset="utf-8">` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚'}});var Fi=Object.freeze({__proto__:null,name:qi,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||Rt(Mi.msg,qi,{hint:Mi.hint,elements:[...t]})}});const Bi="core/linter-rules/check-punctuation",Hi=[".",":","!","?"],Wi=ht({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Hi.map((e=>`"${e}"`)).join(", ")}.`}});var Ui=Object.freeze({__proto__:null,name:Bi,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Hi.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&Rt(Wi.msg,Bi,{hint:Wi.hint,elements:n})}});const Zi="core/linter-rules/local-refs-exist",Vi=ht({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function Ki(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Yi=Object.freeze({__proto__:null,name:Zi,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Ki);t.length&&Rt(Vi.msg,Zi,{hint:Vi.hint,elements:t})}});const Xi="core/linter-rules/no-headingless-sections",Qi=ht({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂",hint:"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂"}});var Gi=Object.freeze({__proto__:null,name:Xi,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,#abstract,#sotd)")].filter((({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement)));t.length&&Rt(Qi.msg,Xi,{hint:Qi.hint,elements:t})}});const Ji="core/linter-rules/no-unused-vars",ea=ht({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var ta=Object.freeze({__proto__:null,name:Ji,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const o=new Map;for(const e of r){const t=ft(e.textContent);(o.get(t)||o.set(t,[]).get(t)).push(e)}for(const e of o.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&Rt(ea.msg,Ji,{hint:ea.hint,elements:t})}});const na="core/linter-rules/privsec-section",ra=ht({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."}});var oa=Object.freeze({__proto__:null,name:na,run:function(e){var t;e.lint?.["privsec-section"]&&e.isRecTrack&&(t=document,!Array.from(t.querySelectorAll("h2, h3, h4, h5, h6")).some((({textContent:e})=>{const t=/(privacy|security)/im.test(e),n=/(considerations)/im.test(e);return t&&n||t})))&&Rt(ra.msg,na,{hint:ra.hint})}});const sa="core/linter-rules/no-http-props",ia=ht({en:{msg:Dt`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:Dt`${"[respecConfig]"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,hint:"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š"}});var aa=Object.freeze({__proto__:null,name:sa,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter((t=>t.endsWith("URI")&&e[t]||"prevED"===t)).filter((t=>new URL(e[t],parent.location.href).href.startsWith("http://")));if(t.length){const e=pt(t,(e=>Dt`${`[${e}]`}`));Rt(ia.msg,sa,{hint:ia.hint+e})}}}),ca=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'}),la=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 <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); //# sourceMappingURL=respec-dini.js.map diff --git a/builds/respec-dini.js.map b/builds/respec-dini.js.map index d14aa4b741..3c565781be 100644 --- a/builds/respec-dini.js.map +++ b/builds/respec-dini.js.map @@ -1 +1 @@ -{"version":3,"file":"respec-dini.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/index.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/utils.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/dini.js","../src/core/location-hash.js","../src/core/defaults.js","../src/dini/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/dini/style.js","../src/core/sections.js","../src/core/data-include.js","../src/core/reindent.js","../src/core/title.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/dini/templates/headers.js","../src/dini/headers.js","../src/dini/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/dini/conformance.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/ui/save-html.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/github.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/dfn-contract.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/no-http-props.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\n// Explicitly default lang and dir on <html> if not set.\n// We assume English and ltr as default for international standards.\nif (!html?.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html?.lang ?? \"en\";\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst transactionDoneMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(this.request);\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nconst advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance'];\nconst methodMap = {};\nconst advanceResults = new WeakMap();\nconst ittrProxiedCursorToOriginalProxy = new WeakMap();\nconst cursorIteratorTraps = {\n get(target, prop) {\n if (!advanceMethodProps.includes(prop))\n return target[prop];\n let cachedFunc = methodMap[prop];\n if (!cachedFunc) {\n cachedFunc = methodMap[prop] = function (...args) {\n advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args));\n };\n }\n return cachedFunc;\n },\n};\nasync function* iterate(...args) {\n // tslint:disable-next-line:no-this-assignment\n let cursor = this;\n if (!(cursor instanceof IDBCursor)) {\n cursor = await cursor.openCursor(...args);\n }\n if (!cursor)\n return;\n cursor = cursor;\n const proxiedCursor = new Proxy(cursor, cursorIteratorTraps);\n ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor);\n // Map this double-proxy back to the original, so other cursor methods work.\n reverseTransformCache.set(proxiedCursor, unwrap(cursor));\n while (cursor) {\n yield proxiedCursor;\n // If one of the advancing methods was not called, call continue().\n cursor = await (advanceResults.get(proxiedCursor) || cursor.continue());\n advanceResults.delete(proxiedCursor);\n }\n}\nfunction isIteratorProp(target, prop) {\n return ((prop === Symbol.asyncIterator &&\n instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) ||\n (prop === 'iterate' && instanceOfAny(target, [IDBIndex, IDBObjectStore])));\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get(target, prop, receiver) {\n if (isIteratorProp(target, prop))\n return iterate;\n return oldTraps.get(target, prop, receiver);\n },\n has(target, prop) {\n return isIteratorProp(target, prop) || oldTraps.has(target, prop);\n },\n}));\n\nexport { deleteDB, openDB, unwrap, wrap };\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (Ćæ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v12.0.2 - a markdown parser\n * Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\n/**\n * Gets the original marked default options.\n */\nfunction _getDefaults() {\n return {\n async: false,\n breaks: false,\n extensions: null,\n gfm: true,\n hooks: null,\n pedantic: false,\n renderer: null,\n silent: false,\n tokenizer: null,\n walkTokens: null\n };\n}\nlet _defaults = _getDefaults();\nfunction changeDefaults(newDefaults) {\n _defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape$1(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n }\n else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n return html;\n}\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon')\n return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\nconst caret = /(^|[^\\[])\\^/g;\nfunction edit(regex, opt) {\n let source = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n let valSource = typeof val === 'string' ? val : val.source;\n valSource = valSource.replace(caret, '$1');\n source = source.replace(name, valSource);\n return obj;\n },\n getRegex: () => {\n return new RegExp(source, opt);\n }\n };\n return obj;\n}\nfunction cleanUrl(href) {\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n }\n catch (e) {\n return null;\n }\n return href;\n}\nconst noopTest = { exec: () => null };\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false;\n let curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\')\n escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n }\n else {\n // add space before unescaped |\n return ' |';\n }\n }), cells = row.split(/ \\|/);\n let i = 0;\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) {\n cells.shift();\n }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) {\n cells.pop();\n }\n if (count) {\n if (cells.length > count) {\n cells.splice(count);\n }\n else {\n while (cells.length < count)\n cells.push('');\n }\n }\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param str\n * @param c\n * @param invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n }\n else if (currChar !== c && invert) {\n suffLen++;\n }\n else {\n break;\n }\n }\n return str.slice(0, l - suffLen);\n}\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n let level = 0;\n for (let i = 0; i < str.length; i++) {\n if (str[i] === '\\\\') {\n i++;\n }\n else if (str[i] === b[0]) {\n level++;\n }\n else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape$1(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape$1(text)\n };\n}\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n if (matchIndentToCode === null) {\n return text;\n }\n const indentToCode = matchIndentToCode[1];\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n const [indentInNode] = matchIndentInNode;\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n return node;\n })\n .join('\\n');\n}\n/**\n * Tokenizer\n */\nclass _Tokenizer {\n options;\n rules; // set by the lexer\n lexer; // set by the lexer\n constructor(options) {\n this.options = options || _defaults;\n }\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, '$1') : cap[2],\n text\n };\n }\n }\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n }\n else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n // precede setext continuation with 4 spaces so it isn't a setext\n let text = cap[0].replace(/\\n {0,3}((?:=+|-+) *)(?=\\n|$)/g, '\\n $1');\n text = rtrim(text.replace(/^ *>[ \\t]?/gm, ''), '\\n');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n let raw = '';\n let itemContents = '';\n let endsWithBlankLine = false;\n // Check if current bullet point can start a new List Item\n while (src) {\n let endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n raw = cap[0];\n src = src.substring(raw.length);\n let line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n let nextLine = src.split('\\n', 1)[0];\n let indent = 0;\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimStart();\n }\n else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n let blankLine = false;\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n // Check if following lines should be included in List Item\n while (src) {\n const rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n }\n else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n itemContents += '\\n' + nextLine;\n }\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n }\n else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n let istask = null;\n let ischecked;\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents,\n tokens: []\n });\n list.raw += raw;\n }\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimEnd();\n (list.items[list.items.length - 1]).text = itemContents.trimEnd();\n list.raw = list.raw.trimEnd();\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (let i = 0; i < list.items.length; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n list.loose = hasMultipleLineBreaks;\n }\n }\n // Set all items to loose if list is loose\n if (list.loose) {\n for (let i = 0; i < list.items.length; i++) {\n list.items[i].loose = true;\n }\n }\n return list;\n }\n }\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n block: true,\n raw: cap[0],\n pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',\n text: cap[0]\n };\n return token;\n }\n }\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline.anyPunctuation, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (!cap) {\n return;\n }\n if (!/[:|]/.test(cap[2])) {\n // delimiter row must have a pipe (|) or colon (:) otherwise it is a setext heading\n return;\n }\n const headers = splitCells(cap[1]);\n const aligns = cap[2].replace(/^\\||\\| *$/g, '').split('|');\n const rows = cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : [];\n const item = {\n type: 'table',\n raw: cap[0],\n header: [],\n align: [],\n rows: []\n };\n if (headers.length !== aligns.length) {\n // header and align columns must be equal, rows can be different.\n return;\n }\n for (const align of aligns) {\n if (/^ *-+: *$/.test(align)) {\n item.align.push('right');\n }\n else if (/^ *:-+: *$/.test(align)) {\n item.align.push('center');\n }\n else if (/^ *:-+ *$/.test(align)) {\n item.align.push('left');\n }\n else {\n item.align.push(null);\n }\n }\n for (const header of headers) {\n item.header.push({\n text: header,\n tokens: this.lexer.inline(header)\n });\n }\n for (const row of rows) {\n item.rows.push(splitCells(row, item.header.length).map(cell => {\n return {\n text: cell,\n tokens: this.lexer.inline(cell)\n };\n }));\n }\n return item;\n }\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape$1(cap[1])\n };\n }\n }\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n }\n else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n }\n else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n return {\n type: 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n block: false,\n text: cap[0]\n };\n }\n }\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n }\n else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n if (link) {\n href = link[1];\n title = link[3];\n }\n }\n else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n }\n else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline.anyPunctuation, '$1') : href,\n title: title ? title.replace(this.rules.inline.anyPunctuation, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n const linkString = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n const link = links[linkString.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrongLDelim.exec(src);\n if (!match)\n return;\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u))\n return;\n const nextChar = match[1] || match[2] || '';\n if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {\n // unicode Regex counts emoji as 1 char; spread into array for proper count (used multiple times below)\n const lLength = [...match[0]].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;\n endReg.lastIndex = 0;\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n if (!rDelim)\n continue; // skip single * in __abc*abc__\n rLength = [...rDelim].length;\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n }\n else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n delimTotal -= rLength;\n if (delimTotal > 0)\n continue; // Haven't found enough closing delimiters\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n // char length can be >1 for unicode characters;\n const lastCharLength = [...match[0]][0].length;\n const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape$1(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n autolink(src) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[1]);\n href = 'mailto:' + text;\n }\n else {\n text = escape$1(cap[1]);\n href = text;\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n url(src) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[0]);\n href = 'mailto:' + text;\n }\n else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? '';\n } while (prevCapZero !== cap[0]);\n text = escape$1(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n }\n else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n inlineText(src) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = cap[0];\n }\n else {\n text = escape$1(cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst newline = /^(?: *(?:\\n|$))+/;\nconst blockCode = /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/;\nconst fences = /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/;\nconst hr = /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/;\nconst heading = /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/;\nconst bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nconst lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\\n(?!\\s*?\\n|bull |blockCode|fences|blockquote|heading|html))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/)\n .replace(/bull/g, bullet) // lists can interrupt\n .replace(/blockCode/g, / {4}/) // indented code blocks can interrupt\n .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt\n .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n .getRegex();\nconst _paragraph = /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/;\nconst blockText = /^[^\\n]+/;\nconst _blockLabel = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nconst def = edit(/^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/)\n .replace('label', _blockLabel)\n .replace('title', /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/)\n .getRegex();\nconst list = edit(/^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/)\n .replace(/bull/g, bullet)\n .getRegex();\nconst _tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title'\n + '|tr|track|ul';\nconst _comment = /<!--(?:-?>|[\\s\\S]*?(?:-->|$))/;\nconst html = edit('^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')', 'i')\n .replace('comment', _comment)\n .replace('tag', _tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst paragraph = edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\nconst blockquote = edit(/^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/)\n .replace('paragraph', paragraph)\n .getRegex();\n/**\n * Normal Block Grammar\n */\nconst blockNormal = {\n blockquote,\n code: blockCode,\n def,\n fences,\n heading,\n hr,\n html,\n lheading,\n list,\n newline,\n paragraph,\n table: noopTest,\n text: blockText\n};\n/**\n * GFM Block Grammar\n */\nconst gfmTable = edit('^ *([^\\\\n ].*)\\\\n' // Header\n + ' {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)') // Cells\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\nconst blockGfm = {\n ...blockNormal,\n table: gfmTable,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('table', gfmTable) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex()\n};\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\nconst blockPedantic = {\n ...blockNormal,\n html: edit('^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', _comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', lheading)\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .replace('|tag', '')\n .getRegex()\n};\n/**\n * Inline-Level Grammar\n */\nconst escape = /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/;\nconst inlineCode = /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/;\nconst br = /^( {2,}|\\\\)\\n(?!\\s*$)/;\nconst inlineText = /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/;\n// list of unicode punctuation marks, plus any missing characters from CommonMark spec\nconst _punctuation = '\\\\p{P}\\\\p{S}';\nconst punctuation = edit(/^((?![*_])[\\spunctuation])/, 'u')\n .replace(/punctuation/g, _punctuation).getRegex();\n// sequences em should skip over [title](link), `code`, <html>\nconst blockSkip = /\\[[^[\\]]*?\\]\\([^\\(\\)]*?\\)|`[^`]*?`|<[^<>]*?>/g;\nconst emStrongLDelim = edit(/^(?:\\*+(?:((?!\\*)[punct])|[^\\s*]))|^_+(?:((?!_)[punct])|([^\\s_]))/, 'u')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst emStrongRDelimAst = edit('^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)' // Skip orphan inside strong\n + '|[^*]+(?=[^*])' // Consume to delim\n + '|(?!\\\\*)[punct](\\\\*+)(?=[\\\\s]|$)' // (1) #*** can only be a Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?!\\\\*)(?=[punct\\\\s]|$)' // (2) a***#, a*** can only be a Right Delimiter\n + '|(?!\\\\*)[punct\\\\s](\\\\*+)(?=[^punct\\\\s])' // (3) #***a, ***a can only be Left Delimiter\n + '|[\\\\s](\\\\*+)(?!\\\\*)(?=[punct])' // (4) ***# can only be Left Delimiter\n + '|(?!\\\\*)[punct](\\\\*+)(?!\\\\*)(?=[punct])' // (5) #***# can be either Left or Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?=[^punct\\\\s])', 'gu') // (6) a***a can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\n// (6) Not allowed for _\nconst emStrongRDelimUnd = edit('^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)' // Skip orphan inside strong\n + '|[^_]+(?=[^_])' // Consume to delim\n + '|(?!_)[punct](_+)(?=[\\\\s]|$)' // (1) #___ can only be a Right Delimiter\n + '|[^punct\\\\s](_+)(?!_)(?=[punct\\\\s]|$)' // (2) a___#, a___ can only be a Right Delimiter\n + '|(?!_)[punct\\\\s](_+)(?=[^punct\\\\s])' // (3) #___a, ___a can only be Left Delimiter\n + '|[\\\\s](_+)(?!_)(?=[punct])' // (4) ___# can only be Left Delimiter\n + '|(?!_)[punct](_+)(?!_)(?=[punct])', 'gu') // (5) #___# can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst anyPunctuation = edit(/\\\\([punct])/, 'gu')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst autolink = edit(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/)\n .replace('scheme', /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/)\n .replace('email', /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/)\n .getRegex();\nconst _inlineComment = edit(_comment).replace('(?:-->|$)', '-->').getRegex();\nconst tag = edit('^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>') // CDATA section\n .replace('comment', _inlineComment)\n .replace('attribute', /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst _inlineLabel = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\nconst link = edit(/^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/)\n .replace('label', _inlineLabel)\n .replace('href', /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/)\n .replace('title', /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/)\n .getRegex();\nconst reflink = edit(/^!?\\[(label)\\]\\[(ref)\\]/)\n .replace('label', _inlineLabel)\n .replace('ref', _blockLabel)\n .getRegex();\nconst nolink = edit(/^!?\\[(ref)\\](?:\\[\\])?/)\n .replace('ref', _blockLabel)\n .getRegex();\nconst reflinkSearch = edit('reflink|nolink(?!\\\\()', 'g')\n .replace('reflink', reflink)\n .replace('nolink', nolink)\n .getRegex();\n/**\n * Normal Inline Grammar\n */\nconst inlineNormal = {\n _backpedal: noopTest, // only used for GFM url\n anyPunctuation,\n autolink,\n blockSkip,\n br,\n code: inlineCode,\n del: noopTest,\n emStrongLDelim,\n emStrongRDelimAst,\n emStrongRDelimUnd,\n escape,\n link,\n nolink,\n punctuation,\n reflink,\n reflinkSearch,\n tag,\n text: inlineText,\n url: noopTest\n};\n/**\n * Pedantic Inline Grammar\n */\nconst inlinePedantic = {\n ...inlineNormal,\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', _inlineLabel)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', _inlineLabel)\n .getRegex()\n};\n/**\n * GFM Inline Grammar\n */\nconst inlineGfm = {\n ...inlineNormal,\n escape: edit(escape).replace('])', '~|])').getRegex(),\n url: edit(/^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/, 'i')\n .replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/)\n .getRegex(),\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n};\n/**\n * GFM + Line Breaks Inline Grammar\n */\nconst inlineBreaks = {\n ...inlineGfm,\n br: edit(br).replace('{2,}', '*').getRegex(),\n text: edit(inlineGfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n/**\n * exports\n */\nconst block = {\n normal: blockNormal,\n gfm: blockGfm,\n pedantic: blockPedantic\n};\nconst inline = {\n normal: inlineNormal,\n gfm: inlineGfm,\n breaks: inlineBreaks,\n pedantic: inlinePedantic\n};\n\n/**\n * Block Lexer\n */\nclass _Lexer {\n tokens;\n options;\n state;\n tokenizer;\n inlineQueue;\n constructor(options) {\n // TokenList cannot be created in one go\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || _defaults;\n this.options.tokenizer = this.options.tokenizer || new _Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n }\n else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n }\n else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new _Lexer(options);\n return lexer.lex(src);\n }\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new _Lexer(options);\n return lexer.inlineTokens(src);\n }\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n this.blockTokens(src, this.tokens);\n for (let i = 0; i < this.inlineQueue.length; i++) {\n const next = this.inlineQueue[i];\n this.inlineTokens(next.src, next.tokens);\n }\n this.inlineQueue = [];\n return this.tokens;\n }\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n }\n else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n let token;\n let lastToken;\n let cutSrc;\n let lastParagraphClipped;\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unnecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n this.state.top = true;\n return tokens;\n }\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n // Mask out escaped characters\n while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);\n }\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // autolink\n if (token = this.tokenizer.autolink(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass _Renderer {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/^\\S*/)?.[0];\n code = code.replace(/\\n$/, '') + '\\n';\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n return '<pre><code class=\"language-'\n + escape$1(lang)\n + '\">'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n html(html, block) {\n return html;\n }\n heading(text, level, raw) {\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n hr() {\n return '<hr>\\n';\n }\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul';\n const startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n listitem(text, task, checked) {\n return `<li>${text}</li>\\n`;\n }\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\">';\n }\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n table(header, body) {\n if (body)\n body = `<tbody>${body}</tbody>`;\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n /**\n * span level renderer\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n em(text) {\n return `<em>${text}</em>`;\n }\n codespan(text) {\n return `<code>${text}</code>`;\n }\n br() {\n return '<br>';\n }\n del(text) {\n return `<del>${text}</del>`;\n }\n link(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n image(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += '>';\n return out;\n }\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass _TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n em(text) {\n return text;\n }\n codespan(text) {\n return text;\n }\n del(text) {\n return text;\n }\n html(text) {\n return text;\n }\n text(text) {\n return text;\n }\n link(href, title, text) {\n return '' + text;\n }\n image(href, title, text) {\n return '' + text;\n }\n br() {\n return '';\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass _Parser {\n options;\n renderer;\n textRenderer;\n constructor(options) {\n this.options = options || _defaults;\n this.options.renderer = this.options.renderer || new _Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new _TextRenderer();\n }\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new _Parser(options);\n return parser.parse(tokens);\n }\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new _Parser(options);\n return parser.parseInline(tokens);\n }\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const genericToken = token;\n const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(genericToken.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n const headingToken = token;\n out += this.renderer.heading(this.parseInline(headingToken.tokens), headingToken.depth, unescape(this.parseInline(headingToken.tokens, this.textRenderer)));\n continue;\n }\n case 'code': {\n const codeToken = token;\n out += this.renderer.code(codeToken.text, codeToken.lang, !!codeToken.escaped);\n continue;\n }\n case 'table': {\n const tableToken = token;\n let header = '';\n // header\n let cell = '';\n for (let j = 0; j < tableToken.header.length; j++) {\n cell += this.renderer.tablecell(this.parseInline(tableToken.header[j].tokens), { header: true, align: tableToken.align[j] });\n }\n header += this.renderer.tablerow(cell);\n let body = '';\n for (let j = 0; j < tableToken.rows.length; j++) {\n const row = tableToken.rows[j];\n cell = '';\n for (let k = 0; k < row.length; k++) {\n cell += this.renderer.tablecell(this.parseInline(row[k].tokens), { header: false, align: tableToken.align[k] });\n }\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n const blockquoteToken = token;\n const body = this.parse(blockquoteToken.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n const listToken = token;\n const ordered = listToken.ordered;\n const start = listToken.start;\n const loose = listToken.loose;\n let body = '';\n for (let j = 0; j < listToken.items.length; j++) {\n const item = listToken.items[j];\n const checked = item.checked;\n const task = item.task;\n let itemBody = '';\n if (item.task) {\n const checkbox = this.renderer.checkbox(!!checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n }\n else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox + ' '\n });\n }\n }\n else {\n itemBody += checkbox + ' ';\n }\n }\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, !!checked);\n }\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n const htmlToken = token;\n out += this.renderer.html(htmlToken.text, htmlToken.block);\n continue;\n }\n case 'paragraph': {\n const paragraphToken = token;\n out += this.renderer.paragraph(this.parseInline(paragraphToken.tokens));\n continue;\n }\n case 'text': {\n let textToken = token;\n let body = textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text;\n while (i + 1 < tokens.length && tokens[i + 1].type === 'text') {\n textToken = tokens[++i];\n body += '\\n' + (textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'escape': {\n const escapeToken = token;\n out += renderer.text(escapeToken.text);\n break;\n }\n case 'html': {\n const tagToken = token;\n out += renderer.html(tagToken.text);\n break;\n }\n case 'link': {\n const linkToken = token;\n out += renderer.link(linkToken.href, linkToken.title, this.parseInline(linkToken.tokens, renderer));\n break;\n }\n case 'image': {\n const imageToken = token;\n out += renderer.image(imageToken.href, imageToken.title, imageToken.text);\n break;\n }\n case 'strong': {\n const strongToken = token;\n out += renderer.strong(this.parseInline(strongToken.tokens, renderer));\n break;\n }\n case 'em': {\n const emToken = token;\n out += renderer.em(this.parseInline(emToken.tokens, renderer));\n break;\n }\n case 'codespan': {\n const codespanToken = token;\n out += renderer.codespan(codespanToken.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n const delToken = token;\n out += renderer.del(this.parseInline(delToken.tokens, renderer));\n break;\n }\n case 'text': {\n const textToken = token;\n out += renderer.text(textToken.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\nclass _Hooks {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess',\n 'processAllTokens'\n ]);\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n /**\n * Process all tokens before walk tokens\n */\n processAllTokens(tokens) {\n return tokens;\n }\n}\n\nclass Marked {\n defaults = _getDefaults();\n options = this.setOptions;\n parse = this.#parseMarkdown(_Lexer.lex, _Parser.parse);\n parseInline = this.#parseMarkdown(_Lexer.lexInline, _Parser.parseInline);\n Parser = _Parser;\n Renderer = _Renderer;\n TextRenderer = _TextRenderer;\n Lexer = _Lexer;\n Tokenizer = _Tokenizer;\n Hooks = _Hooks;\n constructor(...args) {\n this.use(...args);\n }\n /**\n * Run callback for every token\n */\n walkTokens(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(this, token));\n switch (token.type) {\n case 'table': {\n const tableToken = token;\n for (const cell of tableToken.header) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n for (const row of tableToken.rows) {\n for (const cell of row) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n const listToken = token;\n values = values.concat(this.walkTokens(listToken.items, callback));\n break;\n }\n default: {\n const genericToken = token;\n if (this.defaults.extensions?.childTokens?.[genericToken.type]) {\n this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {\n const tokens = genericToken[childTokens].flat(Infinity);\n values = values.concat(this.walkTokens(tokens, callback));\n });\n }\n else if (genericToken.tokens) {\n values = values.concat(this.walkTokens(genericToken.tokens, callback));\n }\n }\n }\n }\n return values;\n }\n use(...args) {\n const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n // set async to true if it was set to true before\n opts.async = this.defaults.async || opts.async || false;\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if ('renderer' in ext) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function (...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n }\n else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if ('tokenizer' in ext) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n const extLevel = extensions[ext.level];\n if (extLevel) {\n extLevel.unshift(ext.tokenizer);\n }\n else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n }\n else {\n extensions.startBlock = [ext.start];\n }\n }\n else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n }\n else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if ('childTokens' in ext && ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = this.defaults.renderer || new _Renderer(this.defaults);\n for (const prop in pack.renderer) {\n if (!(prop in renderer)) {\n throw new Error(`renderer '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const rendererProp = prop;\n const rendererFunc = pack.renderer[rendererProp];\n const prevRenderer = renderer[rendererProp];\n // Replace renderer with func to run extension, but fall back if false\n renderer[rendererProp] = (...args) => {\n let ret = rendererFunc.apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret || '';\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);\n for (const prop in pack.tokenizer) {\n if (!(prop in tokenizer)) {\n throw new Error(`tokenizer '${prop}' does not exist`);\n }\n if (['options', 'rules', 'lexer'].includes(prop)) {\n // ignore options, rules, and lexer properties\n continue;\n }\n const tokenizerProp = prop;\n const tokenizerFunc = pack.tokenizer[tokenizerProp];\n const prevTokenizer = tokenizer[tokenizerProp];\n // Replace tokenizer with func to run extension, but fall back if false\n // @ts-expect-error cannot type tokenizer function dynamically\n tokenizer[tokenizerProp] = (...args) => {\n let ret = tokenizerFunc.apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = this.defaults.hooks || new _Hooks();\n for (const prop in pack.hooks) {\n if (!(prop in hooks)) {\n throw new Error(`hook '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const hooksProp = prop;\n const hooksFunc = pack.hooks[hooksProp];\n const prevHook = hooks[hooksProp];\n if (_Hooks.passThroughHooks.has(prop)) {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (arg) => {\n if (this.defaults.async) {\n return Promise.resolve(hooksFunc.call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n const ret = hooksFunc.call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n }\n else {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (...args) => {\n let ret = hooksFunc.apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = this.defaults.walkTokens;\n const packWalktokens = pack.walkTokens;\n opts.walkTokens = function (token) {\n let values = [];\n values.push(packWalktokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n this.defaults = { ...this.defaults, ...opts };\n });\n return this;\n }\n setOptions(opt) {\n this.defaults = { ...this.defaults, ...opt };\n return this;\n }\n lexer(src, options) {\n return _Lexer.lex(src, options ?? this.defaults);\n }\n parser(tokens, options) {\n return _Parser.parse(tokens, options ?? this.defaults);\n }\n #parseMarkdown(lexer, parser) {\n return (src, options) => {\n const origOpt = { ...options };\n const opt = { ...this.defaults, ...origOpt };\n // Show warning if an extension set async to true but the parse was called with async: false\n if (this.defaults.async === true && origOpt.async === false) {\n if (!opt.silent) {\n console.warn('marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.');\n }\n opt.async = true;\n }\n const throwError = this.#onError(!!opt.silent, !!opt.async);\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens)\n .then(tokens => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n let tokens = lexer(src, opt);\n if (opt.hooks) {\n tokens = opt.hooks.processAllTokens(tokens);\n }\n if (opt.walkTokens) {\n this.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n }\n catch (e) {\n return throwError(e);\n }\n };\n }\n #onError(silent, async) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape$1(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n return msg;\n }\n if (async) {\n return Promise.reject(e);\n }\n throw e;\n };\n }\n}\n\nconst markedInstance = new Marked();\nfunction marked(src, opt) {\n return markedInstance.parse(src, opt);\n}\n/**\n * Sets the default options.\n *\n * @param options Hash of options\n */\nmarked.options =\n marked.setOptions = function (options) {\n markedInstance.setOptions(options);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n };\n/**\n * Gets the original marked default options.\n */\nmarked.getDefaults = _getDefaults;\nmarked.defaults = _defaults;\n/**\n * Use Extension\n */\nmarked.use = function (...args) {\n markedInstance.use(...args);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n};\n/**\n * Run callback for every token\n */\nmarked.walkTokens = function (tokens, callback) {\n return markedInstance.walkTokens(tokens, callback);\n};\n/**\n * Compiles markdown to HTML without enclosing `p` tag.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options\n * @return String of compiled HTML\n */\nmarked.parseInline = markedInstance.parseInline;\n/**\n * Expose\n */\nmarked.Parser = _Parser;\nmarked.parser = _Parser.parse;\nmarked.Renderer = _Renderer;\nmarked.TextRenderer = _TextRenderer;\nmarked.Lexer = _Lexer;\nmarked.lexer = _Lexer.lex;\nmarked.Tokenizer = _Tokenizer;\nmarked.Hooks = _Hooks;\nmarked.parse = marked;\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = _Parser.parse;\nconst lexer = _Lexer.lex;\n\nexport { _Hooks as Hooks, _Lexer as Lexer, Marked, _Parser as Parser, _Renderer as Renderer, _TextRenderer as TextRenderer, _Tokenizer as Tokenizer, _defaults as defaults, _getDefaults as getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n//# sourceMappingURL=marked.esm.js.map\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralize$1 = {exports: {}};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eĆ©]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t}); \n} (pluralize$1));\n\nvar pluralizeExports = pluralize$1.exports;\nvar pluralize = /*@__PURE__*/getDefaultExportFromCjs(pluralizeExports);\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"šŸ‘»\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint });\n console.error(e);\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up šŸ˜–\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message);\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return { message, name, plugin, hint, elements, title, details, stack };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Creates showError, showWarning utilities for use in custom pre-process and\n * post-process plugins.\n * @param {string} pluginName\n */\nexport function makePluginUtils(pluginName) {\n /** @typedef {Parameters<typeof showError>[2]} Options */\n return {\n /** @type {(message: string, options?: Options) => void} */\n showError: (msg, options) => showError(msg, pluginName, options),\n /** @type {(message: string, options?: Options) => void} */\n showWarning: (msg, options) => showWarning(msg, pluginName, options),\n };\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n\n/**\n * Takes a text string, trims it, splits it into lines,\n * finds the common indentation level, and then de-indents every line\n * by that common indentation level.\n *\n * @param {string} text - The text to be re-indented.\n * @returns {string} The re-indented text.\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n background: var(--bg, #fff);\n color: rgb(120, 120, 120);\n color: var(--tocnav-normal-text, rgb(120, 120, 120));\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n box-shadow: 1px 1px 8px 0 var(--tocsidebar-shadow, rgba(100, 100, 100, 0.5));\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: var(--bg, #fff);\n color: var(--text, black);\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: var(--def-text, white);\n background: var(--def-bg, rgb(42, 90, 168));\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: var(--def-text, white);\n background: var(--defrow-border, rgb(42, 90, 168));\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: var(--tocnav-active-bg, #193766);\n color: var(--tocnav-active-text, black);\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"āš ļø\";\n}\n\n.respec-error-list > li::before {\n content: \"šŸ’„\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: var(--bg, #fff);\n color: var(--text, black);\n border: 5px solid #666;\n border-color: var(--tocsidebar-shadow, #666);\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n left: 0 !important;\n text-align: center;\n background: var(--tocsidebar-shadow, #ddd);\n color: var(--text, black);\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: var(--bg, white);\n color: var(--text, black);\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: var(--tocnav-hover-bg, #eee);\n color: var(--tocnav-hover-text, black);\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/markedjs/marked\n *\n */\n\nimport { getElementIndentation, reindent } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\n\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\n\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super\n .code(code, language, isEscaped)\n .replace(`class=\"language-`, `class=\"`);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw);\n }\n}\n\n/** @type {import('marked').MarkedOptions} */\nconst config = {\n gfm: true,\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport { reindent, xmlEscape } from \"./utils.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n āŒ\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}ā€¦\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${xmlEscape(err.message)}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/dini/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/dini/style.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/title.js\"),\n import(\"../src/dini/headers.js\"),\n import(\"../src/dini/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/dini/conformance.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n import(\"../src/core/dfn-contract.js\"),\n /* Linter must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/core/linter-rules/privsec-section.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// As ReSpec injects a bunch of stuff async, the scroll position is not always\n// at the right place when we are done processing. The purpose of this module\n// is to reset window's location hash, which will cause the browser to scroll\n// the window to the correct point in the document when processing is done.\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!window.location.hash) {\n return;\n }\n\n // We have to use .then() here because otherwise we would get stuck\n // awaiting this plugin to finish.\n document.respec.ready.then(() => {\n const hash = decodeURIComponent(window.location.hash).slice(1);\n\n let newHash = hash;\n /** @type {HTMLElement|null} */\n const element = document.getElementById(newHash);\n\n // Check if hash contains any non-word character.\n const isLegacyFrag = /\\W/.test(newHash);\n\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/speced/respec/issues/1353\n if (!element && isLegacyFrag) {\n const id = newHash\n // Replace all non-word characters with a dash.\n .replace(/[\\W]+/gim, \"-\")\n // Remove any leading dashes.\n .replace(/^-+/, \"\")\n // Remove any trailing dashes.\n .replace(/-+$/, \"\");\n\n /** @type {HTMLElement|null} */\n const updatedElement = document.getElementById(id);\n if (updatedElement) {\n newHash = id;\n }\n }\n window.location.hash = `#${newHash}`;\n });\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for DINI specs\n */\nexport const name = \"dini/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst licenses = new Map([\n [\n \"cc0\",\n {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n ],\n [\n \"cc-by\",\n {\n name: \"Creative Commons Attribution 4.0 International Public License\",\n short: \"CC-BY\",\n url: \"https://creativecommons.org/licenses/by/4.0/legalcode\",\n },\n ],\n [\n \"cc-by-sa\",\n {\n name: \"Creative Commons Attribution-ShareAlike 4.0 International Public License\",\n short: \"CC-BY-SA\",\n url: \"https://creativecommons.org/licenses/by-sa/4.0/legalcode\",\n },\n ],\n]);\n\nconst diniDefaults = {\n format: \"markdown\",\n isED: false,\n isNoTrack: true,\n isPR: false,\n lint: {\n \"privsec-section\": true,\n \"wpt-tests-exist\": false,\n },\n logos: [],\n prependW3C: false,\n doJsonLd: false,\n license: \"cc-by\",\n shortName: \"X\",\n showPreviousVersion: false,\n};\n\nfunction computeProps(conf) {\n return {\n licenseInfo: licenses.get(conf.license),\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...diniDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...diniDefaults,\n ...conf,\n lint,\n });\n\n // computed properties\n Object.assign(conf, computeProps(conf));\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOF --- */\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"Ā§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// The purpose of this module is to insert the default ReSpec CSS into the document.\n// If you don't want to use the default ReSpec CSS, set the `noReSpecCSS` configuration\n// option to `true`. If you want to use your own styles, create a ReSpec profile that\n// includes your own styles and sets the `noReSpecCSS` configuration option to `true`.\n\n/**\n * Module Name.\n * @type {string}\n */\nexport const name = \"core/style\";\n\nimport css from \"../styles/respec.css.js\";\n\n// Opportunistically inserts the style to reduce some FOUC.\n/** @type {HTMLStyleElement} */\nconst styleElement = insertStyle();\n\n/**\n * Inserts the ReSpec CSS as a `style` element into the document's `head`.\n * @return {HTMLStyleElement} The `style` element that was inserted.\n */\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\n/**\n * Removes the ReSpec CSS if the `noReSpecCSS` configuration option is `true`.\n * @param {Conf} conf The document configuration object.\n */\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n// Module dini/style\n// Inserts a link to the appropriate W3C style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport {\n createResourceHint,\n linkCSS,\n showWarning,\n toKeyValuePairs,\n} from \"../core/utils.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"dini/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n script.src = `https://www.w3.org/scripts/TR/${version}/fixup.js`;\n doc.body.appendChild(script);\n}\n\n/**\n * Make a best effort to attach meta viewport at the top of the head.\n * Other plugins might subsequently push it down, but at least we start\n * at the right place. When ReSpec exports the HTML, it again moves the\n * meta viewport to the top of the head - so to make sure it's the first\n * thing the browser sees. See js/ui/save-html.js.\n */\nfunction createMetaViewport() {\n const meta = document.createElement(\"meta\");\n meta.name = \"viewport\";\n const contentProps = {\n width: \"device-width\",\n \"initial-scale\": \"1\",\n \"shrink-to-fit\": \"no\",\n };\n meta.content = toKeyValuePairs(contentProps).replace(/\"/g, \"\");\n return meta;\n}\n\nfunction createBaseStyle() {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = \"https://www.w3.org/StyleSheets/TR/2016/base.css\";\n link.classList.add(\"removeOnSave\");\n return link;\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C styles and scripts.\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2016/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: \"https://www.w3.org/StyleSheets/TR/2016/base.css\",\n as: \"style\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// Opportunistically apply base style\nelements.appendChild(createBaseStyle());\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(createMetaViewport());\n}\n\ndocument.head.prepend(elements);\n\nfunction styleMover(linkURL) {\n return exportDoc => {\n const w3cStyle = exportDoc.querySelector(`head link[href=\"${linkURL}\"]`);\n exportDoc.querySelector(\"head\").append(w3cStyle);\n };\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"`respecConfig.specStatus` missing. Defaulting to 'base'.\";\n conf.specStatus = \"base\";\n showWarning(msg, name);\n }\n\n let styleFile = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"UNOFFICIAL\":\n styleFile = \"W3C-UD\";\n break;\n case \"BASE\":\n styleFile = \"base.css\";\n break;\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://www.w3.org/StyleSheets/TR/2016/${styleFile}`;\n linkCSS(document, finalStyleURL);\n // Make sure the W3C stylesheet is the last stylesheet, as required by W3C Pub Rules.\n const moveStyle = styleMover(finalStyleURL);\n sub(\"beforesave\", moveStyle);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n console.error(msg, el, err);\n showError(msg, name, { elements: [el] });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","// @ts-check\n/**\n * @module core/reindent\n *\n * Normalizes indents across the pre elements in the document,\n * so that indentation inside <pre> won't affect the rendered result.\n */\nimport { reindent } from \"./utils.js\";\nexport const name = \"core/reindent\";\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","/**\n * This module handles the creation of the h1#title of a spec and\n * makes sure the <title> always matches the h1.\n *\n * If no h1#title is included, then the <title> becomes the h1#title.\n *\n * When a h1#title is included, it always takes precedence over the\n * <title> of a spec. An error will be displayed in case of\n * any mismatch.\n *\n */\n\nimport { getIntlData, norm, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/title\";\n\nconst localizationStrings = {\n en: {\n default_title: \"No Title\",\n },\n de: {\n default_title: \"Kein Titel\",\n },\n zh: {\n default_title: \"ę— ę ‡é¢˜\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {HTMLElement} */\n const h1Elem =\n document.querySelector(\"h1#title\") || html`<h1 id=\"title\"></h1>`;\n\n // check existing element is ok to use\n if (h1Elem.isConnected && h1Elem.textContent.trim() === \"\") {\n const msg =\n \"The document is missing a title, so using a default title. \" +\n \"To fix this, please give your document a `<title>`. \" +\n \"If you need special markup in the document's title, \" +\n 'please use a `<h1 id=\"title\">`.';\n const title = \"Document is missing a title\";\n showError(msg, name, { title, elements: [h1Elem] });\n }\n\n // Decorate the spec title\n if (!h1Elem.id) h1Elem.id = \"title\";\n h1Elem.classList.add(\"title\");\n\n setDocumentTitle(conf, h1Elem);\n\n // This will get relocated by a template later.\n document.body.prepend(h1Elem);\n}\n\nfunction setDocumentTitle(conf, h1Elem) {\n // If the h1 is newly created, it won't be connected. In this case\n // we use the <title> or a localized fallback.\n if (!h1Elem.isConnected) {\n h1Elem.textContent = document.title || `${l10n.default_title}`;\n }\n // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.textContent);\n\n if (conf.isPreview && conf.prNumber) {\n const prUrl = conf.prUrl || `${conf.github.repoURL}pull/${conf.prNumber}`;\n const { childNodes } = html`\n Preview of PR <a href=\"${prUrl}\">#${conf.prNumber}</a>:\n `;\n h1Elem.prepend(...childNodes);\n documentTitle = `Preview of PR #${conf.prNumber}: ${documentTitle}`;\n }\n\n document.title = documentTitle;\n\n // conf.title is deperecated - we are keeping this here just to\n // retain backwards compat as we think the ePub generator\n // relies on it.\n conf.title = documentTitle;\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"core/templates/show-link\";\n\n/**\n * @param {object} link\n * @param {string} link.key\n * @param {string} [link.class]\n * @param {LinkData[]} [link.data]\n */\nexport default function showLink(link) {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n showWarning(msg, name);\n console.warn(msg, link);\n return;\n }\n return html`\n <dt class=\"${link.class ? link.class : null}\">${link.key}</dt>\n ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n `;\n}\n\n/**\n * @typedef {object} LinkData\n * @property {string} [LinkData.class]\n * @property {string} [LinkData.href]\n * @property {string} [LinkData.value]\n * @param {LinkData} data\n */\nfunction showLinkData(data) {\n return html`<dd class=\"${data.class ? data.class : null}\">\n ${data.href\n ? html`<a href=\"${data.href}\">${data.value || data.href}</a>`\n : data.value}\n </dd>`;\n}\n","// @ts-check\nimport { docLink, showError } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst name = \"core/templates/show-logo\";\n\n/**\n * Logo mapper. Takes a logo structure and converts it to HTML.\n *\n * @param {object} logo\n * @param {string} logo.src\n * @param {string} logo.url\n * @param {string} logo.alt\n * @param {string} [logo.id]\n * @param {number} [logo.width]\n * @param {number} [logo.height]\n * @param {number} index\n */\nexport default function showLogo(logo, index) {\n /** @type {HTMLAnchorElement} */\n const a = html`<a href=\"${logo.url || null}\" class=\"logo\"\n ><img\n alt=\"${logo.alt || null}\"\n crossorigin\n height=\"${logo.height || null}\"\n id=\"${logo.id || null}\"\n src=\"${logo.src || null}\"\n width=\"${logo.width || null}\"\n />\n </a>`;\n if (!logo.alt) {\n const src = logo.src ? `, with \\`src\\` ${logo.src}, ` : \"\";\n const msg = `Logo at index ${index}${src} is missing required \"\\`alt\\`\" property.`;\n const hint = docLink`Add the missing \"\\`alt\\`\" property describing the logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n if (!logo.src) {\n const msg = `Logo at index ${index} is missing \"\\`src\\`\" property.`;\n const hint = docLink`The \\`src\\` property is required on every logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n return a;\n}\n","// @ts-check\n\nconst name = \"core/templates/show-people\";\n\nimport {\n W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n until(date) {\n return html` Until ${date} `;\n },\n },\n es: {\n until(date) {\n return html` Hasta ${date} `;\n },\n },\n ko: {\n until(date) {\n return html` ${date} ģ“ģ „ `;\n },\n },\n ja: {\n until(date) {\n return html` ${date} 仄前 `;\n },\n },\n de: {\n until(date) {\n return html` bis ${date} `;\n },\n },\n zh: {\n until(date) {\n return html` ē›“到 ${date} `;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst orcidIcon = () =>\n html`<svg\n width=\"16\"\n height=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n >\n <style>\n .st1 {\n fill: #fff;\n }\n </style>\n <path\n d=\"M256 128c0 70.7-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0s128 57.3 128 128z\"\n fill=\"#a6ce39\"\n />\n <path\n class=\"st1\"\n d=\"M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z\"\n />\n </svg>`;\n\n/**\n * @param {Conf} conf\n * @param {\"editors\" | \"authors\" | \"formerEditors\"} propName - the name of the property of the people to render.\n */\nexport default function showPeople(conf, propName) {\n const people = conf[propName];\n if (!Array.isArray(people) || !people.length) return; // nothing to show...\n\n const validatePerson = personValidator(propName);\n return people.filter(validatePerson).map(personToHTML);\n}\n\n/**\n * @param {Person} person\n */\nfunction personToHTML(person) {\n // The following are treated as opt-in HTML by hyperHTML\n // we need to deprecate this!\n const personName = [person.name];\n const company = [person.company];\n const editorId = person.w3cid || null;\n const contents = [];\n if (person.mailto) {\n person.url = `mailto:${person.mailto}`;\n }\n if (person.url) {\n const url = new URL(person.url, document.location.href);\n const classList =\n url.protocol === \"mailto:\"\n ? \"ed_mailto u-email email p-name\"\n : \"u-url url p-name fn\";\n contents.push(\n html`<a class=\"${classList}\" href=\"${person.url}\">${personName}</a>`\n );\n } else {\n contents.push(html`<span class=\"p-name fn\">${personName}</span>`);\n }\n if (person.orcid) {\n contents.push(\n html`<a class=\"p-name orcid\" href=\"${person.orcid}\">${orcidIcon()}</a>`\n );\n }\n if (person.company) {\n const hCard = \"p-org org h-org\";\n const companyElem = person.companyURL\n ? html`<a class=\"${hCard}\" href=\"${person.companyURL}\">${company}</a>`\n : html`<span class=\"${hCard}\">${company}</span>`;\n contents.push(html` (${companyElem})`);\n }\n if (person.note) {\n contents.push(document.createTextNode(` (${person.note})`));\n }\n if (person.extras) {\n contents.push(...person.extras.map(extra => html`, ${renderExtra(extra)}`));\n }\n const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(retiredDate))}</time\n >`;\n contents.push(html` - ${l10n.until(time)} `);\n }\n const dd = html`<dd\n class=\"editor p-author h-card vcard\"\n data-editor-id=\"${editorId}\"\n >\n ${contents}\n </dd>`;\n return dd;\n}\n\nfunction renderExtra(extra) {\n const classVal = extra.class || null;\n const { name, href } = extra;\n return href\n ? html`<a href=\"${href}\" class=\"${classVal}\">${name}</a>`\n : html`<span class=\"${classVal}\">${name}</span>`;\n}\n\n/**\n *\n * @param {string} prop\n */\nfunction personValidator(prop) {\n /**\n * @param {Person} person\n * @param {Number} index\n */\n return function validatePerson(person, index) {\n const docsUrl = \"https://respec.org/docs/\";\n const seePersonHint = `See [person](${docsUrl}#person) configuration for available options.`;\n const preamble =\n `Error processing the [person object](${docsUrl}#person) ` +\n `at index ${index} of the \"[\\`${prop}\\`](${docsUrl}#${prop})\" configuration option.`;\n\n if (!person.name) {\n const msg = `${preamble} Missing required property \\`\"name\"\\`.`;\n showError(msg, name, { hint: seePersonHint });\n return false;\n }\n\n if (person.orcid) {\n const { orcid } = person;\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n\n if (orcidUrl.origin !== \"https://orcid.org\") {\n const msg = `${preamble} ORCID \"${person.orcid}\" at index ${index} is invalid.`;\n const hint = `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`;\n showError(msg, name, { hint });\n return false;\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n const msg = `${preamble} ORCID \"${orcidId}\" has wrong format.`;\n const hint = `ORCIDs have the format \"1234-1234-1234-1234.\"`;\n showError(msg, name, { hint });\n return false;\n }\n\n if (!checkOrcidChecksum(orcid)) {\n const msg = `${preamble} ORCID \"${orcid}\" failed checksum check.`;\n const hint = \"Please check that the ORCID is valid.\";\n showError(msg, name, { hint });\n return false;\n }\n\n // canonical form\n person.orcid = orcidUrl.href;\n }\n\n if (person.retiredDate && !isValidConfDate(person.retiredDate)) {\n const msg = `${preamble} The property \"\\`retiredDate\\`\" is not a valid date.`;\n showError(msg, name, {\n hint: `The expected format is YYYY-MM-DD. ${seePersonHint}`,\n });\n return false;\n }\n\n if (\n person.hasOwnProperty(\"extras\") &&\n !validateExtras(person.extras, seePersonHint, preamble)\n ) {\n return false;\n }\n\n if (person.url && person.mailto) {\n const msg = `${preamble} Has both \"url\" and \"mailto\" property.`;\n showWarning(msg, name, {\n hint: `Please choose either \"url\" or \"mailto\" (\"url\" is preferred). ${seePersonHint}`,\n });\n }\n\n if (person.companyURL && !person.company) {\n const msg = `${preamble} Has a \"\\`companyURL\\`\" property but no \"\\`company\\`\" property.`;\n showWarning(msg, name, {\n hint: `Please add a \"\\`company\\`\" property. ${seePersonHint}.`,\n });\n }\n return true;\n };\n}\n\n/**\n *\n * @param {PersonExtras[]} extras\n * @param {string} hint\n * @param {string} preamble\n */\nfunction validateExtras(extras, hint, preamble) {\n if (!Array.isArray(extras)) {\n showError(\n `${preamble}. A person's \"extras\" member must be an array.`,\n name,\n { hint }\n );\n return false;\n }\n return extras.every((extra, index) => {\n switch (true) {\n case typeof extra !== \"object\":\n showError(\n `${preamble}. Member \"extra\" at index ${index} is not an object.`,\n name,\n {\n hint,\n }\n );\n return false;\n case !extra.hasOwnProperty(\"name\"):\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} is missing required \"name\" member.`,\n name,\n { hint }\n );\n return false;\n case typeof extra.name === \"string\" && extra.name.trim() === \"\":\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} \"name\" can't be empty.`,\n name,\n { hint }\n );\n return false;\n }\n return true;\n });\n}\n\n/**\n * @param {string} orcid\n * @returns {boolean}\n */\nfunction checkOrcidChecksum(orcid) {\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcid[orcid.length - 1];\n const remainder = orcid\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n return lastDigit === lastDigitShould;\n}\n","// @ts-check\nimport { getIntlData, showWarning } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nconst name = \"dini/templates/headers\";\n\nconst ccLicense = \"https://creativecommons.org/licenses/by/4.0/legalcode\";\n\nconst localizationStrings = {\n en: {\n author: \"Author:\",\n authors: \"Authors:\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest published version:\",\n this_version: \"This version:\",\n },\n ko: {\n author: \"ģ €ģž:\",\n authors: \"ģ €ģž:\",\n editor: \"ķŽøģ§‘ģž:\",\n editors: \"ķŽøģ§‘ģž:\",\n former_editor: \"ģ“ģ „ ķŽøģ§‘ģž:\",\n former_editors: \"ģ“ģ „ ķŽøģ§‘ģž:\",\n latest_editors_draft: \"ģµœģ‹  ķŽøģ§‘ ģ“ˆģ•ˆ:\",\n latest_published_version: \"ģµœģ‹  ė²„ģ „:\",\n this_version: \"ķ˜„ģž¬ ė²„ģ „:\",\n },\n zh: {\n author: \"ä½œč€…ļ¼š\",\n authors: \"ä½œč€…ļ¼š\",\n editor: \"ē¼–č¾‘ļ¼š\",\n editors: \"ē¼–č¾‘ļ¼š\",\n former_editor: \"原ē¼–č¾‘ļ¼š\",\n former_editors: \"原ē¼–č¾‘ļ¼š\",\n latest_editors_draft: \"꜀ꖰē¼–č¾‘č‰ēØæļ¼š\",\n latest_published_version: \"ęœ€ę–°å‘åøƒē‰ˆęœ¬ļ¼š\",\n this_version: \"ęœ¬ē‰ˆęœ¬ļ¼š\",\n },\n ja: {\n author: \"著者ļ¼š\",\n authors: \"著者ļ¼š\",\n editor: \"ē·Ø者ļ¼š\",\n editors: \"ē·Ø者ļ¼š\",\n former_editor: \"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š\",\n former_editors: \"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š\",\n latest_editors_draft: \"ęœ€ę–°ć®ē·Ø集ē”Øč‰ę”ˆļ¼š\",\n latest_published_version: \"ęœ€ę–°ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š\",\n this_version: \"ć“ć®ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š\",\n },\n nl: {\n author: \"Auteur:\",\n authors: \"Auteurs:\",\n editor: \"Redacteur:\",\n editors: \"Redacteurs:\",\n latest_editors_draft: \"Laatste werkversie:\",\n latest_published_version: \"Laatst gepubliceerde versie:\",\n this_version: \"Deze versie:\",\n },\n es: {\n author: \"Autor:\",\n authors: \"Autores:\",\n editor: \"Editor:\",\n editors: \"Editores:\",\n latest_editors_draft: \"Borrador de editor mas reciente:\",\n latest_published_version: \"VersiĆ³n publicada mas reciente:\",\n this_version: \"Ɖsta versiĆ³n:\",\n },\n de: {\n author: \"Autor/in:\",\n authors: \"Autor/innen:\",\n editor: \"Redaktion:\",\n editors: \"Redaktion:\",\n former_editor: \"FrĆ¼here Mitwirkende:\",\n former_editors: \"FrĆ¼here Mitwirkende:\",\n latest_editors_draft: \"Letzter Entwurf:\",\n latest_published_version: \"Letzte publizierte Fassung:\",\n this_version: \"Diese Fassung:\",\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nfunction getSpecSubTitleElem(conf) {\n let specSubTitleElem = document.querySelector(\"h2#subtitle\");\n\n if (specSubTitleElem && specSubTitleElem.parentElement) {\n specSubTitleElem.remove();\n conf.subtitle = specSubTitleElem.textContent.trim();\n } else if (conf.subtitle) {\n specSubTitleElem = document.createElement(\"h2\");\n specSubTitleElem.textContent = conf.subtitle;\n specSubTitleElem.id = \"subtitle\";\n }\n if (specSubTitleElem) {\n specSubTitleElem.classList.add(\"subtitle\");\n }\n return specSubTitleElem;\n}\n\nexport default conf => {\n return html`<div class=\"head\">\n ${conf.logos.map(showLogo)} ${document.querySelector(\"h1#title\")}\n ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.textStatus}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\n <dt>${conf.multipleEditors ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>${conf.multipleAuthors ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${renderCopyright(conf)}\n <hr />\n </div>`;\n};\n\n/**\n * @param {string} text\n * @param {string} url\n * @param {string=} cssClass\n */\nfunction linkLicense(text, url, cssClass) {\n return html`<a rel=\"license\" href=\"${url}\" class=\"${cssClass}\">${text}</a>`;\n}\n\nfunction renderCopyright(conf) {\n // If there is already a copyright, let's relocate it.\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n return existingCopyright;\n }\n if (conf.hasOwnProperty(\"overrideCopyright\")) {\n const msg = \"The `overrideCopyright` configuration option is deprecated.\";\n const hint = 'Please use `<p class=\"copyright\">` instead.';\n showWarning(msg, name, { hint });\n }\n return conf.overrideCopyright\n ? [conf.overrideCopyright]\n : html`<p class=\"copyright\">\n Dieses Dokument ist lizensiert unter\n ${linkLicense(\n \"Creative Commons Attribution 4.0 International Public License\",\n ccLicense,\n \"subfoot\"\n )}.\n </p>`;\n}\n","// @ts-check\n// Module dini/headers\n// Generate the headers material based on the provided configuration.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n// - editors: an array of people editing the document (at least one is required). People\n// are defined using:\n// - name: the person's name (required)\n// - url: URI for the person's home page\n// - company: the person's company\n// - companyURL: the URI for the person's company\n// - mailto: the person's email\n// - note: a note on the person (e.g. former editor)\n// - authors: an array of people who are contributing authors of the document.\n// - formerEditors: an array of people that had earlier edited the document but no longer edit.\n// - subtitle: a subtitle for the specification\n// - publishDate: the date to use for the publication, default to document.lastModified, and\n// failing that to now. The format is YYYY-MM-DD or a Date object.\n// - alternateFormats: a list of alternate formats for the document, each of which being\n// defined by:\n// - uri: the URI to the alternate\n// - label: a label for the alternate\n// - lang: optional language\n// - type: optional MIME type\n// - logos: a list of logos to use instead of the W3C logo, each of which being defined by:\n// - src: the URI to the logo (target of <img src=>)\n// - alt: alternate text for the image (<img alt=>), defaults to \"Logo\" or \"Logo 1\", \"Logo 2\", ...\n// if src is not specified, this is the text of the \"logo\"\n// - height: optional height of the logo (<img height=>)\n// - width: optional width of the logo (<img width=>)\n// - url: the URI to the organization represented by the logo (target of <a href=>)\n// - id: optional id for the logo, permits custom CSS (wraps logo in <span id=>)\n// - each logo element must specify either src or alt\n// - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc).\n// Example of usage: [{key: \"foo\", href:\"https://b\"}, {key: \"bar\", href:\"https://\"}].\n// Allowed values are:\n// - key: the key for the <dt> (e.g., \"Bug Tracker\"). Required.\n// - value: The value that will appear in the <dd> (e.g., \"GitHub\"). Optional.\n// - href: a URL for the value (e.g., \"https://foo.com/issues\"). Optional.\n// - class: a string representing CSS classes. Optional.\n// - license: can be one of the following\n// - \"cc-by-sa\"\n// - \"cc-by\"\n// - \"cc0\"\nimport { ISODate, showError } from \"../core/utils.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { pub } from \"../core/pubsubhub.js\";\n\nexport const name = \"dini/headers\";\n\nconst DINIDate = new Intl.DateTimeFormat([\"de-DE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n});\n\nconst status2text = {\n unofficial: \"Entwurf vom\",\n base: \"Spezifikation vom\",\n};\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg =\n `[\\`${prop}\\`](https://github.com/speced/respec/wiki/${prop}) ` +\n `is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n conf.isBasic = conf.specStatus === \"base\";\n if (!conf.specStatus) {\n const msg = \"Missing required configuration: `specStatus`\";\n showError(msg, name);\n }\n conf.title = document.title || \"Kein Titel\";\n if (!conf.subtitle) conf.subtitle = \"\";\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.publishYear = conf.publishDate.getUTCFullYear();\n conf.publishHumanDate = DINIDate.format(conf.publishDate);\n const peopCheck = function (it) {\n if (!it.name) {\n const msg = \"All authors and editors must have a name.\";\n showError(msg, name);\n }\n if (it.orcid) {\n try {\n it.orcid = normalizeOrcid(it.orcid);\n } catch (e) {\n const msg = `\"${it.orcid}\" is not an ORCID. ${e.message}`;\n showError(msg, name);\n // A failed orcid link could link to something outside of orcid,\n // which would be misleading.\n delete it.orcid;\n }\n }\n };\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\n conf.editors.forEach(peopCheck);\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n }\n if (!conf.editors || conf.editors.length === 0) {\n const msg = \"At least one editor is required\";\n showError(msg, name);\n }\n if (conf.formerEditors.length) {\n conf.formerEditors.forEach(peopCheck);\n }\n if (conf.authors) {\n conf.authors.forEach(peopCheck);\n }\n conf.multipleEditors = conf.editors && conf.editors.length > 1;\n conf.multipleFormerEditors = conf.formerEditors.length > 1;\n conf.multipleAuthors = conf.authors && conf.authors.length > 1;\n (conf.alternateFormats || []).forEach(it => {\n if (!it.uri || !it.label) {\n const msg = \"All alternate formats must have a uri and a label.\";\n showError(msg, name);\n }\n });\n if (conf.copyrightStart && conf.copyrightStart == conf.publishYear)\n conf.copyrightStart = \"\";\n conf.textStatus = status2text[conf.specStatus];\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n // configuration done - yay!\n\n // insert into document\n const header = headersTmpl(conf);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // Requested by https://github.com/speced/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: `${conf.longStatus} ${conf.publishHumanDate}`,\n });\n}\n\n/**\n * @param {string} orcid Either an ORCID URL or just the 16-digit ID which comes after the /\n * @return {string} the full ORCID URL. Throws an error if the ID is invalid.\n */\nfunction normalizeOrcid(orcid) {\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n if (orcidUrl.origin !== \"https://orcid.org\") {\n throw new Error(\n `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`\n );\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n throw new Error(\n `ORCIDs have the format \"1234-1234-1234-1234\", not \"${orcidId}\"`\n );\n }\n\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcidId[orcidId.length - 1];\n const remainder = orcidId\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n if (lastDigit !== lastDigitShould) {\n throw new Error(`\"${orcidId}\" has an invalid checksum.`);\n }\n\n return orcidUrl.href;\n}\n","// @ts-check\n// Module dini/abstract\n// Handle the abstract section properly.\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"dini/abstract\";\n\nconst localizationStrings = {\n en: {\n abstract: \"Abstract\",\n },\n ko: {\n abstract: \"ģš”ģ•½\",\n },\n zh: {\n abstract: \"ę‘˜č¦\",\n },\n ja: {\n abstract: \"要ē“„\",\n },\n nl: {\n abstract: \"Samenvatting\",\n },\n es: {\n abstract: \"Resumen\",\n },\n de: {\n abstract: \"Zusammenfassung\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run() {\n const abs = document.getElementById(\"abstract\");\n if (!abs) {\n const msg = `Document must have one element with \\`id=\"abstract\"`;\n showError(msg, name);\n return;\n }\n abs.classList.add(\"introductory\");\n let abstractHeading = document.querySelector(\"#abstract>h2\");\n if (abstractHeading) {\n return;\n }\n abstractHeading = document.createElement(\"h2\");\n abstractHeading.textContent = l10n.abstract;\n abs.prepend(abstractHeading);\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Module core/data-abbr\n// - Finds all elements with data-abbr attribute and processes them.\nimport { showError } from \"./utils.js\";\nexport const name = \"core/dfn-abbr\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = document.querySelectorAll(\"[data-abbr]\");\n for (const elem of elements) {\n const { localName } = elem;\n switch (localName) {\n case \"dfn\":\n processDfnElement(elem);\n break;\n default: {\n const msg = `\\`data-abbr\\` attribute not supported on \\`${localName}\\` elements.`;\n showError(msg, name, {\n elements: [elem],\n title: \"Error: unsupported.\",\n });\n }\n }\n }\n}\n/**\n * @param {HTMLElement} dfn\n */\nfunction processDfnElement(dfn) {\n const abbr = generateAbbreviation(dfn);\n // get normalized <dfn> textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (<abbr title=\"${fullForm}\">${abbr}</abbr>)`\n );\n const lt = dfn.dataset.lt || \"\";\n dfn.dataset.lt = lt\n .split(\"|\")\n .filter(i => i.trim())\n .concat(abbr)\n .join(\"|\");\n}\n\nfunction generateAbbreviation(elem) {\n if (elem.dataset.abbr) return elem.dataset.abbr;\n // Generates abbreviation from textContent\n // e.g., \"Permanent Account Number\" -> \"PAN\"\n return elem.textContent\n .match(/\\b([a-z])/gi)\n .join(\"\")\n .toUpperCase();\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/speced/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"ģ°øģ”°\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参ē…§ē”Øå‚č€ƒę–‡ēŒ®\",\n norm_references: \"č¦ēƄēš„å‚č€ƒę–‡ēŒ®\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n de: {\n info_references: \"WeiterfĆ¼hrende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"éžč§„čŒƒę€§å¼•ē”Ø\",\n norm_references: \"č§„čŒƒę€§å¼•ē”Ø\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMƜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NƖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDƜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKƖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;\"?<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn or a `a`, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn,a\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn|abstract-op\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n /** @param {string} str */\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","// @ts-check\n// Module dini/conformance\n// Handle the conformance section properly.\nimport { getIntlData, htmlJoinAnd, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"dini/conformance\";\n\nconst localizationStrings = {\n en: {\n conformance: \"Conformance\",\n normativity:\n \"As well as sections marked as non-normative, all authoring guidelines, \" +\n \"diagrams, examples, and notes in this specification are non-normative. \" +\n \"Everything else in this specification is normative.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n The key word${plural ? \"s\" : \"\"} ${keywords} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n when, and only when, they appear in all capitals, as shown here.\n </p>`;\n },\n },\n de: {\n conformance: \"Anforderungen\",\n normativity:\n \"Neben den explizit als nicht-normativ gekennzeichneten Abschnitten \" +\n \"sind auch alle Diagramme, Beispiele und Hinweise in diesem Dokument \" +\n \"nicht normativ. Alle anderen Angaben sind normativ.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n ${plural ? \"Die SchlĆ¼sselwƶrter\" : \"Das SchlĆ¼sselwort\"} ${keywords} in\n diesem Dokument ${plural ? \"sind\" : \"ist\"} gemƤƟ\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n und unter BerĆ¼cksichtigung von\n <a href=\"https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst\"\n >2119de</a\n >\n zu interpretieren, wenn und nur wenn ${plural ? \"sie\" : \"es\"} wie hier\n gezeigt durchgehend groƟ geschrieben wurde${plural ? \"n\" : \"\"}.\n </p>`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = [...Object.keys(rfc2119Usage)];\n // Add RFC2119 to bibliography\n if (terms.length) {\n conf.normativeReferences.add(\"RFC2119\");\n conf.normativeReferences.add(\"RFC8174\");\n }\n // Put in the 2119 clause and reference\n const keywords = htmlJoinAnd(\n terms.sort(),\n item => html`<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h1>${l10n.conformance}</h1>\n <p>${l10n.normativity}</p>\n ${terms.length ? l10n.keywordInterpretation(keywords, plural) : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance && !conformance.classList.contains(\"override\")) {\n processConformance(conformance, conf);\n }\n // Warn when there are RFC2119/RFC8174 keywords, but not conformance section\n if (!conformance && Object.keys(rfc2119Usage).length) {\n const msg = `Document uses RFC2119 keywords but lacks a conformance section.`;\n const hint = 'Please add a `<section id=\"conformance\">`.';\n showWarning(msg, name, { hint });\n }\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"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`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"ģ˜ˆģ‹œ\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-color: var(--warning-border, #f11);\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n background: var(--warning-bg, #fbe9e9);\n color: black;\n color: var(--text, black);\n}\n\n.warning-title:before {\n content: \"āš \"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"ę³Ø\",\n editors_note: \"ē·Ø者ę³Ø\",\n feature_at_risk: \"(å¤‰ę›“ć®åÆčƒ½ę€§ć®ć‚ć‚‹ę©Ÿčƒ½) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 恮要ē“„\",\n no_issues_in_spec: \"ć“ć®ä»•ę§˜ć«ćÆęœŖč§£ę±ŗ恮 issues ćÆå«ć¾ć‚Œć¦ć„ć¾ć›ć‚“ļ¼Ž\",\n warning: \"č­¦å‘Š\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"CuestiĆ³n\",\n issue_summary: \"Resumen de la cuestiĆ³n\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificaciĆ³n.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthƤlt keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"ē¼–者ę³Ø\",\n feature_at_risk: \"ļ¼ˆęœ‰åÆčƒ½å˜åŠØēš„ē‰¹ę€§ļ¼‰Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue ꀻē»“\",\n no_issues_in_spec: \"ęœ¬č§„čŒƒäø­ęœŖ列å‡ŗ任何 issue怂\",\n note: \"ę³Ø\",\n warning: \"č­¦å‘Š\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"꜀č‰Æå®Ÿę–½ä¾‹ \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"ęœ€ä½³å®žč·µ \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"å›³ć®ćƒŖć‚¹ćƒˆ\",\n },\n ko: {\n fig: \"ź·øė¦¼ \",\n list_of_figures: \"ź·øė¦¼ ėŖ©ė”\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范äø­åŒ…含ēš„图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of the specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n *\n * @module core/data-cite\n */\n\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to the current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n * @type {string}\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * Gets the link properties for the given citation details.\n * @param {CiteDetails} citeDetails - The citation details.\n * @returns {Promise<LinkProps|null>} The link properties or null if not found.\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/speced/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n\n return { href, title };\n}\n\n/**\n * Links the given element with the provided link properties and citation details.\n * @param {HTMLElement} elem - The element to link.\n * @param {LinkProps} linkProps - The link properties.\n * @param {CiteDetails} citeDetails - The citation details.\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n anchor.dataset.cite = citeDetails.key;\n anchor.dataset.citePath = citeDetails.path;\n anchor.dataset.citeFrag = citeDetails.frag;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting a linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * Converts the given raw key to citation details.\n * @param {HTMLElement} elem - The element containing the citation details.\n * @returns {CiteDetails} The citation details.\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as a fragment\n return toCiteDetails(elem);\n }\n\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\n/**\n * Runs the data-cite processing on elements with the data-cite attribute.\n */\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetches and updates `biblio` with entries corresponding to the given elements.\n * @param {HTMLElement[]} elems - The elements requiring biblio entries.\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/**\n * Cleans up the data-cite attributes from the document.\n * @param {Document} doc - The document to cleanup.\n */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ć®é‡č¤‡å®šē¾©`;\n },\n duplicateTitle: \"恓恮ꖇę›øå†…ć§č¤‡ę•°å›žå®šē¾©ć•ć‚Œć¦ć„ć¾ć™ļ¼Ž\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthƤlt mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ēš„重复定义`;\n },\n duplicateTitle: \"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n for (const type of linkType.split(\"|\")) {\n if (dfnsByType.get(type)) {\n return dfnsByType.get(type);\n }\n }\n return dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name);\n console.error(error);\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大ēŗ²\",\n },\n ko: {\n toc: \"ėŖ©ģ°Ø\",\n },\n ja: {\n toc: \"ē›®ę¬”\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at Ā§1, we will keep Ā§1.1 but not Ā§1.1.1\n // Similarly, `data-max-toc=1` will keep Ā§1, but not Ā§1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"ģ“ ė¶€ė¶„ģ€ ė¹„ź·œė²”ģ ģž…ė‹ˆė‹¤.\",\n },\n ja: {\n informative: \"恓恮ēƀćÆä»•ę§˜ć«ćÆå«ć¾ć‚Œć¾ć›ć‚“ļ¼Ž\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"äæå­˜ć™ć‚‹\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"åƼå‡ŗ\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"šŸ’¾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关äŗŽ\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"ć“ć‚Œć«ć¤ć„ć¦\",\n },\n de: {\n about_respec: \"Ɯber\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ā„¹ļø\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/speced/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/speced/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\nimport { html } from \"../core/import-maps.js\";\n\nexport const name = \"core/seo\";\n\nexport function run(conf) {\n if (conf.gitRevision) {\n // This allows to set a git revision of the source used to produce the\n // generated content. Typically, this would be set when generating the\n // static HTML via a build process.\n // 'revision' is the name recommended in https://wiki.whatwg.org/wiki/MetaExtensions\n const metaElem = html`<meta\n name=\"revision\"\n content=\"${conf.gitRevision}\"\n />`;\n document.head.appendChild(metaElem);\n }\n\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","/*\nOne Light for ReSpec, with better color contrast\nAdapted from Atom One Light by Daniel Gamage (https://github.com/highlightjs/highlight.js/blob/c0b6ddbaaf7/src/styles/atom-one-light.css>\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n --base: #fafafa;\n --mono-1: #383a42;\n --mono-2: #686b77;\n --mono-3: #717277;\n --hue-1: #0b76c5;\n --hue-2: #336ae3;\n --hue-3: #a626a4;\n --hue-4: #42803c;\n --hue-5: #ca4706;\n --hue-5-2: #c91243;\n --hue-6: #986801;\n --hue-6-2: #9a6a01;\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n .hljs {\n --base: #282c34;\n --mono-1: #abb2bf;\n --mono-2: #818896;\n --mono-3: #5c6370;\n --hue-1: #56b6c2;\n --hue-2: #61aeee;\n --hue-3: #c678dd;\n --hue-4: #98c379;\n --hue-5: #e06c75;\n --hue-5-2: #be5046;\n --hue-6: #d19a66;\n --hue-6-2: #e6c07b;\n }\n}\n\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n color: var(--mono-1, #383a42);\n background: #fafafa;\n background: var(--base, #fafafa);\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n color: var(--mono-3, #717277);\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n color: var(--hue-3, #a626a4);\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n color: var(--hue-5, #ca4706);\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n color: var(--hue-1, #0b76c5);\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n color: var(--hue-4, #42803c);\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n color: var(--hue-6-2, #9a6a01);\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n color: var(--hue-6, #986801);\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n color: var(--hue-2, #336ae3);\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n var.respec-hl {\n filter: saturate(0.9) brightness(0.9)\n }\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within the algorithm or the encompassing section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\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","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar {\n position: relative;\n cursor: pointer;\n}\n\nvar[data-type]::before,\nvar[data-type]::after {\n position: absolute;\n left: 50%;\n top: -6px;\n opacity: 0;\n transition: opacity 0.4s;\n pointer-events: none;\n}\n\n/* the triangle or arrow or caret or whatever */\nvar[data-type]::before {\n content: \"\";\n transform: translateX(-50%);\n border-width: 4px 6px 0 6px;\n border-style: solid;\n border-color: transparent;\n border-top-color: #222;\n}\n\n/* actual text */\nvar[data-type]::after {\n content: attr(data-type);\n transform: translateX(-50%) translateY(-100%);\n background: #222;\n text-align: center;\n /* additional styling */\n font-family: \"Dank Mono\", \"Fira Code\", monospace;\n font-style: normal;\n padding: 6px;\n border-radius: 3px;\n color: #daca88;\n text-indent: 0;\n font-weight: normal;\n}\n\nvar[data-type]:hover::after,\nvar[data-type]:hover::before {\n opacity: 1;\n}\n`;\n","// @ts-check\n/**\n * Module core/data-type\n * Propagates data type of a <var> to subsequent instances within a section.\n * Also adds the CSS for the data type tooltip.\n * Set `conf.highlightVars = true` to enable.\n */\nimport css from \"../styles/datatype.css.js\";\n\nexport const name = \"core/data-type\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n\n let section = null;\n const varMap = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const variables = document.querySelectorAll(\"section var\");\n for (const varElem of variables) {\n const currentSection = varElem.closest(\"section\");\n if (section !== currentSection) {\n section = currentSection;\n varMap.clear();\n }\n if (varElem.dataset.type) {\n varMap.set(varElem.textContent.trim(), varElem.dataset.type);\n continue;\n }\n const type = varMap.get(varElem.textContent.trim());\n if (type) varElem.dataset.type = type;\n }\n}\n","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n:root {\n --assertion-border: #aaa;\n --assertion-bg: #eee;\n --assertion-text: black;\n}\n\n.assert {\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n border-color: #aaa;\n border-color: var(--assertion-border);\n background: #eee;\n background: var(--assertion-bg);\n color: black;\n color: var(--assertion-text);\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n :root {\n --assertion-border: #444;\n --assertion-bg: var(--borderedblock-bg);\n --assertion-text: var(--text);\n }\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"Ā§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/speced/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n background: var(--indextable-hover-bg, #fff);\n color: black;\n color: var(--text, black);\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: 0 1em 3em -0.4em var(--tocsidebar-shadow, rgba(0, 0, 0, 0.3)),\n 0 0 1px 1px var(--tocsidebar-shadow, rgba(0, 0, 0, 0.05));\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n border-bottom-color: var(--indextable-hover-bg, #fff);\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n /* TODO: need slightly darker shade */\n border-bottom-color: var(--indextable-hover-bg, #a2a9b1);\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n color: var(--text, #000);\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n color: var(--text, #333);\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => {\n return html`<li>\n ${toLinkProps(entry).map(link => {\n return html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a\n >${\" \"}`;\n })}\n </li>`;\n };\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `Ā§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/speced/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"ģ°øģ—¬\",\n },\n zh: {\n file_a_bug: \"反馈错čÆÆ\",\n participate: \"参äøŽļ¼š\",\n },\n ja: {\n commit_history: \"å¤‰ę›“å±„ę­“\",\n file_a_bug: \"問锌報告\",\n participate: \"å‚åŠ ę–¹ę³•ļ¼š\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${ghURL.href}).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","// @ts-check\n/**\n * Fetches commits between two commitish (tag or commit) - `from` and `to=HEAD`\n * and shows them as a list of \"changes during\" those commitish. If a filter\n * function is provided by the user, it is used to filter the commits that are\n * to be shown. Otherwise, all commits are shown.\n *\n * @typedef {{message: string, hash: string}} Commit\n */\nimport { github } from \"../github.js\";\nimport { html } from \"../import-maps.js\";\nimport { showError } from \"../utils.js\";\n\nexport const name = \"rs-changelog\";\n\nexport const element = class ChangelogElement extends HTMLElement {\n constructor() {\n super();\n this.props = {\n from: this.getAttribute(\"from\"),\n to: this.getAttribute(\"to\") || \"HEAD\",\n /** @type {(commit: Commit) => boolean} */\n filter:\n typeof window[this.getAttribute(\"filter\")] === \"function\"\n ? window[this.getAttribute(\"filter\")]\n : () => true,\n };\n }\n\n connectedCallback() {\n const { from, to, filter } = this.props;\n html.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error => showError(error.message, name, { elements: [this] }))\n .finally(() => {\n this.dispatchEvent(new CustomEvent(\"done\"));\n }),\n placeholder: \"Loading list of commits...\",\n }}\n </ul>\n `;\n }\n};\n\nasync function fetchCommits(from, to, filter) {\n /** @type {Commit[]} */\n let commits;\n try {\n const gh = await github;\n if (!gh) {\n throw new Error(\"`respecConfig.github` is not set\");\n }\n const url = new URL(\"commits\", `${gh.apiBase}/${gh.fullName}/`);\n url.searchParams.set(\"from\", from);\n url.searchParams.set(\"to\", to);\n\n const res = await fetch(url.href);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n commits = await res.json();\n if (!commits.length) {\n throw new Error(`No commits between ${from}..${to}.`);\n }\n commits = commits.filter(filter);\n } catch (error) {\n const msg = `Error loading commits from GitHub. ${error.message}`;\n console.error(error);\n throw new Error(msg);\n }\n return commits;\n}\n\nasync function toHTML(commits) {\n const { repoURL } = await github;\n return commits.map(commit => {\n const [message, prNumber = null] = commit.message.split(/\\(#(\\d+)\\)/, 2);\n const commitURL = `${repoURL}commit/${commit.hash}`;\n const prURL = prNumber ? `${repoURL}pull/${prNumber}` : null;\n const pr = prNumber && html` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return html`<li><a href=\"${commitURL}\">${message.trim()}</a>${pr}</li>`;\n });\n}\n","// @ts-check\n/**\n * Registers custom elements and waits for them to finish their processing.\n *\n * Every custom element file exports:\n * - `name`: registered name of the custom element, prefixed with `rs-`.\n * - `element`: class defintion of the custom element.\n *\n * Every custom element must dispatch a CustomEvent 'done' that tells the\n * element has finished its processing, with or without errors.\n *\n * @typedef {{ name: string, element: CustomElementConstructor }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements/index\";\n\nexport async function run() {\n // prepare and register elements\n CUSTOM_ELEMENTS.forEach(el => {\n customElements.define(el.name, el.element);\n });\n\n // wait for each element to be ready\n const selectors = CUSTOM_ELEMENTS.map(el => el.name).join(\", \");\n const elems = document.querySelectorAll(selectors);\n const readyPromises = [...elems].map(\n el => new Promise(res => el.addEventListener(\"done\", res, { once: true }))\n );\n await Promise.all(readyPromises);\n}\n","export const name = \"core/dfn-contract\";\n\nexport function run() {\n addContractDefaults();\n addDefinitionPointers();\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n\n// - Sets data-defines on well-known definition content patterns\nfunction addDefinitionPointers() {\n // A dl with class hasdefinitions associated the dfn in each dt\n // the definition in the following sibling element\n /** @type NodeListOf<HTMLElement> */\n const describedDTs = document.querySelectorAll(\n \"dl.definitions dt:has(dfn[data-dfn-type])\"\n );\n for (const dt of describedDTs) {\n const dfnId = dt.querySelector(\"dfn[data-dfn-type]\").id;\n const dfnContent = /** @type {HTMLElement | null} */ (\n dt.nextElementSibling\n );\n if (dfnContent && !dfnContent.dataset.defines && dfnId) {\n dfnContent.dataset.defines = `#${dfnId}`;\n }\n }\n\n // an element with class \"definition\" is marked as defining the term\n // found in the element\n /** @type NodeListOf<HTMLElement> */\n const definitionContainers = document.querySelectorAll(\n \".definition:has(dfn[data-dfn-type])\"\n );\n for (const el of definitionContainers) {\n const dfn = el.querySelector(\"dfn[data-dfn-type]\");\n if (dfn.id && !el.dataset.defines) {\n el.dataset.defines = `#${dfn.id}`;\n }\n }\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ \\`<meta>\\` ꠇē­¾`,\n hint: `å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ \\`<head>\\` éƒØ分ā€”ā€” \\`<meta charset=\"utf-8\">\\` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂\",\n hint: \"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * Checks that there is a section that has at least privacy and/or\n * security and considerations.\n *\n * The rule is \"privacy\" or \"security\", and \"considerations\", in any order,\n * case-insensitive, multi-line check.\n *\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"privsec-section\";\nexport const name = \"core/linter-rules/privsec-section\";\n\nconst localizationStrings = {\n en: {\n msg: \"Document must have a 'Privacy and/or Security' Considerations section.\",\n hint:\n \"Add a privacy and/or security considerations section. \" +\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nfunction hasPriSecConsiderations(doc) {\n return Array.from(doc.querySelectorAll(\"h2, h3, h4, h5, h6\")).some(\n ({ textContent: text }) => {\n const saysPrivOrSec = /(privacy|security)/im.test(text);\n const saysConsiderations = /(considerations)/im.test(text);\n return (saysPrivOrSec && saysConsiderations) || saysPrivOrSec;\n }\n );\n}\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n if (conf.isRecTrack && !hasPriSecConsiderations(document)) {\n showWarning(l10n.msg, name, { hint: l10n.hint });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,\n hint: \"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","instanceOfAny","constructors","some","c","idbProxyableTypes","cursorAdvanceMethods","transactionDoneMap","WeakMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","replaceTraps","wrapFunction","func","IDBCursor","prototype","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","request","transformCachableValue","tx","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","cacheDonePromiseForTransaction","IDBDatabase","IDBObjectStore","IDBIndex","Proxy","IDBRequest","promise","success","result","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","transaction","store","index","shift","oldTraps","advanceMethodProps","methodMap","advanceResults","ittrProxiedCursorToOriginalProxy","cursorIteratorTraps","cachedFunc","iterate","cursor","openCursor","proxiedCursor","delete","isIteratorProp","Symbol","asyncIterator","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","catch","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","_getDefaults","breaks","extensions","gfm","hooks","pedantic","renderer","silent","tokenizer","walkTokens","_defaults","changeDefaults","newDefaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape$1","encode","unescapeTest","unescape","_","n","charAt","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","valSource","getRegex","cleanUrl","href","encodeURI","noopTest","exec","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","i","trim","length","pop","splice","push","rtrim","invert","l","suffLen","currChar","slice","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","_Tokenizer","rules","constructor","space","src","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","anyPunctuation","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","bull","isordered","ordered","start","loose","items","itemRegex","itemContents","endsWithBlankLine","endEarly","line","t","repeat","nextLine","indent","trimStart","search","blankLine","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","rawLine","ischecked","istask","task","checked","trimEnd","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","headers","aligns","rows","item","header","align","row","cell","lheading","paragraph","escape","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","indexOf","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","emStrongLDelim","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","emStrongRDelimAst","emStrongRDelimUnd","lastIndex","lastCharLength","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","bullet","_paragraph","_blockLabel","_tag","_comment","blockNormal","gfmTable","blockGfm","blockPedantic","_punctuation","_inlineComment","_inlineLabel","inlineNormal","blockSkip","reflinkSearch","inlinePedantic","inlineGfm","inlineBreaks","normal","_Lexer","inlineQueue","Object","create","lex","lexInline","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","call","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","charCodeAt","console","keepPrevChar","keys","lastIndexOf","startInline","_Renderer","infostring","quote","body","listitem","checkbox","tablerow","content","tablecell","flags","strong","em","cleanHref","out","image","_TextRenderer","_Parser","textRenderer","parse","parseInline","renderers","genericToken","ret","parser","headingToken","codeToken","tableToken","j","k","blockquoteToken","listToken","itemBody","unshift","htmlToken","paragraphToken","textToken","escapeToken","tagToken","linkToken","imageToken","strongToken","emToken","codespanToken","delToken","_Hooks","static","Set","preprocess","markdown","postprocess","processAllTokens","markedInstance","defaults","setOptions","parseMarkdown","Parser","Renderer","TextRenderer","Lexer","Tokenizer","Hooks","use","values","concat","childTokens","flat","pack","opts","ext","prevRenderer","extLevel","rendererProp","rendererFunc","tokenizerProp","tokenizerFunc","prevTokenizer","hooksProp","hooksFunc","prevHook","passThroughHooks","arg","packWalktokens","origOpt","warn","throwError","onError","toString","message","msg","marked","getDefaults","globalThis","global","getDefaultExportFromCjs","x","__esModule","hasOwnProperty","module","pluralize$1","exports","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","arguments","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","configurable","o","random","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","v","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ne","re","ie","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","sort","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","setTimeout","addedNodes","removedNodes","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","key","serialize","_pluralize","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","startsWith","W3CDate","nonNormativeSelector","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","getElementsByTagName","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","markAsOffending","toJSON","details","showError","pluginName","makePluginUtils","toMDCode","codedJoinOr","quotes","docLink","strings","reindent","endsWith","linkingText","lines","indents","leastIndent","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","toHTML","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodeURIComponent","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","utils","err","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$h","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","buttonId","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$p","style$1","dataInclude","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","saveHtml","aboutRespec","seo","highlight","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","dfnContract","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","newHash","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","diniDefaults","isED","isNoTrack","isPR","logos","prependW3C","doJsonLd","license","shortName","showPreviousVersion","licenseInfo","computeProps","css$f","noReSpecCSS","resourceHints","createResourceHints","createBaseStyle","meta","delimiter","separator","toKeyValuePairs","width","createMetaViewport","styleFile","noToc","attachFixupScript","finalStyleURL","linkURL","urls","frag","reduce","nextLink","linkCSS","exportDoc","w3cStyle","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","default_title","zh","h1Elem","isConnected","tempElem","documentTitle","isPreview","prNumber","prUrl","github","repoURL","setDocumentTitle","showLink","class","showLinkData","showLogo","logo","alt","height","until","date","es","ko","ja","orcidIcon","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","remainder","Number","acc","lastDigitInt","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","Date","extras","every","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","protocol","hCard","companyElem","note","classVal","renderExtra","time","ccLicense","author","authors","editor","editors","former_editor","former_editors","latest_editors_draft","latest_published_version","this_version","nl","headersTmpl","specSubTitleElem","subtitle","getSpecSubTitleElem","textStatus","dashDate","publishHumanDate","multipleEditors","formerEditors","multipleFormerEditors","multipleAuthors","otherLinks","existingCopyright","overrideCopyright","cssClass","renderCopyright","DINIDate","status2text","unofficial","base","isUnofficial","isBasic","publishDate","fallbackDate","isFinite","formattedDate","validateDateAndRecover","lastModified","publishYear","getUTCFullYear","peopCheck","normalizeOrcid","alternateFormats","uri","copyrightStart","publishISODate","toISOString","generatedSubtitle","longStatus","abs","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","range","IDBKeyRange","lowerBound","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","addAll","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","clear","storeNames","stores","clearStorePromises","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","normativity","keywordInterpretation","processConformance","terms","contains","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","closestType","computeExport","export","titles","pluralizeDfn","dfnTexts","dfns","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$d","makeTitle","num","report","number","div","inAside","exampleTitle","css$b","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","handleIssues","ins","ghIssues","getIssueNumber","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","issueBase","atRiskBase","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","issuesURL","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","apiBase","issueNumbers","fullName","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","decorateTableOfFigures","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","citePath","citeFrag","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","about_respec","getEntriesByType","duration","round","perfEntryToTR","gitRevision","metaElem","firstParagraph","css$9","fetchBase","_documentCurrentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","css$5","varMap","variables","currentSection","css$3","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","file_a_bug","participate","commit_history","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","dfnsWithNoType","exportableDfns","addContractDefaults","describedDTs","dfnId","dfnContent","defines","definitionContainers","addDefinitionPointers","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"qHACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IACrD,EACEV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCtBO,MAIDC,EAAgB,IAAIC,YAOnB,SAASC,EAAIC,EAAOC,GAEzB,GADAJ,EAAcK,cAAc,IAAIC,YAAYH,EAAO,CAAEC,YACjDnB,OAAOsB,SAAWtB,OAAOuB,KAC3B,OA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AKG,CACE,CAAC,MAAO,IACR,CAAC,SAAU,MACX,CAAC,gEAAiE,QAClE,CAAC,kCAAmC,OACpC,CAAC,QAAS,KACV,CAAC,uFAAwF,QACzF,CAAC,oBAAqB,QACtB,CAAC,uBAAwB,UACzB,CAAC,sBAAuB,MACxB,CAAC,2FAA4F,MAC7F,CAAC,qEAAsE,SACvE,CAAC,iCAAkC,MACnC,CAAC,oBAAqB,QACtB,CAAC,4FAA6F,QAC9F,CAAC,yGAA0G,QAC3G,CAAC,8FAA+F,QAChG,CAAC,0BAA2B,OAC5B,CAAC,+BAAgC,QACjC,CAAC,sBAAuB,QACxB,CAAC,oBAAqB,UACtB,CAAC,eAAgB,MACjB,CAAC,YAAa,MACd,CAAC,QAAS,QACVtH,SAAQ,SAAUsH,GAClB,OAAOR,EAAU4B,gBAAgBpB,EAAK,GAAIA,EAAK,GACpD,IAKG,CAEE,YACA,SACA,SACA,MACA,WACA,UACA,OACA,YACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,SACA,WACA,YACA,MACA,SACA,YACA,YACA,YACA,WACA,WACA,MACA,UACA,UACA,WACA,WACA,eACA,SACA,SACA,YACA,WACA,YACA,cACA,QACA,UACA,QACA,SACA,aACA,YACA,WACA,OACA,QACA,OACA,QACA,QACA,MACA,QACA,OACA,OACA,YACA,OACA,WACA,SACA,SACA,YACA,WACA,OACA,WACA,OACA,SACA,WACA,SACA,SACA,WACA,SACA,WACA,UACA,QACA,QACA,SACA,UACA,iBACA,QACA,OACA,SACA,UACA,UACA,aACA,WACA,MACA,eAEA,gBACA,SACA,SACA,YACA,WACA,QACA,WACAtH,QAAQ8G,EAAU6B,oBAEb7B,CACV,IAGA,IACIA,GAAyBR,GADNK,GAAYC,SCjgBGkC,GAAU,SAASC,GAAgB,IAAI/P,EAAE,CAAE,EAAC,IAAIA,EAAE9N,QAAQA,OAAO,CAAC,MAAMlB,GAAGgP,EAAE9N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sources":["../src/core/expose-modules.js","../src/core/l10n.js","../node_modules/idb/build/index.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/utils.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/dini.js","../src/core/location-hash.js","../src/core/defaults.js","../src/dini/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/dini/style.js","../src/core/sections.js","../src/core/data-include.js","../src/core/reindent.js","../src/core/title.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/dini/templates/headers.js","../src/dini/headers.js","../src/dini/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/dini/conformance.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/ui/save-html.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/github.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/dfn-contract.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/no-http-props.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\n// Explicitly default lang and dir on <html> if not set.\n// We assume English and ltr as default for international standards.\nif (!html?.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html?.lang ?? \"en\";\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst transactionDoneMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(this.request);\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nconst advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance'];\nconst methodMap = {};\nconst advanceResults = new WeakMap();\nconst ittrProxiedCursorToOriginalProxy = new WeakMap();\nconst cursorIteratorTraps = {\n get(target, prop) {\n if (!advanceMethodProps.includes(prop))\n return target[prop];\n let cachedFunc = methodMap[prop];\n if (!cachedFunc) {\n cachedFunc = methodMap[prop] = function (...args) {\n advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args));\n };\n }\n return cachedFunc;\n },\n};\nasync function* iterate(...args) {\n // tslint:disable-next-line:no-this-assignment\n let cursor = this;\n if (!(cursor instanceof IDBCursor)) {\n cursor = await cursor.openCursor(...args);\n }\n if (!cursor)\n return;\n cursor = cursor;\n const proxiedCursor = new Proxy(cursor, cursorIteratorTraps);\n ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor);\n // Map this double-proxy back to the original, so other cursor methods work.\n reverseTransformCache.set(proxiedCursor, unwrap(cursor));\n while (cursor) {\n yield proxiedCursor;\n // If one of the advancing methods was not called, call continue().\n cursor = await (advanceResults.get(proxiedCursor) || cursor.continue());\n advanceResults.delete(proxiedCursor);\n }\n}\nfunction isIteratorProp(target, prop) {\n return ((prop === Symbol.asyncIterator &&\n instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) ||\n (prop === 'iterate' && instanceOfAny(target, [IDBIndex, IDBObjectStore])));\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get(target, prop, receiver) {\n if (isIteratorProp(target, prop))\n return iterate;\n return oldTraps.get(target, prop, receiver);\n },\n has(target, prop) {\n return isIteratorProp(target, prop) || oldTraps.has(target, prop);\n },\n}));\n\nexport { deleteDB, openDB, unwrap, wrap };\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (Ćæ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v12.0.2 - a markdown parser\n * Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\n/**\n * Gets the original marked default options.\n */\nfunction _getDefaults() {\n return {\n async: false,\n breaks: false,\n extensions: null,\n gfm: true,\n hooks: null,\n pedantic: false,\n renderer: null,\n silent: false,\n tokenizer: null,\n walkTokens: null\n };\n}\nlet _defaults = _getDefaults();\nfunction changeDefaults(newDefaults) {\n _defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape$1(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n }\n else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n return html;\n}\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon')\n return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\nconst caret = /(^|[^\\[])\\^/g;\nfunction edit(regex, opt) {\n let source = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n let valSource = typeof val === 'string' ? val : val.source;\n valSource = valSource.replace(caret, '$1');\n source = source.replace(name, valSource);\n return obj;\n },\n getRegex: () => {\n return new RegExp(source, opt);\n }\n };\n return obj;\n}\nfunction cleanUrl(href) {\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n }\n catch (e) {\n return null;\n }\n return href;\n}\nconst noopTest = { exec: () => null };\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false;\n let curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\')\n escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n }\n else {\n // add space before unescaped |\n return ' |';\n }\n }), cells = row.split(/ \\|/);\n let i = 0;\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) {\n cells.shift();\n }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) {\n cells.pop();\n }\n if (count) {\n if (cells.length > count) {\n cells.splice(count);\n }\n else {\n while (cells.length < count)\n cells.push('');\n }\n }\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param str\n * @param c\n * @param invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n }\n else if (currChar !== c && invert) {\n suffLen++;\n }\n else {\n break;\n }\n }\n return str.slice(0, l - suffLen);\n}\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n let level = 0;\n for (let i = 0; i < str.length; i++) {\n if (str[i] === '\\\\') {\n i++;\n }\n else if (str[i] === b[0]) {\n level++;\n }\n else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape$1(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape$1(text)\n };\n}\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n if (matchIndentToCode === null) {\n return text;\n }\n const indentToCode = matchIndentToCode[1];\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n const [indentInNode] = matchIndentInNode;\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n return node;\n })\n .join('\\n');\n}\n/**\n * Tokenizer\n */\nclass _Tokenizer {\n options;\n rules; // set by the lexer\n lexer; // set by the lexer\n constructor(options) {\n this.options = options || _defaults;\n }\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, '$1') : cap[2],\n text\n };\n }\n }\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n }\n else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n // precede setext continuation with 4 spaces so it isn't a setext\n let text = cap[0].replace(/\\n {0,3}((?:=+|-+) *)(?=\\n|$)/g, '\\n $1');\n text = rtrim(text.replace(/^ *>[ \\t]?/gm, ''), '\\n');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n let raw = '';\n let itemContents = '';\n let endsWithBlankLine = false;\n // Check if current bullet point can start a new List Item\n while (src) {\n let endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n raw = cap[0];\n src = src.substring(raw.length);\n let line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n let nextLine = src.split('\\n', 1)[0];\n let indent = 0;\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimStart();\n }\n else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n let blankLine = false;\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n // Check if following lines should be included in List Item\n while (src) {\n const rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n }\n else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n itemContents += '\\n' + nextLine;\n }\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n }\n else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n let istask = null;\n let ischecked;\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents,\n tokens: []\n });\n list.raw += raw;\n }\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimEnd();\n (list.items[list.items.length - 1]).text = itemContents.trimEnd();\n list.raw = list.raw.trimEnd();\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (let i = 0; i < list.items.length; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n list.loose = hasMultipleLineBreaks;\n }\n }\n // Set all items to loose if list is loose\n if (list.loose) {\n for (let i = 0; i < list.items.length; i++) {\n list.items[i].loose = true;\n }\n }\n return list;\n }\n }\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n block: true,\n raw: cap[0],\n pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',\n text: cap[0]\n };\n return token;\n }\n }\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline.anyPunctuation, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (!cap) {\n return;\n }\n if (!/[:|]/.test(cap[2])) {\n // delimiter row must have a pipe (|) or colon (:) otherwise it is a setext heading\n return;\n }\n const headers = splitCells(cap[1]);\n const aligns = cap[2].replace(/^\\||\\| *$/g, '').split('|');\n const rows = cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : [];\n const item = {\n type: 'table',\n raw: cap[0],\n header: [],\n align: [],\n rows: []\n };\n if (headers.length !== aligns.length) {\n // header and align columns must be equal, rows can be different.\n return;\n }\n for (const align of aligns) {\n if (/^ *-+: *$/.test(align)) {\n item.align.push('right');\n }\n else if (/^ *:-+: *$/.test(align)) {\n item.align.push('center');\n }\n else if (/^ *:-+ *$/.test(align)) {\n item.align.push('left');\n }\n else {\n item.align.push(null);\n }\n }\n for (const header of headers) {\n item.header.push({\n text: header,\n tokens: this.lexer.inline(header)\n });\n }\n for (const row of rows) {\n item.rows.push(splitCells(row, item.header.length).map(cell => {\n return {\n text: cell,\n tokens: this.lexer.inline(cell)\n };\n }));\n }\n return item;\n }\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape$1(cap[1])\n };\n }\n }\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n }\n else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n }\n else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n return {\n type: 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n block: false,\n text: cap[0]\n };\n }\n }\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n }\n else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n if (link) {\n href = link[1];\n title = link[3];\n }\n }\n else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n }\n else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline.anyPunctuation, '$1') : href,\n title: title ? title.replace(this.rules.inline.anyPunctuation, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n const linkString = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n const link = links[linkString.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrongLDelim.exec(src);\n if (!match)\n return;\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u))\n return;\n const nextChar = match[1] || match[2] || '';\n if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {\n // unicode Regex counts emoji as 1 char; spread into array for proper count (used multiple times below)\n const lLength = [...match[0]].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;\n endReg.lastIndex = 0;\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n if (!rDelim)\n continue; // skip single * in __abc*abc__\n rLength = [...rDelim].length;\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n }\n else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n delimTotal -= rLength;\n if (delimTotal > 0)\n continue; // Haven't found enough closing delimiters\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n // char length can be >1 for unicode characters;\n const lastCharLength = [...match[0]][0].length;\n const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape$1(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n autolink(src) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[1]);\n href = 'mailto:' + text;\n }\n else {\n text = escape$1(cap[1]);\n href = text;\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n url(src) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[0]);\n href = 'mailto:' + text;\n }\n else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? '';\n } while (prevCapZero !== cap[0]);\n text = escape$1(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n }\n else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n inlineText(src) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = cap[0];\n }\n else {\n text = escape$1(cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst newline = /^(?: *(?:\\n|$))+/;\nconst blockCode = /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/;\nconst fences = /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/;\nconst hr = /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/;\nconst heading = /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/;\nconst bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nconst lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\\n(?!\\s*?\\n|bull |blockCode|fences|blockquote|heading|html))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/)\n .replace(/bull/g, bullet) // lists can interrupt\n .replace(/blockCode/g, / {4}/) // indented code blocks can interrupt\n .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt\n .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n .getRegex();\nconst _paragraph = /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/;\nconst blockText = /^[^\\n]+/;\nconst _blockLabel = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nconst def = edit(/^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/)\n .replace('label', _blockLabel)\n .replace('title', /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/)\n .getRegex();\nconst list = edit(/^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/)\n .replace(/bull/g, bullet)\n .getRegex();\nconst _tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title'\n + '|tr|track|ul';\nconst _comment = /<!--(?:-?>|[\\s\\S]*?(?:-->|$))/;\nconst html = edit('^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')', 'i')\n .replace('comment', _comment)\n .replace('tag', _tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst paragraph = edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\nconst blockquote = edit(/^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/)\n .replace('paragraph', paragraph)\n .getRegex();\n/**\n * Normal Block Grammar\n */\nconst blockNormal = {\n blockquote,\n code: blockCode,\n def,\n fences,\n heading,\n hr,\n html,\n lheading,\n list,\n newline,\n paragraph,\n table: noopTest,\n text: blockText\n};\n/**\n * GFM Block Grammar\n */\nconst gfmTable = edit('^ *([^\\\\n ].*)\\\\n' // Header\n + ' {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)') // Cells\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\nconst blockGfm = {\n ...blockNormal,\n table: gfmTable,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('table', gfmTable) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex()\n};\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\nconst blockPedantic = {\n ...blockNormal,\n html: edit('^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', _comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', lheading)\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .replace('|tag', '')\n .getRegex()\n};\n/**\n * Inline-Level Grammar\n */\nconst escape = /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/;\nconst inlineCode = /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/;\nconst br = /^( {2,}|\\\\)\\n(?!\\s*$)/;\nconst inlineText = /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/;\n// list of unicode punctuation marks, plus any missing characters from CommonMark spec\nconst _punctuation = '\\\\p{P}\\\\p{S}';\nconst punctuation = edit(/^((?![*_])[\\spunctuation])/, 'u')\n .replace(/punctuation/g, _punctuation).getRegex();\n// sequences em should skip over [title](link), `code`, <html>\nconst blockSkip = /\\[[^[\\]]*?\\]\\([^\\(\\)]*?\\)|`[^`]*?`|<[^<>]*?>/g;\nconst emStrongLDelim = edit(/^(?:\\*+(?:((?!\\*)[punct])|[^\\s*]))|^_+(?:((?!_)[punct])|([^\\s_]))/, 'u')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst emStrongRDelimAst = edit('^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)' // Skip orphan inside strong\n + '|[^*]+(?=[^*])' // Consume to delim\n + '|(?!\\\\*)[punct](\\\\*+)(?=[\\\\s]|$)' // (1) #*** can only be a Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?!\\\\*)(?=[punct\\\\s]|$)' // (2) a***#, a*** can only be a Right Delimiter\n + '|(?!\\\\*)[punct\\\\s](\\\\*+)(?=[^punct\\\\s])' // (3) #***a, ***a can only be Left Delimiter\n + '|[\\\\s](\\\\*+)(?!\\\\*)(?=[punct])' // (4) ***# can only be Left Delimiter\n + '|(?!\\\\*)[punct](\\\\*+)(?!\\\\*)(?=[punct])' // (5) #***# can be either Left or Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?=[^punct\\\\s])', 'gu') // (6) a***a can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\n// (6) Not allowed for _\nconst emStrongRDelimUnd = edit('^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)' // Skip orphan inside strong\n + '|[^_]+(?=[^_])' // Consume to delim\n + '|(?!_)[punct](_+)(?=[\\\\s]|$)' // (1) #___ can only be a Right Delimiter\n + '|[^punct\\\\s](_+)(?!_)(?=[punct\\\\s]|$)' // (2) a___#, a___ can only be a Right Delimiter\n + '|(?!_)[punct\\\\s](_+)(?=[^punct\\\\s])' // (3) #___a, ___a can only be Left Delimiter\n + '|[\\\\s](_+)(?!_)(?=[punct])' // (4) ___# can only be Left Delimiter\n + '|(?!_)[punct](_+)(?!_)(?=[punct])', 'gu') // (5) #___# can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst anyPunctuation = edit(/\\\\([punct])/, 'gu')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst autolink = edit(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/)\n .replace('scheme', /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/)\n .replace('email', /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/)\n .getRegex();\nconst _inlineComment = edit(_comment).replace('(?:-->|$)', '-->').getRegex();\nconst tag = edit('^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>') // CDATA section\n .replace('comment', _inlineComment)\n .replace('attribute', /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst _inlineLabel = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\nconst link = edit(/^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/)\n .replace('label', _inlineLabel)\n .replace('href', /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/)\n .replace('title', /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/)\n .getRegex();\nconst reflink = edit(/^!?\\[(label)\\]\\[(ref)\\]/)\n .replace('label', _inlineLabel)\n .replace('ref', _blockLabel)\n .getRegex();\nconst nolink = edit(/^!?\\[(ref)\\](?:\\[\\])?/)\n .replace('ref', _blockLabel)\n .getRegex();\nconst reflinkSearch = edit('reflink|nolink(?!\\\\()', 'g')\n .replace('reflink', reflink)\n .replace('nolink', nolink)\n .getRegex();\n/**\n * Normal Inline Grammar\n */\nconst inlineNormal = {\n _backpedal: noopTest, // only used for GFM url\n anyPunctuation,\n autolink,\n blockSkip,\n br,\n code: inlineCode,\n del: noopTest,\n emStrongLDelim,\n emStrongRDelimAst,\n emStrongRDelimUnd,\n escape,\n link,\n nolink,\n punctuation,\n reflink,\n reflinkSearch,\n tag,\n text: inlineText,\n url: noopTest\n};\n/**\n * Pedantic Inline Grammar\n */\nconst inlinePedantic = {\n ...inlineNormal,\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', _inlineLabel)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', _inlineLabel)\n .getRegex()\n};\n/**\n * GFM Inline Grammar\n */\nconst inlineGfm = {\n ...inlineNormal,\n escape: edit(escape).replace('])', '~|])').getRegex(),\n url: edit(/^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/, 'i')\n .replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/)\n .getRegex(),\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n};\n/**\n * GFM + Line Breaks Inline Grammar\n */\nconst inlineBreaks = {\n ...inlineGfm,\n br: edit(br).replace('{2,}', '*').getRegex(),\n text: edit(inlineGfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n/**\n * exports\n */\nconst block = {\n normal: blockNormal,\n gfm: blockGfm,\n pedantic: blockPedantic\n};\nconst inline = {\n normal: inlineNormal,\n gfm: inlineGfm,\n breaks: inlineBreaks,\n pedantic: inlinePedantic\n};\n\n/**\n * Block Lexer\n */\nclass _Lexer {\n tokens;\n options;\n state;\n tokenizer;\n inlineQueue;\n constructor(options) {\n // TokenList cannot be created in one go\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || _defaults;\n this.options.tokenizer = this.options.tokenizer || new _Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n }\n else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n }\n else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new _Lexer(options);\n return lexer.lex(src);\n }\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new _Lexer(options);\n return lexer.inlineTokens(src);\n }\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n this.blockTokens(src, this.tokens);\n for (let i = 0; i < this.inlineQueue.length; i++) {\n const next = this.inlineQueue[i];\n this.inlineTokens(next.src, next.tokens);\n }\n this.inlineQueue = [];\n return this.tokens;\n }\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n }\n else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n let token;\n let lastToken;\n let cutSrc;\n let lastParagraphClipped;\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unnecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n this.state.top = true;\n return tokens;\n }\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n // Mask out escaped characters\n while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);\n }\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // autolink\n if (token = this.tokenizer.autolink(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass _Renderer {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/^\\S*/)?.[0];\n code = code.replace(/\\n$/, '') + '\\n';\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n return '<pre><code class=\"language-'\n + escape$1(lang)\n + '\">'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n html(html, block) {\n return html;\n }\n heading(text, level, raw) {\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n hr() {\n return '<hr>\\n';\n }\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul';\n const startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n listitem(text, task, checked) {\n return `<li>${text}</li>\\n`;\n }\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\">';\n }\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n table(header, body) {\n if (body)\n body = `<tbody>${body}</tbody>`;\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n /**\n * span level renderer\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n em(text) {\n return `<em>${text}</em>`;\n }\n codespan(text) {\n return `<code>${text}</code>`;\n }\n br() {\n return '<br>';\n }\n del(text) {\n return `<del>${text}</del>`;\n }\n link(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n image(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += '>';\n return out;\n }\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass _TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n em(text) {\n return text;\n }\n codespan(text) {\n return text;\n }\n del(text) {\n return text;\n }\n html(text) {\n return text;\n }\n text(text) {\n return text;\n }\n link(href, title, text) {\n return '' + text;\n }\n image(href, title, text) {\n return '' + text;\n }\n br() {\n return '';\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass _Parser {\n options;\n renderer;\n textRenderer;\n constructor(options) {\n this.options = options || _defaults;\n this.options.renderer = this.options.renderer || new _Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new _TextRenderer();\n }\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new _Parser(options);\n return parser.parse(tokens);\n }\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new _Parser(options);\n return parser.parseInline(tokens);\n }\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const genericToken = token;\n const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(genericToken.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n const headingToken = token;\n out += this.renderer.heading(this.parseInline(headingToken.tokens), headingToken.depth, unescape(this.parseInline(headingToken.tokens, this.textRenderer)));\n continue;\n }\n case 'code': {\n const codeToken = token;\n out += this.renderer.code(codeToken.text, codeToken.lang, !!codeToken.escaped);\n continue;\n }\n case 'table': {\n const tableToken = token;\n let header = '';\n // header\n let cell = '';\n for (let j = 0; j < tableToken.header.length; j++) {\n cell += this.renderer.tablecell(this.parseInline(tableToken.header[j].tokens), { header: true, align: tableToken.align[j] });\n }\n header += this.renderer.tablerow(cell);\n let body = '';\n for (let j = 0; j < tableToken.rows.length; j++) {\n const row = tableToken.rows[j];\n cell = '';\n for (let k = 0; k < row.length; k++) {\n cell += this.renderer.tablecell(this.parseInline(row[k].tokens), { header: false, align: tableToken.align[k] });\n }\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n const blockquoteToken = token;\n const body = this.parse(blockquoteToken.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n const listToken = token;\n const ordered = listToken.ordered;\n const start = listToken.start;\n const loose = listToken.loose;\n let body = '';\n for (let j = 0; j < listToken.items.length; j++) {\n const item = listToken.items[j];\n const checked = item.checked;\n const task = item.task;\n let itemBody = '';\n if (item.task) {\n const checkbox = this.renderer.checkbox(!!checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n }\n else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox + ' '\n });\n }\n }\n else {\n itemBody += checkbox + ' ';\n }\n }\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, !!checked);\n }\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n const htmlToken = token;\n out += this.renderer.html(htmlToken.text, htmlToken.block);\n continue;\n }\n case 'paragraph': {\n const paragraphToken = token;\n out += this.renderer.paragraph(this.parseInline(paragraphToken.tokens));\n continue;\n }\n case 'text': {\n let textToken = token;\n let body = textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text;\n while (i + 1 < tokens.length && tokens[i + 1].type === 'text') {\n textToken = tokens[++i];\n body += '\\n' + (textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'escape': {\n const escapeToken = token;\n out += renderer.text(escapeToken.text);\n break;\n }\n case 'html': {\n const tagToken = token;\n out += renderer.html(tagToken.text);\n break;\n }\n case 'link': {\n const linkToken = token;\n out += renderer.link(linkToken.href, linkToken.title, this.parseInline(linkToken.tokens, renderer));\n break;\n }\n case 'image': {\n const imageToken = token;\n out += renderer.image(imageToken.href, imageToken.title, imageToken.text);\n break;\n }\n case 'strong': {\n const strongToken = token;\n out += renderer.strong(this.parseInline(strongToken.tokens, renderer));\n break;\n }\n case 'em': {\n const emToken = token;\n out += renderer.em(this.parseInline(emToken.tokens, renderer));\n break;\n }\n case 'codespan': {\n const codespanToken = token;\n out += renderer.codespan(codespanToken.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n const delToken = token;\n out += renderer.del(this.parseInline(delToken.tokens, renderer));\n break;\n }\n case 'text': {\n const textToken = token;\n out += renderer.text(textToken.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\nclass _Hooks {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess',\n 'processAllTokens'\n ]);\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n /**\n * Process all tokens before walk tokens\n */\n processAllTokens(tokens) {\n return tokens;\n }\n}\n\nclass Marked {\n defaults = _getDefaults();\n options = this.setOptions;\n parse = this.#parseMarkdown(_Lexer.lex, _Parser.parse);\n parseInline = this.#parseMarkdown(_Lexer.lexInline, _Parser.parseInline);\n Parser = _Parser;\n Renderer = _Renderer;\n TextRenderer = _TextRenderer;\n Lexer = _Lexer;\n Tokenizer = _Tokenizer;\n Hooks = _Hooks;\n constructor(...args) {\n this.use(...args);\n }\n /**\n * Run callback for every token\n */\n walkTokens(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(this, token));\n switch (token.type) {\n case 'table': {\n const tableToken = token;\n for (const cell of tableToken.header) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n for (const row of tableToken.rows) {\n for (const cell of row) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n const listToken = token;\n values = values.concat(this.walkTokens(listToken.items, callback));\n break;\n }\n default: {\n const genericToken = token;\n if (this.defaults.extensions?.childTokens?.[genericToken.type]) {\n this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {\n const tokens = genericToken[childTokens].flat(Infinity);\n values = values.concat(this.walkTokens(tokens, callback));\n });\n }\n else if (genericToken.tokens) {\n values = values.concat(this.walkTokens(genericToken.tokens, callback));\n }\n }\n }\n }\n return values;\n }\n use(...args) {\n const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n // set async to true if it was set to true before\n opts.async = this.defaults.async || opts.async || false;\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if ('renderer' in ext) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function (...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n }\n else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if ('tokenizer' in ext) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n const extLevel = extensions[ext.level];\n if (extLevel) {\n extLevel.unshift(ext.tokenizer);\n }\n else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n }\n else {\n extensions.startBlock = [ext.start];\n }\n }\n else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n }\n else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if ('childTokens' in ext && ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = this.defaults.renderer || new _Renderer(this.defaults);\n for (const prop in pack.renderer) {\n if (!(prop in renderer)) {\n throw new Error(`renderer '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const rendererProp = prop;\n const rendererFunc = pack.renderer[rendererProp];\n const prevRenderer = renderer[rendererProp];\n // Replace renderer with func to run extension, but fall back if false\n renderer[rendererProp] = (...args) => {\n let ret = rendererFunc.apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret || '';\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);\n for (const prop in pack.tokenizer) {\n if (!(prop in tokenizer)) {\n throw new Error(`tokenizer '${prop}' does not exist`);\n }\n if (['options', 'rules', 'lexer'].includes(prop)) {\n // ignore options, rules, and lexer properties\n continue;\n }\n const tokenizerProp = prop;\n const tokenizerFunc = pack.tokenizer[tokenizerProp];\n const prevTokenizer = tokenizer[tokenizerProp];\n // Replace tokenizer with func to run extension, but fall back if false\n // @ts-expect-error cannot type tokenizer function dynamically\n tokenizer[tokenizerProp] = (...args) => {\n let ret = tokenizerFunc.apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = this.defaults.hooks || new _Hooks();\n for (const prop in pack.hooks) {\n if (!(prop in hooks)) {\n throw new Error(`hook '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const hooksProp = prop;\n const hooksFunc = pack.hooks[hooksProp];\n const prevHook = hooks[hooksProp];\n if (_Hooks.passThroughHooks.has(prop)) {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (arg) => {\n if (this.defaults.async) {\n return Promise.resolve(hooksFunc.call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n const ret = hooksFunc.call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n }\n else {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (...args) => {\n let ret = hooksFunc.apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = this.defaults.walkTokens;\n const packWalktokens = pack.walkTokens;\n opts.walkTokens = function (token) {\n let values = [];\n values.push(packWalktokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n this.defaults = { ...this.defaults, ...opts };\n });\n return this;\n }\n setOptions(opt) {\n this.defaults = { ...this.defaults, ...opt };\n return this;\n }\n lexer(src, options) {\n return _Lexer.lex(src, options ?? this.defaults);\n }\n parser(tokens, options) {\n return _Parser.parse(tokens, options ?? this.defaults);\n }\n #parseMarkdown(lexer, parser) {\n return (src, options) => {\n const origOpt = { ...options };\n const opt = { ...this.defaults, ...origOpt };\n // Show warning if an extension set async to true but the parse was called with async: false\n if (this.defaults.async === true && origOpt.async === false) {\n if (!opt.silent) {\n console.warn('marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.');\n }\n opt.async = true;\n }\n const throwError = this.#onError(!!opt.silent, !!opt.async);\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens)\n .then(tokens => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n let tokens = lexer(src, opt);\n if (opt.hooks) {\n tokens = opt.hooks.processAllTokens(tokens);\n }\n if (opt.walkTokens) {\n this.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n }\n catch (e) {\n return throwError(e);\n }\n };\n }\n #onError(silent, async) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape$1(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n return msg;\n }\n if (async) {\n return Promise.reject(e);\n }\n throw e;\n };\n }\n}\n\nconst markedInstance = new Marked();\nfunction marked(src, opt) {\n return markedInstance.parse(src, opt);\n}\n/**\n * Sets the default options.\n *\n * @param options Hash of options\n */\nmarked.options =\n marked.setOptions = function (options) {\n markedInstance.setOptions(options);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n };\n/**\n * Gets the original marked default options.\n */\nmarked.getDefaults = _getDefaults;\nmarked.defaults = _defaults;\n/**\n * Use Extension\n */\nmarked.use = function (...args) {\n markedInstance.use(...args);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n};\n/**\n * Run callback for every token\n */\nmarked.walkTokens = function (tokens, callback) {\n return markedInstance.walkTokens(tokens, callback);\n};\n/**\n * Compiles markdown to HTML without enclosing `p` tag.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options\n * @return String of compiled HTML\n */\nmarked.parseInline = markedInstance.parseInline;\n/**\n * Expose\n */\nmarked.Parser = _Parser;\nmarked.parser = _Parser.parse;\nmarked.Renderer = _Renderer;\nmarked.TextRenderer = _TextRenderer;\nmarked.Lexer = _Lexer;\nmarked.lexer = _Lexer.lex;\nmarked.Tokenizer = _Tokenizer;\nmarked.Hooks = _Hooks;\nmarked.parse = marked;\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = _Parser.parse;\nconst lexer = _Lexer.lex;\n\nexport { _Hooks as Hooks, _Lexer as Lexer, Marked, _Parser as Parser, _Renderer as Renderer, _TextRenderer as TextRenderer, _Tokenizer as Tokenizer, _defaults as defaults, _getDefaults as getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n//# sourceMappingURL=marked.esm.js.map\n","function getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralize$2 = {exports: {}};\n\n/* global define */\nvar pluralize$1 = pluralize$2.exports;\n\nvar hasRequiredPluralize;\n\nfunction requirePluralize () {\n\tif (hasRequiredPluralize) return pluralize$2.exports;\n\thasRequiredPluralize = 1;\n\t(function (module, exports) {\n\t\t(function (root, pluralize) {\n\t\t /* istanbul ignore else */\n\t\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t\t // Node.\n\t\t module.exports = pluralize();\n\t\t } else {\n\t\t // Browser global.\n\t\t root.pluralize = pluralize();\n\t\t }\n\t\t})(pluralize$1, function () {\n\t\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t\t // while other rules can be optimized using an object for instant lookups.\n\t\t var pluralRules = [];\n\t\t var singularRules = [];\n\t\t var uncountables = {};\n\t\t var irregularPlurals = {};\n\t\t var irregularSingles = {};\n\n\t\t /**\n\t\t * Sanitize a pluralization rule to a usable regular expression.\n\t\t *\n\t\t * @param {(RegExp|string)} rule\n\t\t * @return {RegExp}\n\t\t */\n\t\t function sanitizeRule (rule) {\n\t\t if (typeof rule === 'string') {\n\t\t return new RegExp('^' + rule + '$', 'i');\n\t\t }\n\n\t\t return rule;\n\t\t }\n\n\t\t /**\n\t\t * Pass in a word token to produce a function that can replicate the case on\n\t\t * another word.\n\t\t *\n\t\t * @param {string} word\n\t\t * @param {string} token\n\t\t * @return {Function}\n\t\t */\n\t\t function restoreCase (word, token) {\n\t\t // Tokens are an exact match.\n\t\t if (word === token) return token;\n\n\t\t // Lower cased words. E.g. \"hello\".\n\t\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t\t // Upper cased words. E.g. \"WHISKY\".\n\t\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t\t // Title cased words. E.g. \"Title\".\n\t\t if (word[0] === word[0].toUpperCase()) {\n\t\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t\t }\n\n\t\t // Lower cased words. E.g. \"test\".\n\t\t return token.toLowerCase();\n\t\t }\n\n\t\t /**\n\t\t * Interpolate a regexp string.\n\t\t *\n\t\t * @param {string} str\n\t\t * @param {Array} args\n\t\t * @return {string}\n\t\t */\n\t\t function interpolate (str, args) {\n\t\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t\t return args[index] || '';\n\t\t });\n\t\t }\n\n\t\t /**\n\t\t * Replace a word using a rule.\n\t\t *\n\t\t * @param {string} word\n\t\t * @param {Array} rule\n\t\t * @return {string}\n\t\t */\n\t\t function replace (word, rule) {\n\t\t return word.replace(rule[0], function (match, index) {\n\t\t var result = interpolate(rule[1], arguments);\n\n\t\t if (match === '') {\n\t\t return restoreCase(word[index - 1], result);\n\t\t }\n\n\t\t return restoreCase(match, result);\n\t\t });\n\t\t }\n\n\t\t /**\n\t\t * Sanitize a word by passing in the word and sanitization rules.\n\t\t *\n\t\t * @param {string} token\n\t\t * @param {string} word\n\t\t * @param {Array} rules\n\t\t * @return {string}\n\t\t */\n\t\t function sanitizeWord (token, word, rules) {\n\t\t // Empty string or doesn't need fixing.\n\t\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t\t return word;\n\t\t }\n\n\t\t var len = rules.length;\n\n\t\t // Iterate over the sanitization rules and use the first one to match.\n\t\t while (len--) {\n\t\t var rule = rules[len];\n\n\t\t if (rule[0].test(word)) return replace(word, rule);\n\t\t }\n\n\t\t return word;\n\t\t }\n\n\t\t /**\n\t\t * Replace a word with the updated word.\n\t\t *\n\t\t * @param {Object} replaceMap\n\t\t * @param {Object} keepMap\n\t\t * @param {Array} rules\n\t\t * @return {Function}\n\t\t */\n\t\t function replaceWord (replaceMap, keepMap, rules) {\n\t\t return function (word) {\n\t\t // Get the correct token and case restoration functions.\n\t\t var token = word.toLowerCase();\n\n\t\t // Check against the keep object map.\n\t\t if (keepMap.hasOwnProperty(token)) {\n\t\t return restoreCase(word, token);\n\t\t }\n\n\t\t // Check against the replacement map for a direct word replacement.\n\t\t if (replaceMap.hasOwnProperty(token)) {\n\t\t return restoreCase(word, replaceMap[token]);\n\t\t }\n\n\t\t // Run all the rules against the word.\n\t\t return sanitizeWord(token, word, rules);\n\t\t };\n\t\t }\n\n\t\t /**\n\t\t * Check if a word is part of the map.\n\t\t */\n\t\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t\t return function (word) {\n\t\t var token = word.toLowerCase();\n\n\t\t if (keepMap.hasOwnProperty(token)) return true;\n\t\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t\t return sanitizeWord(token, token, rules) === token;\n\t\t };\n\t\t }\n\n\t\t /**\n\t\t * Pluralize or singularize a word based on the passed in count.\n\t\t *\n\t\t * @param {string} word The word to pluralize\n\t\t * @param {number} count How many of the word exist\n\t\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t\t * @return {string}\n\t\t */\n\t\t function pluralize (word, count, inclusive) {\n\t\t var pluralized = count === 1\n\t\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t\t return (inclusive ? count + ' ' : '') + pluralized;\n\t\t }\n\n\t\t /**\n\t\t * Pluralize a word.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.plural = replaceWord(\n\t\t irregularSingles, irregularPlurals, pluralRules\n\t\t );\n\n\t\t /**\n\t\t * Check if a word is plural.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.isPlural = checkWord(\n\t\t irregularSingles, irregularPlurals, pluralRules\n\t\t );\n\n\t\t /**\n\t\t * Singularize a word.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.singular = replaceWord(\n\t\t irregularPlurals, irregularSingles, singularRules\n\t\t );\n\n\t\t /**\n\t\t * Check if a word is singular.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.isSingular = checkWord(\n\t\t irregularPlurals, irregularSingles, singularRules\n\t\t );\n\n\t\t /**\n\t\t * Add a pluralization rule to the collection.\n\t\t *\n\t\t * @param {(string|RegExp)} rule\n\t\t * @param {string} replacement\n\t\t */\n\t\t pluralize.addPluralRule = function (rule, replacement) {\n\t\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t\t };\n\n\t\t /**\n\t\t * Add a singularization rule to the collection.\n\t\t *\n\t\t * @param {(string|RegExp)} rule\n\t\t * @param {string} replacement\n\t\t */\n\t\t pluralize.addSingularRule = function (rule, replacement) {\n\t\t singularRules.push([sanitizeRule(rule), replacement]);\n\t\t };\n\n\t\t /**\n\t\t * Add an uncountable word rule.\n\t\t *\n\t\t * @param {(string|RegExp)} word\n\t\t */\n\t\t pluralize.addUncountableRule = function (word) {\n\t\t if (typeof word === 'string') {\n\t\t uncountables[word.toLowerCase()] = true;\n\t\t return;\n\t\t }\n\n\t\t // Set singular and plural references for the word.\n\t\t pluralize.addPluralRule(word, '$0');\n\t\t pluralize.addSingularRule(word, '$0');\n\t\t };\n\n\t\t /**\n\t\t * Add an irregular word definition.\n\t\t *\n\t\t * @param {string} single\n\t\t * @param {string} plural\n\t\t */\n\t\t pluralize.addIrregularRule = function (single, plural) {\n\t\t plural = plural.toLowerCase();\n\t\t single = single.toLowerCase();\n\n\t\t irregularSingles[single] = plural;\n\t\t irregularPlurals[plural] = single;\n\t\t };\n\n\t\t /**\n\t\t * Irregular rules.\n\t\t */\n\t\t [\n\t\t // Pronouns.\n\t\t ['I', 'we'],\n\t\t ['me', 'us'],\n\t\t ['he', 'they'],\n\t\t ['she', 'they'],\n\t\t ['them', 'them'],\n\t\t ['myself', 'ourselves'],\n\t\t ['yourself', 'yourselves'],\n\t\t ['itself', 'themselves'],\n\t\t ['herself', 'themselves'],\n\t\t ['himself', 'themselves'],\n\t\t ['themself', 'themselves'],\n\t\t ['is', 'are'],\n\t\t ['was', 'were'],\n\t\t ['has', 'have'],\n\t\t ['this', 'these'],\n\t\t ['that', 'those'],\n\t\t // Words ending in with a consonant and `o`.\n\t\t ['echo', 'echoes'],\n\t\t ['dingo', 'dingoes'],\n\t\t ['volcano', 'volcanoes'],\n\t\t ['tornado', 'tornadoes'],\n\t\t ['torpedo', 'torpedoes'],\n\t\t // Ends with `us`.\n\t\t ['genus', 'genera'],\n\t\t ['viscus', 'viscera'],\n\t\t // Ends with `ma`.\n\t\t ['stigma', 'stigmata'],\n\t\t ['stoma', 'stomata'],\n\t\t ['dogma', 'dogmata'],\n\t\t ['lemma', 'lemmata'],\n\t\t ['schema', 'schemata'],\n\t\t ['anathema', 'anathemata'],\n\t\t // Other irregular rules.\n\t\t ['ox', 'oxen'],\n\t\t ['axe', 'axes'],\n\t\t ['die', 'dice'],\n\t\t ['yes', 'yeses'],\n\t\t ['foot', 'feet'],\n\t\t ['eave', 'eaves'],\n\t\t ['goose', 'geese'],\n\t\t ['tooth', 'teeth'],\n\t\t ['quiz', 'quizzes'],\n\t\t ['human', 'humans'],\n\t\t ['proof', 'proofs'],\n\t\t ['carve', 'carves'],\n\t\t ['valve', 'valves'],\n\t\t ['looey', 'looies'],\n\t\t ['thief', 'thieves'],\n\t\t ['groove', 'grooves'],\n\t\t ['pickaxe', 'pickaxes'],\n\t\t ['passerby', 'passersby']\n\t\t ].forEach(function (rule) {\n\t\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t\t });\n\n\t\t /**\n\t\t * Pluralization rules.\n\t\t */\n\t\t [\n\t\t [/s?$/i, 's'],\n\t\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t\t [/([^aeiou]ese)$/i, '$1'],\n\t\t [/(ax|test)is$/i, '$1es'],\n\t\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t\t [/(e[mn]u)s?$/i, '$1s'],\n\t\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t\t [/(her|at|gr)o$/i, '$1oes'],\n\t\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t\t [/sis$/i, 'ses'],\n\t\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t\t [/(child)(?:ren)?$/i, '$1ren'],\n\t\t [/eaux$/i, '$0'],\n\t\t [/m[ae]n$/i, 'men'],\n\t\t ['thou', 'you']\n\t\t ].forEach(function (rule) {\n\t\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t\t });\n\n\t\t /**\n\t\t * Singularization rules.\n\t\t */\n\t\t [\n\t\t [/s$/i, ''],\n\t\t [/(ss)$/i, '$1'],\n\t\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t\t [/ies$/i, 'y'],\n\t\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t\t [/(seraph|cherub)im$/i, '$1'],\n\t\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t\t [/(test)(?:is|es)$/i, '$1is'],\n\t\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t\t [/(matr|append)ices$/i, '$1ix'],\n\t\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t\t [/(child)ren$/i, '$1'],\n\t\t [/(eau)x?$/i, '$1'],\n\t\t [/men$/i, 'man']\n\t\t ].forEach(function (rule) {\n\t\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t\t });\n\n\t\t /**\n\t\t * Uncountable rules.\n\t\t */\n\t\t [\n\t\t // Singular words with no plurals.\n\t\t 'adulthood',\n\t\t 'advice',\n\t\t 'agenda',\n\t\t 'aid',\n\t\t 'aircraft',\n\t\t 'alcohol',\n\t\t 'ammo',\n\t\t 'analytics',\n\t\t 'anime',\n\t\t 'athletics',\n\t\t 'audio',\n\t\t 'bison',\n\t\t 'blood',\n\t\t 'bream',\n\t\t 'buffalo',\n\t\t 'butter',\n\t\t 'carp',\n\t\t 'cash',\n\t\t 'chassis',\n\t\t 'chess',\n\t\t 'clothing',\n\t\t 'cod',\n\t\t 'commerce',\n\t\t 'cooperation',\n\t\t 'corps',\n\t\t 'debris',\n\t\t 'diabetes',\n\t\t 'digestion',\n\t\t 'elk',\n\t\t 'energy',\n\t\t 'equipment',\n\t\t 'excretion',\n\t\t 'expertise',\n\t\t 'firmware',\n\t\t 'flounder',\n\t\t 'fun',\n\t\t 'gallows',\n\t\t 'garbage',\n\t\t 'graffiti',\n\t\t 'hardware',\n\t\t 'headquarters',\n\t\t 'health',\n\t\t 'herpes',\n\t\t 'highjinks',\n\t\t 'homework',\n\t\t 'housework',\n\t\t 'information',\n\t\t 'jeans',\n\t\t 'justice',\n\t\t 'kudos',\n\t\t 'labour',\n\t\t 'literature',\n\t\t 'machinery',\n\t\t 'mackerel',\n\t\t 'mail',\n\t\t 'media',\n\t\t 'mews',\n\t\t 'moose',\n\t\t 'music',\n\t\t 'mud',\n\t\t 'manga',\n\t\t 'news',\n\t\t 'only',\n\t\t 'personnel',\n\t\t 'pike',\n\t\t 'plankton',\n\t\t 'pliers',\n\t\t 'police',\n\t\t 'pollution',\n\t\t 'premises',\n\t\t 'rain',\n\t\t 'research',\n\t\t 'rice',\n\t\t 'salmon',\n\t\t 'scissors',\n\t\t 'series',\n\t\t 'sewage',\n\t\t 'shambles',\n\t\t 'shrimp',\n\t\t 'software',\n\t\t 'species',\n\t\t 'staff',\n\t\t 'swine',\n\t\t 'tennis',\n\t\t 'traffic',\n\t\t 'transportation',\n\t\t 'trout',\n\t\t 'tuna',\n\t\t 'wealth',\n\t\t 'welfare',\n\t\t 'whiting',\n\t\t 'wildebeest',\n\t\t 'wildlife',\n\t\t 'you',\n\t\t /pok[eĆ©]mon$/i,\n\t\t // Regexes.\n\t\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t\t /deer$/i, // \"deer\", \"reindeer\"\n\t\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t\t /measles$/i,\n\t\t /o[iu]s$/i, // \"carnivorous\"\n\t\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t\t /sheep$/i\n\t\t ].forEach(pluralize.addUncountableRule);\n\n\t\t return pluralize;\n\t\t}); \n\t} (pluralize$2));\n\treturn pluralize$2.exports;\n}\n\nvar pluralizeExports = requirePluralize();\nvar pluralize = /*@__PURE__*/getDefaultExportFromCjs(pluralizeExports);\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"šŸ‘»\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint, cause: e });\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up šŸ˜–\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message, { ...(options.cause && { cause: options.cause }) });\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return {\n message,\n name,\n plugin,\n hint,\n elements,\n title,\n details,\n stack,\n ...(this.cause instanceof Error && {\n cause: {\n name: this.cause.name,\n message: this.cause.message,\n stack: this.cause.stack,\n },\n }),\n };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n * @param {Error} [options.cause] The error that caused this one.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n * @param {Error} [options.cause] The error that caused this one.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Creates showError, showWarning utilities for use in custom pre-process and\n * post-process plugins.\n * @param {string} pluginName\n */\nexport function makePluginUtils(pluginName) {\n /** @typedef {Parameters<typeof showError>[2]} Options */\n return {\n /** @type {(message: string, options?: Options) => void} */\n showError: (msg, options) => showError(msg, pluginName, options),\n /** @type {(message: string, options?: Options) => void} */\n showWarning: (msg, options) => showWarning(msg, pluginName, options),\n };\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n\n/**\n * Takes a text string, trims it, splits it into lines,\n * finds the common indentation level, and then de-indents every line\n * by that common indentation level.\n *\n * @param {string} text - The text to be re-indented.\n * @returns {string} The re-indented text.\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\nimport { showError } from \"./utils.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n /** @param {CustomEvent} ev */\n const listener = async ev => {\n try {\n await cb(ev.detail);\n } catch (error) {\n const msg = `Error in handler for topic \"${topic}\": ${error.message}`;\n showError(msg, `sub:${topic}`, { cause: error });\n }\n };\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint, cause: err });\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint, cause: err });\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n background: var(--bg, #fff);\n color: rgb(120, 120, 120);\n color: var(--tocnav-normal-text, rgb(120, 120, 120));\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n box-shadow: 1px 1px 8px 0 var(--tocsidebar-shadow, rgba(100, 100, 100, 0.5));\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: var(--bg, #fff);\n color: var(--text, black);\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: var(--def-text, white);\n background: var(--def-bg, rgb(42, 90, 168));\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: var(--def-text, white);\n background: var(--defrow-border, rgb(42, 90, 168));\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: var(--tocnav-active-bg, #193766);\n color: var(--tocnav-active-text, black);\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"āš ļø\";\n}\n\n.respec-error-list > li::before {\n content: \"šŸ’„\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: var(--bg, #fff);\n color: var(--text, black);\n border: 5px solid #666;\n border-color: var(--tocsidebar-shadow, #666);\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n left: 0 !important;\n text-align: center;\n background: var(--tocsidebar-shadow, #ddd);\n color: var(--text, black);\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: var(--bg, white);\n color: var(--text, black);\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: var(--tocnav-hover-bg, #eee);\n color: var(--tocnav-hover-text, black);\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/markedjs/marked\n *\n */\n\nimport { getElementIndentation, reindent } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\n\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\n\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super\n .code(code, language, isEscaped)\n .replace(`class=\"language-`, `class=\"`);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw);\n }\n}\n\n/** @type {import('marked').MarkedOptions} */\nconst config = {\n gfm: true,\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport { reindent, xmlEscape } from \"./utils.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n āŒ\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}ā€¦\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${xmlEscape(err.message)}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/dini/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/dini/style.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/title.js\"),\n import(\"../src/dini/headers.js\"),\n import(\"../src/dini/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/dini/conformance.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n import(\"../src/core/dfn-contract.js\"),\n /* Linter must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/core/linter-rules/privsec-section.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// As ReSpec injects a bunch of stuff async, the scroll position is not always\n// at the right place when we are done processing. The purpose of this module\n// is to reset window's location hash, which will cause the browser to scroll\n// the window to the correct point in the document when processing is done.\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!window.location.hash) {\n return;\n }\n\n // We have to use .then() here because otherwise we would get stuck\n // awaiting this plugin to finish.\n document.respec.ready.then(() => {\n const hash = decodeURIComponent(window.location.hash).slice(1);\n\n let newHash = hash;\n /** @type {HTMLElement|null} */\n const element = document.getElementById(newHash);\n\n // Check if hash contains any non-word character.\n const isLegacyFrag = /\\W/.test(newHash);\n\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/speced/respec/issues/1353\n if (!element && isLegacyFrag) {\n const id = newHash\n // Replace all non-word characters with a dash.\n .replace(/[\\W]+/gim, \"-\")\n // Remove any leading dashes.\n .replace(/^-+/, \"\")\n // Remove any trailing dashes.\n .replace(/-+$/, \"\");\n\n /** @type {HTMLElement|null} */\n const updatedElement = document.getElementById(id);\n if (updatedElement) {\n newHash = id;\n }\n }\n window.location.hash = `#${newHash}`;\n });\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for DINI specs\n */\nexport const name = \"dini/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst licenses = new Map([\n [\n \"cc0\",\n {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n ],\n [\n \"cc-by\",\n {\n name: \"Creative Commons Attribution 4.0 International Public License\",\n short: \"CC-BY\",\n url: \"https://creativecommons.org/licenses/by/4.0/legalcode\",\n },\n ],\n [\n \"cc-by-sa\",\n {\n name: \"Creative Commons Attribution-ShareAlike 4.0 International Public License\",\n short: \"CC-BY-SA\",\n url: \"https://creativecommons.org/licenses/by-sa/4.0/legalcode\",\n },\n ],\n]);\n\nconst diniDefaults = {\n format: \"markdown\",\n isED: false,\n isNoTrack: true,\n isPR: false,\n lint: {\n \"privsec-section\": true,\n \"wpt-tests-exist\": false,\n },\n logos: [],\n prependW3C: false,\n doJsonLd: false,\n license: \"cc-by\",\n shortName: \"X\",\n showPreviousVersion: false,\n};\n\nfunction computeProps(conf) {\n return {\n licenseInfo: licenses.get(conf.license),\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...diniDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...diniDefaults,\n ...conf,\n lint,\n });\n\n // computed properties\n Object.assign(conf, computeProps(conf));\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOF --- */\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"Ā§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// The purpose of this module is to insert the default ReSpec CSS into the document.\n// If you don't want to use the default ReSpec CSS, set the `noReSpecCSS` configuration\n// option to `true`. If you want to use your own styles, create a ReSpec profile that\n// includes your own styles and sets the `noReSpecCSS` configuration option to `true`.\n\n/**\n * Module Name.\n * @type {string}\n */\nexport const name = \"core/style\";\n\nimport css from \"../styles/respec.css.js\";\n\n// Opportunistically inserts the style to reduce some FOUC.\n/** @type {HTMLStyleElement} */\nconst styleElement = insertStyle();\n\n/**\n * Inserts the ReSpec CSS as a `style` element into the document's `head`.\n * @return {HTMLStyleElement} The `style` element that was inserted.\n */\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\n/**\n * Removes the ReSpec CSS if the `noReSpecCSS` configuration option is `true`.\n * @param {Conf} conf The document configuration object.\n */\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n// Module dini/style\n// Inserts a link to the appropriate W3C style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport {\n createResourceHint,\n linkCSS,\n showWarning,\n toKeyValuePairs,\n} from \"../core/utils.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"dini/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n script.src = `https://www.w3.org/scripts/TR/${version}/fixup.js`;\n doc.body.appendChild(script);\n}\n\n/**\n * Make a best effort to attach meta viewport at the top of the head.\n * Other plugins might subsequently push it down, but at least we start\n * at the right place. When ReSpec exports the HTML, it again moves the\n * meta viewport to the top of the head - so to make sure it's the first\n * thing the browser sees. See js/ui/save-html.js.\n */\nfunction createMetaViewport() {\n const meta = document.createElement(\"meta\");\n meta.name = \"viewport\";\n const contentProps = {\n width: \"device-width\",\n \"initial-scale\": \"1\",\n \"shrink-to-fit\": \"no\",\n };\n meta.content = toKeyValuePairs(contentProps).replace(/\"/g, \"\");\n return meta;\n}\n\nfunction createBaseStyle() {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = \"https://www.w3.org/StyleSheets/TR/2016/base.css\";\n link.classList.add(\"removeOnSave\");\n return link;\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C styles and scripts.\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2016/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: \"https://www.w3.org/StyleSheets/TR/2016/base.css\",\n as: \"style\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// Opportunistically apply base style\nelements.appendChild(createBaseStyle());\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(createMetaViewport());\n}\n\ndocument.head.prepend(elements);\n\nfunction styleMover(linkURL) {\n return exportDoc => {\n const w3cStyle = exportDoc.querySelector(`head link[href=\"${linkURL}\"]`);\n exportDoc.querySelector(\"head\").append(w3cStyle);\n };\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"`respecConfig.specStatus` missing. Defaulting to 'base'.\";\n conf.specStatus = \"base\";\n showWarning(msg, name);\n }\n\n let styleFile = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"UNOFFICIAL\":\n styleFile = \"W3C-UD\";\n break;\n case \"BASE\":\n styleFile = \"base.css\";\n break;\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://www.w3.org/StyleSheets/TR/2016/${styleFile}`;\n linkCSS(document, finalStyleURL);\n // Make sure the W3C stylesheet is the last stylesheet, as required by W3C Pub Rules.\n const moveStyle = styleMover(finalStyleURL);\n sub(\"beforesave\", moveStyle);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n showError(msg, name, { elements: [el], cause: err });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","// @ts-check\n/**\n * @module core/reindent\n *\n * Normalizes indents across the pre elements in the document,\n * so that indentation inside <pre> won't affect the rendered result.\n */\nimport { reindent } from \"./utils.js\";\nexport const name = \"core/reindent\";\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","/**\n * This module handles the creation of the h1#title of a spec and\n * makes sure the <title> always matches the h1.\n *\n * If no h1#title is included, then the <title> becomes the h1#title.\n *\n * When a h1#title is included, it always takes precedence over the\n * <title> of a spec. An error will be displayed in case of\n * any mismatch.\n *\n */\n\nimport { getIntlData, norm, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/title\";\n\nconst localizationStrings = {\n en: {\n default_title: \"No Title\",\n },\n de: {\n default_title: \"Kein Titel\",\n },\n zh: {\n default_title: \"ę— ę ‡é¢˜\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {HTMLElement} */\n const h1Elem =\n document.querySelector(\"h1#title\") || html`<h1 id=\"title\"></h1>`;\n\n // check existing element is ok to use\n if (h1Elem.isConnected && h1Elem.textContent.trim() === \"\") {\n const msg =\n \"The document is missing a title, so using a default title. \" +\n \"To fix this, please give your document a `<title>`. \" +\n \"If you need special markup in the document's title, \" +\n 'please use a `<h1 id=\"title\">`.';\n const title = \"Document is missing a title\";\n showError(msg, name, { title, elements: [h1Elem] });\n }\n\n // Decorate the spec title\n if (!h1Elem.id) h1Elem.id = \"title\";\n h1Elem.classList.add(\"title\");\n\n setDocumentTitle(conf, h1Elem);\n\n // This will get relocated by a template later.\n document.body.prepend(h1Elem);\n}\n\nfunction setDocumentTitle(conf, h1Elem) {\n // If the h1 is newly created, it won't be connected. In this case\n // we use the <title> or a localized fallback.\n if (!h1Elem.isConnected) {\n h1Elem.textContent = document.title || `${l10n.default_title}`;\n }\n // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.textContent);\n\n if (conf.isPreview && conf.prNumber) {\n const prUrl = conf.prUrl || `${conf.github.repoURL}pull/${conf.prNumber}`;\n const { childNodes } = html`\n Preview of PR <a href=\"${prUrl}\">#${conf.prNumber}</a>:\n `;\n h1Elem.prepend(...childNodes);\n documentTitle = `Preview of PR #${conf.prNumber}: ${documentTitle}`;\n }\n\n document.title = documentTitle;\n\n // conf.title is deperecated - we are keeping this here just to\n // retain backwards compat as we think the ePub generator\n // relies on it.\n conf.title = documentTitle;\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"core/templates/show-link\";\n\n/**\n * @param {object} link\n * @param {string} link.key\n * @param {string} [link.class]\n * @param {LinkData[]} [link.data]\n */\nexport default function showLink(link) {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n showWarning(msg, name);\n console.warn(msg, link);\n return;\n }\n return html`\n <dt class=\"${link.class ? link.class : null}\">${link.key}</dt>\n ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n `;\n}\n\n/**\n * @typedef {object} LinkData\n * @property {string} [LinkData.class]\n * @property {string} [LinkData.href]\n * @property {string} [LinkData.value]\n * @param {LinkData} data\n */\nfunction showLinkData(data) {\n return html`<dd class=\"${data.class ? data.class : null}\">\n ${data.href\n ? html`<a href=\"${data.href}\">${data.value || data.href}</a>`\n : data.value}\n </dd>`;\n}\n","// @ts-check\nimport { docLink, showError } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst name = \"core/templates/show-logo\";\n\n/**\n * Logo mapper. Takes a logo structure and converts it to HTML.\n *\n * @param {object} logo\n * @param {string} logo.src\n * @param {string} logo.url\n * @param {string} logo.alt\n * @param {string} [logo.id]\n * @param {number} [logo.width]\n * @param {number} [logo.height]\n * @param {number} index\n */\nexport default function showLogo(logo, index) {\n /** @type {HTMLAnchorElement} */\n const a = html`<a href=\"${logo.url || null}\" class=\"logo\"\n ><img\n alt=\"${logo.alt || null}\"\n crossorigin\n height=\"${logo.height || null}\"\n id=\"${logo.id || null}\"\n src=\"${logo.src || null}\"\n width=\"${logo.width || null}\"\n />\n </a>`;\n if (!logo.alt) {\n const src = logo.src ? `, with \\`src\\` ${logo.src}, ` : \"\";\n const msg = `Logo at index ${index}${src} is missing required \"\\`alt\\`\" property.`;\n const hint = docLink`Add the missing \"\\`alt\\`\" property describing the logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n if (!logo.src) {\n const msg = `Logo at index ${index} is missing \"\\`src\\`\" property.`;\n const hint = docLink`The \\`src\\` property is required on every logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n return a;\n}\n","// @ts-check\n\nconst name = \"core/templates/show-people\";\n\nimport {\n W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n until(date) {\n return html` Until ${date} `;\n },\n },\n es: {\n until(date) {\n return html` Hasta ${date} `;\n },\n },\n ko: {\n until(date) {\n return html` ${date} ģ“ģ „ `;\n },\n },\n ja: {\n until(date) {\n return html` ${date} 仄前 `;\n },\n },\n de: {\n until(date) {\n return html` bis ${date} `;\n },\n },\n zh: {\n until(date) {\n return html` ē›“到 ${date} `;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst orcidIcon = () =>\n html`<svg\n width=\"16\"\n height=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n >\n <style>\n .st1 {\n fill: #fff;\n }\n </style>\n <path\n d=\"M256 128c0 70.7-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0s128 57.3 128 128z\"\n fill=\"#a6ce39\"\n />\n <path\n class=\"st1\"\n d=\"M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z\"\n />\n </svg>`;\n\n/**\n * @param {Conf} conf\n * @param {\"editors\" | \"authors\" | \"formerEditors\"} propName - the name of the property of the people to render.\n */\nexport default function showPeople(conf, propName) {\n const people = conf[propName];\n if (!Array.isArray(people) || !people.length) return; // nothing to show...\n\n const validatePerson = personValidator(propName);\n return people.filter(validatePerson).map(personToHTML);\n}\n\n/**\n * @param {Person} person\n */\nfunction personToHTML(person) {\n // The following are treated as opt-in HTML by hyperHTML\n // we need to deprecate this!\n const personName = [person.name];\n const company = [person.company];\n const editorId = person.w3cid || null;\n const contents = [];\n if (person.mailto) {\n person.url = `mailto:${person.mailto}`;\n }\n if (person.url) {\n const url = new URL(person.url, document.location.href);\n const classList =\n url.protocol === \"mailto:\"\n ? \"ed_mailto u-email email p-name\"\n : \"u-url url p-name fn\";\n contents.push(\n html`<a class=\"${classList}\" href=\"${person.url}\">${personName}</a>`\n );\n } else {\n contents.push(html`<span class=\"p-name fn\">${personName}</span>`);\n }\n if (person.orcid) {\n contents.push(\n html`<a class=\"p-name orcid\" href=\"${person.orcid}\">${orcidIcon()}</a>`\n );\n }\n if (person.company) {\n const hCard = \"p-org org h-org\";\n const companyElem = person.companyURL\n ? html`<a class=\"${hCard}\" href=\"${person.companyURL}\">${company}</a>`\n : html`<span class=\"${hCard}\">${company}</span>`;\n contents.push(html` (${companyElem})`);\n }\n if (person.note) {\n contents.push(document.createTextNode(` (${person.note})`));\n }\n if (person.extras) {\n contents.push(...person.extras.map(extra => html`, ${renderExtra(extra)}`));\n }\n const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(retiredDate))}</time\n >`;\n contents.push(html` - ${l10n.until(time)} `);\n }\n const dd = html`<dd\n class=\"editor p-author h-card vcard\"\n data-editor-id=\"${editorId}\"\n >\n ${contents}\n </dd>`;\n return dd;\n}\n\nfunction renderExtra(extra) {\n const classVal = extra.class || null;\n const { name, href } = extra;\n return href\n ? html`<a href=\"${href}\" class=\"${classVal}\">${name}</a>`\n : html`<span class=\"${classVal}\">${name}</span>`;\n}\n\n/**\n *\n * @param {string} prop\n */\nfunction personValidator(prop) {\n /**\n * @param {Person} person\n * @param {Number} index\n */\n return function validatePerson(person, index) {\n const docsUrl = \"https://respec.org/docs/\";\n const seePersonHint = `See [person](${docsUrl}#person) configuration for available options.`;\n const preamble =\n `Error processing the [person object](${docsUrl}#person) ` +\n `at index ${index} of the \"[\\`${prop}\\`](${docsUrl}#${prop})\" configuration option.`;\n\n if (!person.name) {\n const msg = `${preamble} Missing required property \\`\"name\"\\`.`;\n showError(msg, name, { hint: seePersonHint });\n return false;\n }\n\n if (person.orcid) {\n const { orcid } = person;\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n\n if (orcidUrl.origin !== \"https://orcid.org\") {\n const msg = `${preamble} ORCID \"${person.orcid}\" at index ${index} is invalid.`;\n const hint = `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`;\n showError(msg, name, { hint });\n return false;\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n const msg = `${preamble} ORCID \"${orcidId}\" has wrong format.`;\n const hint = `ORCIDs have the format \"1234-1234-1234-1234.\"`;\n showError(msg, name, { hint });\n return false;\n }\n\n if (!checkOrcidChecksum(orcid)) {\n const msg = `${preamble} ORCID \"${orcid}\" failed checksum check.`;\n const hint = \"Please check that the ORCID is valid.\";\n showError(msg, name, { hint });\n return false;\n }\n\n // canonical form\n person.orcid = orcidUrl.href;\n }\n\n if (person.retiredDate && !isValidConfDate(person.retiredDate)) {\n const msg = `${preamble} The property \"\\`retiredDate\\`\" is not a valid date.`;\n showError(msg, name, {\n hint: `The expected format is YYYY-MM-DD. ${seePersonHint}`,\n });\n return false;\n }\n\n if (\n person.hasOwnProperty(\"extras\") &&\n !validateExtras(person.extras, seePersonHint, preamble)\n ) {\n return false;\n }\n\n if (person.url && person.mailto) {\n const msg = `${preamble} Has both \"url\" and \"mailto\" property.`;\n showWarning(msg, name, {\n hint: `Please choose either \"url\" or \"mailto\" (\"url\" is preferred). ${seePersonHint}`,\n });\n }\n\n if (person.companyURL && !person.company) {\n const msg = `${preamble} Has a \"\\`companyURL\\`\" property but no \"\\`company\\`\" property.`;\n showWarning(msg, name, {\n hint: `Please add a \"\\`company\\`\" property. ${seePersonHint}.`,\n });\n }\n return true;\n };\n}\n\n/**\n *\n * @param {PersonExtras[]} extras\n * @param {string} hint\n * @param {string} preamble\n */\nfunction validateExtras(extras, hint, preamble) {\n if (!Array.isArray(extras)) {\n showError(\n `${preamble}. A person's \"extras\" member must be an array.`,\n name,\n { hint }\n );\n return false;\n }\n return extras.every((extra, index) => {\n switch (true) {\n case typeof extra !== \"object\":\n showError(\n `${preamble}. Member \"extra\" at index ${index} is not an object.`,\n name,\n {\n hint,\n }\n );\n return false;\n case !extra.hasOwnProperty(\"name\"):\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} is missing required \"name\" member.`,\n name,\n { hint }\n );\n return false;\n case typeof extra.name === \"string\" && extra.name.trim() === \"\":\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} \"name\" can't be empty.`,\n name,\n { hint }\n );\n return false;\n }\n return true;\n });\n}\n\n/**\n * @param {string} orcid\n * @returns {boolean}\n */\nfunction checkOrcidChecksum(orcid) {\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcid[orcid.length - 1];\n const remainder = orcid\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n return lastDigit === lastDigitShould;\n}\n","// @ts-check\nimport { getIntlData, showWarning } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nconst name = \"dini/templates/headers\";\n\nconst ccLicense = \"https://creativecommons.org/licenses/by/4.0/legalcode\";\n\nconst localizationStrings = {\n en: {\n author: \"Author:\",\n authors: \"Authors:\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest published version:\",\n this_version: \"This version:\",\n },\n ko: {\n author: \"ģ €ģž:\",\n authors: \"ģ €ģž:\",\n editor: \"ķŽøģ§‘ģž:\",\n editors: \"ķŽøģ§‘ģž:\",\n former_editor: \"ģ“ģ „ ķŽøģ§‘ģž:\",\n former_editors: \"ģ“ģ „ ķŽøģ§‘ģž:\",\n latest_editors_draft: \"ģµœģ‹  ķŽøģ§‘ ģ“ˆģ•ˆ:\",\n latest_published_version: \"ģµœģ‹  ė²„ģ „:\",\n this_version: \"ķ˜„ģž¬ ė²„ģ „:\",\n },\n zh: {\n author: \"ä½œč€…ļ¼š\",\n authors: \"ä½œč€…ļ¼š\",\n editor: \"ē¼–č¾‘ļ¼š\",\n editors: \"ē¼–č¾‘ļ¼š\",\n former_editor: \"原ē¼–č¾‘ļ¼š\",\n former_editors: \"原ē¼–č¾‘ļ¼š\",\n latest_editors_draft: \"꜀ꖰē¼–č¾‘č‰ēØæļ¼š\",\n latest_published_version: \"ęœ€ę–°å‘åøƒē‰ˆęœ¬ļ¼š\",\n this_version: \"ęœ¬ē‰ˆęœ¬ļ¼š\",\n },\n ja: {\n author: \"著者ļ¼š\",\n authors: \"著者ļ¼š\",\n editor: \"ē·Ø者ļ¼š\",\n editors: \"ē·Ø者ļ¼š\",\n former_editor: \"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š\",\n former_editors: \"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š\",\n latest_editors_draft: \"ęœ€ę–°ć®ē·Ø集ē”Øč‰ę”ˆļ¼š\",\n latest_published_version: \"ęœ€ę–°ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š\",\n this_version: \"ć“ć®ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š\",\n },\n nl: {\n author: \"Auteur:\",\n authors: \"Auteurs:\",\n editor: \"Redacteur:\",\n editors: \"Redacteurs:\",\n latest_editors_draft: \"Laatste werkversie:\",\n latest_published_version: \"Laatst gepubliceerde versie:\",\n this_version: \"Deze versie:\",\n },\n es: {\n author: \"Autor:\",\n authors: \"Autores:\",\n editor: \"Editor:\",\n editors: \"Editores:\",\n latest_editors_draft: \"Borrador de editor mas reciente:\",\n latest_published_version: \"VersiĆ³n publicada mas reciente:\",\n this_version: \"Ɖsta versiĆ³n:\",\n },\n de: {\n author: \"Autor/in:\",\n authors: \"Autor/innen:\",\n editor: \"Redaktion:\",\n editors: \"Redaktion:\",\n former_editor: \"FrĆ¼here Mitwirkende:\",\n former_editors: \"FrĆ¼here Mitwirkende:\",\n latest_editors_draft: \"Letzter Entwurf:\",\n latest_published_version: \"Letzte publizierte Fassung:\",\n this_version: \"Diese Fassung:\",\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nfunction getSpecSubTitleElem(conf) {\n let specSubTitleElem = document.querySelector(\"h2#subtitle\");\n\n if (specSubTitleElem && specSubTitleElem.parentElement) {\n specSubTitleElem.remove();\n conf.subtitle = specSubTitleElem.textContent.trim();\n } else if (conf.subtitle) {\n specSubTitleElem = document.createElement(\"h2\");\n specSubTitleElem.textContent = conf.subtitle;\n specSubTitleElem.id = \"subtitle\";\n }\n if (specSubTitleElem) {\n specSubTitleElem.classList.add(\"subtitle\");\n }\n return specSubTitleElem;\n}\n\nexport default conf => {\n return html`<div class=\"head\">\n ${conf.logos.map(showLogo)} ${document.querySelector(\"h1#title\")}\n ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.textStatus}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\n <dt>${conf.multipleEditors ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n ${Array.isArray(conf.formerEditors) && conf.formerEditors.length > 0\n ? html`\n <dt>\n ${conf.multipleFormerEditors\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors\n ? html`\n <dt>${conf.multipleAuthors ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${renderCopyright(conf)}\n <hr />\n </div>`;\n};\n\n/**\n * @param {string} text\n * @param {string} url\n * @param {string=} cssClass\n */\nfunction linkLicense(text, url, cssClass) {\n return html`<a rel=\"license\" href=\"${url}\" class=\"${cssClass}\">${text}</a>`;\n}\n\nfunction renderCopyright(conf) {\n // If there is already a copyright, let's relocate it.\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n return existingCopyright;\n }\n if (conf.hasOwnProperty(\"overrideCopyright\")) {\n const msg = \"The `overrideCopyright` configuration option is deprecated.\";\n const hint = 'Please use `<p class=\"copyright\">` instead.';\n showWarning(msg, name, { hint });\n }\n return conf.overrideCopyright\n ? [conf.overrideCopyright]\n : html`<p class=\"copyright\">\n Dieses Dokument ist lizensiert unter\n ${linkLicense(\n \"Creative Commons Attribution 4.0 International Public License\",\n ccLicense,\n \"subfoot\"\n )}.\n </p>`;\n}\n","// @ts-check\n// Module dini/headers\n// Generate the headers material based on the provided configuration.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n// - editors: an array of people editing the document (at least one is required). People\n// are defined using:\n// - name: the person's name (required)\n// - url: URI for the person's home page\n// - company: the person's company\n// - companyURL: the URI for the person's company\n// - mailto: the person's email\n// - note: a note on the person (e.g. former editor)\n// - authors: an array of people who are contributing authors of the document.\n// - formerEditors: an array of people that had earlier edited the document but no longer edit.\n// - subtitle: a subtitle for the specification\n// - publishDate: the date to use for the publication, default to document.lastModified, and\n// failing that to now. The format is YYYY-MM-DD or a Date object.\n// - alternateFormats: a list of alternate formats for the document, each of which being\n// defined by:\n// - uri: the URI to the alternate\n// - label: a label for the alternate\n// - lang: optional language\n// - type: optional MIME type\n// - logos: a list of logos to use instead of the W3C logo, each of which being defined by:\n// - src: the URI to the logo (target of <img src=>)\n// - alt: alternate text for the image (<img alt=>), defaults to \"Logo\" or \"Logo 1\", \"Logo 2\", ...\n// if src is not specified, this is the text of the \"logo\"\n// - height: optional height of the logo (<img height=>)\n// - width: optional width of the logo (<img width=>)\n// - url: the URI to the organization represented by the logo (target of <a href=>)\n// - id: optional id for the logo, permits custom CSS (wraps logo in <span id=>)\n// - each logo element must specify either src or alt\n// - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc).\n// Example of usage: [{key: \"foo\", href:\"https://b\"}, {key: \"bar\", href:\"https://\"}].\n// Allowed values are:\n// - key: the key for the <dt> (e.g., \"Bug Tracker\"). Required.\n// - value: The value that will appear in the <dd> (e.g., \"GitHub\"). Optional.\n// - href: a URL for the value (e.g., \"https://foo.com/issues\"). Optional.\n// - class: a string representing CSS classes. Optional.\n// - license: can be one of the following\n// - \"cc-by-sa\"\n// - \"cc-by\"\n// - \"cc0\"\nimport { ISODate, showError } from \"../core/utils.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { pub } from \"../core/pubsubhub.js\";\n\nexport const name = \"dini/headers\";\n\nconst DINIDate = new Intl.DateTimeFormat([\"de-DE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n});\n\nconst status2text = {\n unofficial: \"Entwurf vom\",\n base: \"Spezifikation vom\",\n};\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg =\n `[\\`${prop}\\`](https://github.com/speced/respec/wiki/${prop}) ` +\n `is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n conf.isBasic = conf.specStatus === \"base\";\n if (!conf.specStatus) {\n const msg = \"Missing required configuration: `specStatus`\";\n showError(msg, name);\n }\n conf.title = document.title || \"Kein Titel\";\n if (!conf.subtitle) conf.subtitle = \"\";\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.publishYear = conf.publishDate.getUTCFullYear();\n conf.publishHumanDate = DINIDate.format(conf.publishDate);\n const peopCheck = function (it) {\n if (!it.name) {\n const msg = \"All authors and editors must have a name.\";\n showError(msg, name);\n }\n if (it.orcid) {\n try {\n it.orcid = normalizeOrcid(it.orcid);\n } catch (e) {\n const msg = `\"${it.orcid}\" is not an ORCID. ${e.message}`;\n showError(msg, name);\n // A failed orcid link could link to something outside of orcid,\n // which would be misleading.\n delete it.orcid;\n }\n }\n };\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\n conf.editors.forEach(peopCheck);\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n }\n if (!conf.editors || conf.editors.length === 0) {\n const msg = \"At least one editor is required\";\n showError(msg, name);\n }\n if (conf.formerEditors.length) {\n conf.formerEditors.forEach(peopCheck);\n }\n if (conf.authors) {\n conf.authors.forEach(peopCheck);\n }\n conf.multipleEditors = conf.editors && conf.editors.length > 1;\n conf.multipleFormerEditors = conf.formerEditors.length > 1;\n conf.multipleAuthors = conf.authors && conf.authors.length > 1;\n (conf.alternateFormats || []).forEach(it => {\n if (!it.uri || !it.label) {\n const msg = \"All alternate formats must have a uri and a label.\";\n showError(msg, name);\n }\n });\n if (conf.copyrightStart && conf.copyrightStart == conf.publishYear)\n conf.copyrightStart = \"\";\n conf.textStatus = status2text[conf.specStatus];\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n // configuration done - yay!\n\n // insert into document\n const header = headersTmpl(conf);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // Requested by https://github.com/speced/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: `${conf.longStatus} ${conf.publishHumanDate}`,\n });\n}\n\n/**\n * @param {string} orcid Either an ORCID URL or just the 16-digit ID which comes after the /\n * @return {string} the full ORCID URL. Throws an error if the ID is invalid.\n */\nfunction normalizeOrcid(orcid) {\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n if (orcidUrl.origin !== \"https://orcid.org\") {\n throw new Error(\n `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`\n );\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n throw new Error(\n `ORCIDs have the format \"1234-1234-1234-1234\", not \"${orcidId}\"`\n );\n }\n\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcidId[orcidId.length - 1];\n const remainder = orcidId\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n if (lastDigit !== lastDigitShould) {\n throw new Error(`\"${orcidId}\" has an invalid checksum.`);\n }\n\n return orcidUrl.href;\n}\n","// @ts-check\n// Module dini/abstract\n// Handle the abstract section properly.\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"dini/abstract\";\n\nconst localizationStrings = {\n en: {\n abstract: \"Abstract\",\n },\n ko: {\n abstract: \"ģš”ģ•½\",\n },\n zh: {\n abstract: \"ę‘˜č¦\",\n },\n ja: {\n abstract: \"要ē“„\",\n },\n nl: {\n abstract: \"Samenvatting\",\n },\n es: {\n abstract: \"Resumen\",\n },\n de: {\n abstract: \"Zusammenfassung\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run() {\n const abs = document.getElementById(\"abstract\");\n if (!abs) {\n const msg = `Document must have one element with \\`id=\"abstract\"`;\n showError(msg, name);\n return;\n }\n abs.classList.add(\"introductory\");\n let abstractHeading = document.querySelector(\"#abstract>h2\");\n if (abstractHeading) {\n return;\n }\n abstractHeading = document.createElement(\"h2\");\n abstractHeading.textContent = l10n.abstract;\n abs.prepend(abstractHeading);\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Module core/data-abbr\n// - Finds all elements with data-abbr attribute and processes them.\nimport { showError } from \"./utils.js\";\nexport const name = \"core/dfn-abbr\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = document.querySelectorAll(\"[data-abbr]\");\n for (const elem of elements) {\n const { localName } = elem;\n switch (localName) {\n case \"dfn\":\n processDfnElement(elem);\n break;\n default: {\n const msg = `\\`data-abbr\\` attribute not supported on \\`${localName}\\` elements.`;\n showError(msg, name, {\n elements: [elem],\n title: \"Error: unsupported.\",\n });\n }\n }\n }\n}\n/**\n * @param {HTMLElement} dfn\n */\nfunction processDfnElement(dfn) {\n const abbr = generateAbbreviation(dfn);\n // get normalized <dfn> textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (<abbr title=\"${fullForm}\">${abbr}</abbr>)`\n );\n const lt = dfn.dataset.lt || \"\";\n dfn.dataset.lt = lt\n .split(\"|\")\n .filter(i => i.trim())\n .concat(abbr)\n .join(\"|\");\n}\n\nfunction generateAbbreviation(elem) {\n if (elem.dataset.abbr) return elem.dataset.abbr;\n // Generates abbreviation from textContent\n // e.g., \"Permanent Account Number\" -> \"PAN\"\n return elem.textContent\n .match(/\\b([a-z])/gi)\n .join(\"\")\n .toUpperCase();\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/speced/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"ģ°øģ”°\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参ē…§ē”Øå‚č€ƒę–‡ēŒ®\",\n norm_references: \"č¦ēƄēš„å‚č€ƒę–‡ēŒ®\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n de: {\n info_references: \"WeiterfĆ¼hrende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"éžč§„čŒƒę€§å¼•ē”Ø\",\n norm_references: \"č§„čŒƒę€§å¼•ē”Ø\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n if (!output.endsWith(\".\")) output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMƜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NƖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDƜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKƖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;\"?<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn or a `a`, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn,a\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn|abstract-op\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n /** @param {string} str */\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","// @ts-check\n// Module dini/conformance\n// Handle the conformance section properly.\nimport { getIntlData, htmlJoinAnd, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"dini/conformance\";\n\nconst localizationStrings = {\n en: {\n conformance: \"Conformance\",\n normativity:\n \"As well as sections marked as non-normative, all authoring guidelines, \" +\n \"diagrams, examples, and notes in this specification are non-normative. \" +\n \"Everything else in this specification is normative.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n The key word${plural ? \"s\" : \"\"} ${keywords} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n when, and only when, they appear in all capitals, as shown here.\n </p>`;\n },\n },\n de: {\n conformance: \"Anforderungen\",\n normativity:\n \"Neben den explizit als nicht-normativ gekennzeichneten Abschnitten \" +\n \"sind auch alle Diagramme, Beispiele und Hinweise in diesem Dokument \" +\n \"nicht normativ. Alle anderen Angaben sind normativ.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n ${plural ? \"Die SchlĆ¼sselwƶrter\" : \"Das SchlĆ¼sselwort\"} ${keywords} in\n diesem Dokument ${plural ? \"sind\" : \"ist\"} gemƤƟ\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n und unter BerĆ¼cksichtigung von\n <a href=\"https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst\"\n >2119de</a\n >\n zu interpretieren, wenn und nur wenn ${plural ? \"sie\" : \"es\"} wie hier\n gezeigt durchgehend groƟ geschrieben wurde${plural ? \"n\" : \"\"}.\n </p>`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = [...Object.keys(rfc2119Usage)];\n // Add RFC2119 to bibliography\n if (terms.length) {\n conf.normativeReferences.add(\"RFC2119\");\n conf.normativeReferences.add(\"RFC8174\");\n }\n // Put in the 2119 clause and reference\n const keywords = htmlJoinAnd(\n terms.sort(),\n item => html`<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h1>${l10n.conformance}</h1>\n <p>${l10n.normativity}</p>\n ${terms.length ? l10n.keywordInterpretation(keywords, plural) : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance && !conformance.classList.contains(\"override\")) {\n processConformance(conformance, conf);\n }\n // Warn when there are RFC2119/RFC8174 keywords, but not conformance section\n if (!conformance && Object.keys(rfc2119Usage).length) {\n const msg = `Document uses RFC2119 keywords but lacks a conformance section.`;\n const hint = 'Please add a `<section id=\"conformance\">`.';\n showWarning(msg, name, { hint });\n }\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"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`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"ģ˜ˆģ‹œ\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-color: var(--warning-border, #f11);\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n background: var(--warning-bg, #fbe9e9);\n color: black;\n color: var(--text, black);\n}\n\n.warning-title:before {\n content: \"āš \"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"ę³Ø\",\n editors_note: \"ē·Ø者ę³Ø\",\n feature_at_risk: \"(å¤‰ę›“ć®åÆčƒ½ę€§ć®ć‚ć‚‹ę©Ÿčƒ½) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 恮要ē“„\",\n no_issues_in_spec: \"ć“ć®ä»•ę§˜ć«ćÆęœŖč§£ę±ŗ恮 issues ćÆå«ć¾ć‚Œć¦ć„ć¾ć›ć‚“ļ¼Ž\",\n warning: \"č­¦å‘Š\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"CuestiĆ³n\",\n issue_summary: \"Resumen de la cuestiĆ³n\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificaciĆ³n.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthƤlt keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"ē¼–者ę³Ø\",\n feature_at_risk: \"ļ¼ˆęœ‰åÆčƒ½å˜åŠØēš„ē‰¹ę€§ļ¼‰Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue ꀻē»“\",\n no_issues_in_spec: \"ęœ¬č§„čŒƒäø­ęœŖ列å‡ŗ任何 issue怂\",\n note: \"ę³Ø\",\n warning: \"č­¦å‘Š\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"꜀č‰Æå®Ÿę–½ä¾‹ \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"ęœ€ä½³å®žč·µ \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"å›³ć®ćƒŖć‚¹ćƒˆ\",\n },\n ko: {\n fig: \"ź·øė¦¼ \",\n list_of_figures: \"ź·øė¦¼ ėŖ©ė”\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范äø­åŒ…含ēš„图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of the specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n *\n * @module core/data-cite\n */\n\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to the current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n * @type {string}\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * Gets the link properties for the given citation details.\n * @param {CiteDetails} citeDetails - The citation details.\n * @returns {Promise<LinkProps|null>} The link properties or null if not found.\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/speced/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n\n return { href, title };\n}\n\n/**\n * Links the given element with the provided link properties and citation details.\n * @param {HTMLElement} elem - The element to link.\n * @param {LinkProps} linkProps - The link properties.\n * @param {CiteDetails} citeDetails - The citation details.\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n anchor.dataset.cite = citeDetails.key;\n anchor.dataset.citePath = citeDetails.path;\n anchor.dataset.citeFrag = citeDetails.frag;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting a linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * Converts the given raw key to citation details.\n * @param {HTMLElement} elem - The element containing the citation details.\n * @returns {CiteDetails} The citation details.\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as a fragment\n return toCiteDetails(elem);\n }\n\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\n/**\n * Runs the data-cite processing on elements with the data-cite attribute.\n */\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetches and updates `biblio` with entries corresponding to the given elements.\n * @param {HTMLElement[]} elems - The elements requiring biblio entries.\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/**\n * Cleans up the data-cite attributes from the document.\n * @param {Document} doc - The document to cleanup.\n */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ć®é‡č¤‡å®šē¾©`;\n },\n duplicateTitle: \"恓恮ꖇę›øå†…ć§č¤‡ę•°å›žå®šē¾©ć•ć‚Œć¦ć„ć¾ć™ļ¼Ž\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthƤlt mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ēš„重复定义`;\n },\n duplicateTitle: \"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n for (const type of linkType.split(\"|\")) {\n if (dfnsByType.get(type)) {\n return dfnsByType.get(type);\n }\n }\n return dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name, { cause: error });\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大ēŗ²\",\n },\n ko: {\n toc: \"ėŖ©ģ°Ø\",\n },\n ja: {\n toc: \"ē›®ę¬”\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at Ā§1, we will keep Ā§1.1 but not Ā§1.1.1\n // Similarly, `data-max-toc=1` will keep Ā§1, but not Ā§1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"ģ“ ė¶€ė¶„ģ€ ė¹„ź·œė²”ģ ģž…ė‹ˆė‹¤.\",\n },\n ja: {\n informative: \"恓恮ēƀćÆä»•ę§˜ć«ćÆå«ć¾ć‚Œć¾ć›ć‚“ļ¼Ž\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"äæå­˜ć™ć‚‹\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"åƼå‡ŗ\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"šŸ’¾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关äŗŽ\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"ć“ć‚Œć«ć¤ć„ć¦\",\n },\n de: {\n about_respec: \"Ɯber\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ā„¹ļø\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/speced/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/speced/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\nimport { html } from \"../core/import-maps.js\";\n\nexport const name = \"core/seo\";\n\nexport function run(conf) {\n if (conf.gitRevision) {\n // This allows to set a git revision of the source used to produce the\n // generated content. Typically, this would be set when generating the\n // static HTML via a build process.\n // 'revision' is the name recommended in https://wiki.whatwg.org/wiki/MetaExtensions\n const metaElem = html`<meta\n name=\"revision\"\n content=\"${conf.gitRevision}\"\n />`;\n document.head.appendChild(metaElem);\n }\n\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","/*\nOne Light for ReSpec, with better color contrast\nAdapted from Atom One Light by Daniel Gamage (https://github.com/highlightjs/highlight.js/blob/c0b6ddbaaf7/src/styles/atom-one-light.css>\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n --base: #fafafa;\n --mono-1: #383a42;\n --mono-2: #686b77;\n --mono-3: #717277;\n --hue-1: #0b76c5;\n --hue-2: #336ae3;\n --hue-3: #a626a4;\n --hue-4: #42803c;\n --hue-5: #ca4706;\n --hue-5-2: #c91243;\n --hue-6: #986801;\n --hue-6-2: #9a6a01;\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n .hljs {\n --base: #282c34;\n --mono-1: #abb2bf;\n --mono-2: #818896;\n --mono-3: #5c6370;\n --hue-1: #56b6c2;\n --hue-2: #61aeee;\n --hue-3: #c678dd;\n --hue-4: #98c379;\n --hue-5: #e06c75;\n --hue-5-2: #be5046;\n --hue-6: #d19a66;\n --hue-6-2: #e6c07b;\n }\n}\n\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n color: var(--mono-1, #383a42);\n background: #fafafa;\n background: var(--base, #fafafa);\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n color: var(--mono-3, #717277);\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n color: var(--hue-3, #a626a4);\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n color: var(--hue-5, #ca4706);\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n color: var(--hue-1, #0b76c5);\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n color: var(--hue-4, #42803c);\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n color: var(--hue-6-2, #9a6a01);\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n color: var(--hue-6, #986801);\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n color: var(--hue-2, #336ae3);\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n var.respec-hl {\n filter: saturate(0.9) brightness(0.9)\n }\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within the algorithm or the encompassing section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\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","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar {\n position: relative;\n cursor: pointer;\n}\n\nvar[data-type]::before,\nvar[data-type]::after {\n position: absolute;\n left: 50%;\n top: -6px;\n opacity: 0;\n transition: opacity 0.4s;\n pointer-events: none;\n}\n\n/* the triangle or arrow or caret or whatever */\nvar[data-type]::before {\n content: \"\";\n transform: translateX(-50%);\n border-width: 4px 6px 0 6px;\n border-style: solid;\n border-color: transparent;\n border-top-color: #222;\n}\n\n/* actual text */\nvar[data-type]::after {\n content: attr(data-type);\n transform: translateX(-50%) translateY(-100%);\n background: #222;\n text-align: center;\n /* additional styling */\n font-family: \"Dank Mono\", \"Fira Code\", monospace;\n font-style: normal;\n padding: 6px;\n border-radius: 3px;\n color: #daca88;\n text-indent: 0;\n font-weight: normal;\n}\n\nvar[data-type]:hover::after,\nvar[data-type]:hover::before {\n opacity: 1;\n}\n`;\n","// @ts-check\n/**\n * Module core/data-type\n * Propagates data type of a <var> to subsequent instances within a section.\n * Also adds the CSS for the data type tooltip.\n * Set `conf.highlightVars = true` to enable.\n */\nimport css from \"../styles/datatype.css.js\";\n\nexport const name = \"core/data-type\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n\n let section = null;\n const varMap = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const variables = document.querySelectorAll(\"section var\");\n for (const varElem of variables) {\n const currentSection = varElem.closest(\"section\");\n if (section !== currentSection) {\n section = currentSection;\n varMap.clear();\n }\n if (varElem.dataset.type) {\n varMap.set(varElem.textContent.trim(), varElem.dataset.type);\n continue;\n }\n const type = varMap.get(varElem.textContent.trim());\n if (type) varElem.dataset.type = type;\n }\n}\n","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n:root {\n --assertion-border: #aaa;\n --assertion-bg: #eee;\n --assertion-text: black;\n}\n\n.assert {\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n border-color: #aaa;\n border-color: var(--assertion-border);\n background: #eee;\n background: var(--assertion-bg);\n color: black;\n color: var(--assertion-text);\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n :root {\n --assertion-border: #444;\n --assertion-bg: var(--borderedblock-bg);\n --assertion-text: var(--text);\n }\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"Ā§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/speced/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n background: var(--indextable-hover-bg, #fff);\n color: black;\n color: var(--text, black);\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: 0 1em 3em -0.4em var(--tocsidebar-shadow, rgba(0, 0, 0, 0.3)),\n 0 0 1px 1px var(--tocsidebar-shadow, rgba(0, 0, 0, 0.05));\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n border-bottom-color: var(--indextable-hover-bg, #fff);\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n /* TODO: need slightly darker shade */\n border-bottom-color: var(--indextable-hover-bg, #a2a9b1);\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n color: var(--text, #000);\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n color: var(--text, #333);\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => {\n return html`<li>\n ${toLinkProps(entry).map(link => {\n return html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a\n >${\" \"}`;\n })}\n </li>`;\n };\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `Ā§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/speced/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"ģ°øģ—¬\",\n },\n zh: {\n file_a_bug: \"反馈错čÆÆ\",\n participate: \"参äøŽļ¼š\",\n },\n ja: {\n commit_history: \"å¤‰ę›“å±„ę­“\",\n file_a_bug: \"問锌報告\",\n participate: \"å‚åŠ ę–¹ę³•ļ¼š\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${ghURL.href}).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","// @ts-check\n/**\n * Fetches commits between two commitish (tag or commit) - `from` and `to=HEAD`\n * and shows them as a list of \"changes during\" those commitish. If a filter\n * function is provided by the user, it is used to filter the commits that are\n * to be shown. Otherwise, all commits are shown.\n *\n * @typedef {{message: string, hash: string}} Commit\n */\nimport { github } from \"../github.js\";\nimport { html } from \"../import-maps.js\";\nimport { showError } from \"../utils.js\";\n\nexport const name = \"rs-changelog\";\n\nexport const element = class ChangelogElement extends HTMLElement {\n constructor() {\n super();\n this.props = {\n from: this.getAttribute(\"from\"),\n to: this.getAttribute(\"to\") || \"HEAD\",\n /** @type {(commit: Commit) => boolean} */\n filter:\n typeof window[this.getAttribute(\"filter\")] === \"function\"\n ? window[this.getAttribute(\"filter\")]\n : () => true,\n };\n }\n\n connectedCallback() {\n const { from, to, filter } = this.props;\n html.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error =>\n showError(error.message, name, { elements: [this], cause: error })\n )\n .finally(() => {\n this.dispatchEvent(new CustomEvent(\"done\"));\n }),\n placeholder: \"Loading list of commits...\",\n }}\n </ul>\n `;\n }\n};\n\nasync function fetchCommits(from, to, filter) {\n /** @type {Commit[]} */\n let commits;\n try {\n const gh = await github;\n if (!gh) {\n throw new Error(\"`respecConfig.github` is not set\");\n }\n const url = new URL(\"commits\", `${gh.apiBase}/${gh.fullName}/`);\n url.searchParams.set(\"from\", from);\n url.searchParams.set(\"to\", to);\n\n const res = await fetch(url.href);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n commits = await res.json();\n if (!commits.length) {\n throw new Error(`No commits between ${from}..${to}.`);\n }\n commits = commits.filter(filter);\n } catch (error) {\n const msg = `Error loading commits from GitHub. ${error.message}`;\n throw new Error(msg, { cause: error });\n }\n return commits;\n}\n\nasync function toHTML(commits) {\n const { repoURL } = await github;\n return commits.map(commit => {\n const [message, prNumber = null] = commit.message.split(/\\(#(\\d+)\\)/, 2);\n const commitURL = `${repoURL}commit/${commit.hash}`;\n const prURL = prNumber ? `${repoURL}pull/${prNumber}` : null;\n const pr = prNumber && html` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return html`<li><a href=\"${commitURL}\">${message.trim()}</a>${pr}</li>`;\n });\n}\n","// @ts-check\n/**\n * Registers custom elements and waits for them to finish their processing.\n *\n * Every custom element file exports:\n * - `name`: registered name of the custom element, prefixed with `rs-`.\n * - `element`: class defintion of the custom element.\n *\n * Every custom element must dispatch a CustomEvent 'done' that tells the\n * element has finished its processing, with or without errors.\n *\n * @typedef {{ name: string, element: CustomElementConstructor }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements/index\";\n\nexport async function run() {\n // prepare and register elements\n CUSTOM_ELEMENTS.forEach(el => {\n customElements.define(el.name, el.element);\n });\n\n // wait for each element to be ready\n const selectors = CUSTOM_ELEMENTS.map(el => el.name).join(\", \");\n const elems = document.querySelectorAll(selectors);\n const readyPromises = [...elems].map(\n el => new Promise(res => el.addEventListener(\"done\", res, { once: true }))\n );\n await Promise.all(readyPromises);\n}\n","export const name = \"core/dfn-contract\";\n\nexport function run() {\n addContractDefaults();\n addDefinitionPointers();\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n\n// - Sets data-defines on well-known definition content patterns\nfunction addDefinitionPointers() {\n // A dl with class hasdefinitions associated the dfn in each dt\n // the definition in the following sibling element\n /** @type NodeListOf<HTMLElement> */\n const describedDTs = document.querySelectorAll(\n \"dl.definitions dt:has(dfn[data-dfn-type])\"\n );\n for (const dt of describedDTs) {\n const dfnId = dt.querySelector(\"dfn[data-dfn-type]\").id;\n const dfnContent = /** @type {HTMLElement | null} */ (\n dt.nextElementSibling\n );\n if (dfnContent && !dfnContent.dataset.defines && dfnId) {\n dfnContent.dataset.defines = `#${dfnId}`;\n }\n }\n\n // an element with class \"definition\" is marked as defining the term\n // found in the element\n /** @type NodeListOf<HTMLElement> */\n const definitionContainers = document.querySelectorAll(\n \".definition:has(dfn[data-dfn-type])\"\n );\n for (const el of definitionContainers) {\n const dfn = el.querySelector(\"dfn[data-dfn-type]\");\n if (dfn.id && !el.dataset.defines) {\n el.dataset.defines = `#${dfn.id}`;\n }\n }\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ \\`<meta>\\` ꠇē­¾`,\n hint: `å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ \\`<head>\\` éƒØ分ā€”ā€” \\`<meta charset=\"utf-8\">\\` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂\",\n hint: \"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * Checks that there is a section that has at least privacy and/or\n * security and considerations.\n *\n * The rule is \"privacy\" or \"security\", and \"considerations\", in any order,\n * case-insensitive, multi-line check.\n *\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"privsec-section\";\nexport const name = \"core/linter-rules/privsec-section\";\n\nconst localizationStrings = {\n en: {\n msg: \"Document must have a 'Privacy and/or Security' Considerations section.\",\n hint:\n \"Add a privacy and/or security considerations section. \" +\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nfunction hasPriSecConsiderations(doc) {\n return Array.from(doc.querySelectorAll(\"h2, h3, h4, h5, h6\")).some(\n ({ textContent: text }) => {\n const saysPrivOrSec = /(privacy|security)/im.test(text);\n const saysConsiderations = /(considerations)/im.test(text);\n return (saysPrivOrSec && saysConsiderations) || saysPrivOrSec;\n }\n );\n}\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n if (conf.isRecTrack && !hasPriSecConsiderations(document)) {\n showWarning(l10n.msg, name, { hint: l10n.hint });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,\n hint: \"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","instanceOfAny","constructors","some","c","idbProxyableTypes","cursorAdvanceMethods","transactionDoneMap","WeakMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","replaceTraps","wrapFunction","func","IDBCursor","prototype","advance","continue","continuePrimaryKey","includes","args","apply","unwrap","this","request","transformCachableValue","tx","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","addEventListener","cacheDonePromiseForTransaction","IDBDatabase","IDBObjectStore","IDBIndex","Proxy","IDBRequest","promise","success","result","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","transaction","store","index","shift","oldTraps","advanceMethodProps","methodMap","advanceResults","ittrProxiedCursorToOriginalProxy","cursorIteratorTraps","cachedFunc","iterate","cursor","openCursor","proxiedCursor","delete","isIteratorProp","Symbol","asyncIterator","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","catch","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","_getDefaults","breaks","extensions","gfm","hooks","pedantic","renderer","silent","tokenizer","walkTokens","_defaults","changeDefaults","newDefaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape$1","encode","unescapeTest","unescape","_","n","charAt","String","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","valSource","getRegex","cleanUrl","href","encodeURI","e","noopTest","exec","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","i","trim","length","pop","splice","push","rtrim","invert","l","suffLen","currChar","slice","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","_Tokenizer","options","rules","constructor","space","src","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","anyPunctuation","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","bull","isordered","ordered","start","loose","items","itemRegex","itemContents","endsWithBlankLine","endEarly","line","t","repeat","nextLine","indent","trimStart","search","blankLine","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","rawLine","ischecked","istask","task","checked","trimEnd","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","headers","aligns","rows","item","header","align","row","cell","lheading","paragraph","escape","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","indexOf","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","emStrongLDelim","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","emStrongRDelimAst","emStrongRDelimUnd","lastIndex","lastCharLength","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","bullet","_paragraph","_blockLabel","_tag","_comment","blockNormal","gfmTable","blockGfm","blockPedantic","_punctuation","_inlineComment","_inlineLabel","inlineNormal","blockSkip","reflinkSearch","inlinePedantic","inlineGfm","inlineBreaks","normal","_Lexer","inlineQueue","Object","create","lex","lexInline","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","call","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","charCodeAt","console","keepPrevChar","keys","lastIndexOf","startInline","_Renderer","infostring","quote","body","listitem","checkbox","tablerow","content","tablecell","flags","strong","em","cleanHref","out","image","_TextRenderer","_Parser","textRenderer","parse","parseInline","renderers","genericToken","ret","parser","headingToken","codeToken","tableToken","j","k","blockquoteToken","listToken","itemBody","unshift","htmlToken","paragraphToken","textToken","escapeToken","tagToken","linkToken","imageToken","strongToken","emToken","codespanToken","delToken","_Hooks","static","Set","preprocess","markdown","postprocess","processAllTokens","markedInstance","defaults","setOptions","parseMarkdown","Parser","Renderer","TextRenderer","Lexer","Tokenizer","Hooks","use","values","concat","childTokens","flat","pack","opts","ext","prevRenderer","extLevel","rendererProp","rendererFunc","tokenizerProp","tokenizerFunc","prevTokenizer","hooksProp","hooksFunc","prevHook","passThroughHooks","arg","packWalktokens","origOpt","warn","throwError","onError","toString","message","msg","marked","getDefaultExportFromCjs","x","__esModule","hasOwnProperty","marked$1","getDefaults","hasRequiredPluralize","pluralize$2","exports","module","pluralizeExports","root","pluralize","pluralize$1","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","arguments","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","configurable","o","random","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","v","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","detail","CustomEvent","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ne","re","ie","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","sort","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","setTimeout","addedNodes","removedNodes","dispatchEvent","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","key","serialize","_pluralize","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","startsWith","W3CDate","nonNormativeSelector","createResourceHint","URL","baseURI","linkElem","rel","hint","origin","corsMode","location","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","cause","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","getElementsByTagName","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parent","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","markAsOffending","toJSON","stack","details","showError","pluginName","pub","makePluginUtils","toMDCode","codedJoinOr","quotes","docLink","strings","reindent","endsWith","linkingText","lines","indents","leastIndent","subscriptions","EventTarget","topic","self","JSON","stringify","postMessage","sub","cb","once","ev","removeList","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","toHTML","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodeURIComponent","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","utils","err","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$h","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","buttonId","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","locationHash","l10n$p","style$1","dataInclude","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","saveHtml","aboutRespec","seo","highlight","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","dfnContract","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","newHash","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","diniDefaults","isED","isNoTrack","isPR","logos","prependW3C","doJsonLd","license","shortName","showPreviousVersion","licenseInfo","computeProps","css$f","noReSpecCSS","resourceHints","createResourceHints","createBaseStyle","meta","delimiter","separator","toKeyValuePairs","width","createMetaViewport","styleFile","noToc","attachFixupScript","finalStyleURL","linkURL","urls","frag","reduce","nextLink","linkCSS","exportDoc","w3cStyle","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","default_title","zh","h1Elem","isConnected","tempElem","documentTitle","isPreview","prNumber","prUrl","github","repoURL","setDocumentTitle","showLink","class","showLinkData","showLogo","logo","alt","height","until","date","es","ko","ja","orcidIcon","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","remainder","Number","acc","lastDigitInt","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","Date","extras","every","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","protocol","hCard","companyElem","note","classVal","renderExtra","time","ccLicense","author","authors","editor","editors","former_editor","former_editors","latest_editors_draft","latest_published_version","this_version","nl","headersTmpl","specSubTitleElem","subtitle","getSpecSubTitleElem","textStatus","dashDate","publishHumanDate","multipleEditors","formerEditors","multipleFormerEditors","multipleAuthors","otherLinks","existingCopyright","overrideCopyright","cssClass","renderCopyright","DINIDate","status2text","unofficial","base","isUnofficial","isBasic","publishDate","fallbackDate","isFinite","formattedDate","validateDateAndRecover","lastModified","publishYear","getUTCFullYear","peopCheck","normalizeOrcid","alternateFormats","uri","copyrightStart","publishISODate","toISOString","generatedSubtitle","longStatus","abs","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","range","IDBKeyRange","lowerBound","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","addAll","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","clear","storeNames","stores","clearStorePromises","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","normativity","keywordInterpretation","processConformance","terms","contains","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","closestType","computeExport","export","titles","pluralizeDfn","dfnTexts","dfns","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$d","makeTitle","num","report","number","div","inAside","exampleTitle","css$b","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","handleIssues","ins","ghIssues","getIssueNumber","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","issueBase","atRiskBase","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","issuesURL","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","apiBase","issueNumbers","fullName","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","decorateTableOfFigures","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","citePath","citeFrag","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","about_respec","getEntriesByType","duration","round","perfEntryToTR","gitRevision","metaElem","firstParagraph","css$9","fetchBase","_documentCurrentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","css$5","varMap","variables","currentSection","css$3","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","file_a_bug","participate","commit_history","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","dfnsWithNoType","exportableDfns","addContractDefaults","describedDTs","dfnId","dfnContent","defines","definitionContainers","addDefinitionPointers","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"qHACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IAClD,EACDV,EAAQG,QAAU,CAAE,EACpBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCpBO,MAEDC,EAAOC,SAASC,gBAGjBF,GAAMG,aAAa,UACtBH,EAAKI,KAAO,KACPJ,EAAKG,aAAa,SACrBH,EAAKK,IAAM,QAIR,MAAMC,EAAO,CAAE,EAETF,EAAOJ,GAAMI,MAAQ,4DAdd,gBAgBb,SAAaG,GAClBA,EAAOD,KAAOA,EAAKF,IAASE,EAAKE,EACnC,IC3BA,MAAMC,EAAgB,CAACV,EAAQW,IAAiBA,EAAaC,MAAMC,GAAMb,aAAkBa,IAE3F,IAAIC,EACAC,EAqBJ,MAAMC,EAAqB,IAAIC,QACzBC,EAAiB,IAAID,QACrBE,EAAwB,IAAIF,QAgDlC,IAAIG,EAAgB,CAChB,GAAAC,CAAIC,EAAQC,EAAMC,GACd,GAAIF,aAAkBG,eAAgB,CAElC,GAAa,SAATF,EACA,OAAOP,EAAmBK,IAAIC,GAElC,GAAa,UAATC,EACA,OAAOC,EAASE,iBAAiB,QAC3BC,EACAH,EAASI,YAAYJ,EAASE,iBAAiB,GAErE,CAEQ,OAAOG,EAAKP,EAAOC,GACtB,EACDO,IAAG,CAACR,EAAQC,EAAMQ,KACdT,EA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TvH,SAAQ,SAAUuH,GAClB,OAAOR,EAAU0B,cAAclB,EAAK,GAAIA,EAAK,GACnD,IAKI,CACE,CAAC,MAAO,IACR,CAAC,SAAU,MACX,CAAC,gEAAiE,QAClE,CAAC,kCAAmC,OACpC,CAAC,QAAS,KACV,CAAC,uFAAwF,QACzF,CAAC,oBAAqB,QACtB,CAAC,uBAAwB,UACzB,CAAC,sBAAuB,MACxB,CAAC,2FAA4F,MAC7F,CAAC,qEAAsE,SACvE,CAAC,iCAAkC,MACnC,CAAC,oBAAqB,QACtB,CAAC,4FAA6F,QAC9F,CAAC,yGAA0G,QAC3G,CAAC,8FAA+F,QAChG,CAAC,0BAA2B,OAC5B,CAAC,+BAAgC,QACjC,CAAC,sBAAuB,QACxB,CAAC,oBAAqB,UACtB,CAAC,eAAgB,MACjB,CAAC,YAAa,MACd,CAAC,QAAS,QACVvH,SAAQ,SAAUuH,GAClB,OAAOR,EAAU4B,gBAAgBpB,EAAK,GAAIA,EAAK,GACrD,IAKI,CAEE,YACA,SACA,SACA,MACA,WACA,UACA,OACA,YACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,SACA,WACA,YACA,MACA,SACA,YACA,YACA,YACA,WACA,WACA,MACA,UACA,UACA,WACA,WACA,eACA,SACA,SACA,YACA,WACA,YACA,cACA,QACA,UACA,QACA,SACA,aACA,YACA,WACA,OACA,QACA,OACA,QACA,QACA,MACA,QACA,OACA,OACA,YACA,OACA,WACA,SACA,SACA,YACA,WACA,OACA,WACA,OACA,SACA,WACA,SACA,SACA,WACA,SACA,WACA,UACA,QACA,QACA,SACA,UACA,iBACA,QACA,OACA,SACA,UACA,UACA,aACA,WACA,MACA,eAEA,gBACA,SACA,SACA,YACA,WACA,QACA,WACAvH,QAAQ+G,EAAU6B,oBAEb7B,CACX,KAlfkCL,GAAYC,SAwf1CI,GAAyBZ,GAAwBU,ICxgBfkC,GAAU,SAASC,GAAgB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jkC,GAAY7wB,GAAK8b,IAAKtc,GAAM,CAAEuvB,KAAM/uB,GAAK+uB,MAE7C,ICnCA,MACavvB,GAAO,kCAYdQ,GAAOowB,GAVe,CAC1BlwB,GAAI,CACF4b,IAAK8Z,EAAO,oCAAoC,oBAChD7G,KAAM,0DAER4Y,GAAI,CACF7rB,IAAK8Z,EAAO,GAAG,kCACf7G,KAAM,0EAKH,SAAamN,GAClB,IAAKA,EAAKiH,OAhBK,iBAiBb,OAKF,IAAK9P,OAAOnE,SAASplB,KAAKykB,WAAW,QACnC,OAGF,MAAMymC,EAAmBpgD,OAAOqgD,oBAAoB/4B,GAEjDjsB,QAAOyd,GAAQA,EAAIqI,SAAS,QAAUmG,EAAKxO,IAAiB,WAARA,IAEpDzd,QAAOyd,GACN,IAAIiB,IAAIuN,EAAKxO,GAAM2F,OAAOnE,SAASplB,MAAMA,KAAKykB,WAAW,aAG7D,GAAIymC,EAAiBjqD,OAAQ,CAC3B,MAAMoL,EAAO+Z,GAAQ8kC,GAAkBtnC,GAAOkI,EAAO,GAAG,IAAIlI,SAC5DmD,GAAY7wB,GAAK8b,IAAKtc,GAAM,CAAEuvB,KAAM/uB,GAAK+uB,KAAO5Y,GACpD,CACA","x_google_ignoreList":[2,3,4,6]} \ No newline at end of file diff --git a/builds/respec-geonovum.js b/builds/respec-geonovum.js index 9c99a41a2b..b404bc1abf 100644 --- a/builds/respec-geonovum.js +++ b/builds/respec-geonovum.js @@ -1,6 +1,6 @@ -window.respecVersion="35.1.2",function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=!!window.require;if(!t){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function n(e,n){t||(window.require.modules[e]=n)}const r=new EventTarget;function o(e,t){if(r.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const n=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function s(e,t,n={once:!1}){r.addEventListener(e,(e=>t(e.detail)),n)}n("core/pubsubhub",{sub:s});const i=["githubToken","githubUser"];const a=document.documentElement;a?.hasAttribute("lang")||(a.lang="en",a.hasAttribute("dir")||(a.dir="ltr"));const c={},l=a?.lang??"en";var u=Object.freeze({__proto__:null,l10n:c,lang:l,name:"core/l10n",run:function(e){e.l10n=c[l]||c.en}});const d=(e,t)=>t.some((t=>e instanceof t));let p,f;const h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return k(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function w(e){b=e(b)}function y(e){return(f||(f=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(x(this),t),k(this.request)}:function(...t){return k(e.apply(x(this),t))}}function v(e){return"function"==typeof e?y(e):(e instanceof IDBTransaction&&function(e){if(h.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)}));h.set(e,t)}(e),d(e,p||(p=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,b):e)}function k(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(k(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)}));return g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=v(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const x=e=>g.get(e);const $=["get","getKey","getAll","getAllKeys","count"],_=["put","add","delete","clear"],E=new Map;function S(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(E.get(t))return E.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=_.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!$.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let i=s.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),o&&s.done]))[0]};return E.set(t,s),s}w((e=>({...e,get:(t,n,r)=>S(t,n)||e.get(t,n,r),has:(t,n)=>!!S(t,n)||e.has(t,n)})));const C=["continue","continuePrimaryKey","advance"],L={},A=new WeakMap,T=new WeakMap,R={get(e,t){if(!C.includes(t))return e[t];let n=L[t];return n||(n=L[t]=function(...e){A.set(this,T.get(this)[t](...e))}),n}};async function*N(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,R);for(T.set(n,t),g.set(n,x(t));t;)yield n,t=await(A.get(n)||t.continue()),A.delete(n)}function j(e,t){return t===Symbol.asyncIterator&&d(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&d(e,[IDBIndex,IDBObjectStore])}w((e=>({...e,get:(t,n,r)=>j(t,n)?N:e.get(t,n,r),has:(t,n)=>j(t,n)||e.has(t,n)})));var P=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),k(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=k(i);return r&&i.addEventListener("upgradeneeded",(e=>{r(k(i.result),e.oldVersion,e.newVersion,k(i.transaction),e)})),n&&i.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{s&&e.addEventListener("close",(()=>s())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:x,wrap:k});const I=/^[!#$%&'*+-.^`|~\w]+$/,O=/[\u000A\u000D\u0009\u0020]/u,z=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function D(e,t,n){(t&&""!==t&&!e.has(t)&&z.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function q(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let M={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function B(e){M=e}const F=/[&<>"']/,W=new RegExp(F.source,"g"),H=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,U=new RegExp(H.source,"g"),G={"&":"&","<":"<",">":">",'"':""","'":"'"},V=e=>G[e];function Z(e,t){if(t){if(F.test(e))return e.replace(W,V)}else if(H.test(e))return e.replace(U,V);return e}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Q(e){return e.replace(K,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const J=/(^|[^\[])\^/g;function X(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(J,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}function Y(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const ee={exec:()=>null};function te(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function ne(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const s=e.charAt(r-o-1);if(s!==t||n){if(s===t||!n)break;o++}else o++}return e.slice(0,r-o)}function re(e,t,n,r){const o=t.href,s=t.title?Z(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:s,text:i,tokens:r.inlineTokens(i)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:s,text:Z(i)}}class oe{options;rules;lexer;constructor(e){this.options=e||M}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ne(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=ne(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");e=ne(e.replace(/^ *>[ \t]?/gm,""),"\n");const n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const s=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let i="",a="",c=!1;for(;e;){let n=!1;if(!(t=s.exec(e)))break;if(this.rules.block.hr.test(e))break;i=t[0],e=e.substring(i.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),l=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=r.slice(u),u+=t[1].length);let d=!1;if(!r&&/^ *$/.test(l)&&(i+=l+"\n",e=e.substring(l.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const c=e.split("\n",1)[0];if(l=c,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),o.test(l))break;if(s.test(l))break;if(t.test(l))break;if(n.test(e))break;if(l.search(/[^ ]/)>=u||!l.trim())a+="\n"+l.slice(u);else{if(d)break;if(r.search(/[^ ]/)>=4)break;if(o.test(r))break;if(s.test(r))break;if(n.test(r))break;a+="\n"+l}d||l.trim()||(d=!0),i+=c+"\n",e=e.substring(c.length+1),r=l.slice(u)}}o.loose||(c?o.loose=!0:/\n *\n *$/.test(i)&&(c=!0));let p,f=null;this.options.gfm&&(f=/^\[[ xX]\] /.exec(a),f&&(p="[ ] "!==f[0],a=a.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:i,task:!!f,checked:p,loose:!1,text:a,tokens:[]}),o.raw+=i}o.items[o.items.length-1].raw=i.trimEnd(),o.items[o.items.length-1].text=a.trimEnd(),o.raw=o.raw.trimEnd();for(let e=0;e<o.items.length;e++)if(this.lexer.state.top=!1,o.items[e].tokens=this.lexer.blockTokens(o.items[e].text,[]),!o.loose){const t=o.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));o.loose=n}if(o.loose)for(let e=0;e<o.items.length;e++)o.items[e].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=te(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),o=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?s.align.push("right"):/^ *:-+: *$/.test(e)?s.align.push("center"):/^ *:-+ *$/.test(e)?s.align.push("left"):s.align.push(null);for(const e of n)s.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of o)s.rows.push(te(e,s.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Z(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=ne(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),re(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return re(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let o,s,i=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(s=[...o].length,r[3]||r[4]){i+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){a+=s;continue}if(i-=s,i>0)continue;s=Math.min(s,s+i+a);const t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+s);if(Math.min(n,s)%2){const e=c.slice(1,-1);return{type:"em",raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}const l=c.slice(2,-2);return{type:"strong",raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=Z(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=Z(t[1]),n="mailto:"+e):(e=Z(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=Z(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=Z(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:Z(t[0]),{type:"text",raw:t[0],text:e}}}}const se=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ie=/(?:[*+-]|\d{1,9}[.)])/,ae=X(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ie).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),ce=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,le=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ue=X(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",le).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),de=X(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ie).getRegex(),pe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",fe=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,he=X("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",fe).replace("tag",pe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),me=X(ce).replace("hr",se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex(),ge={blockquote:X(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",me).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:ue,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:se,html:he,lheading:ae,list:de,newline:/^(?: *(?:\n|$))+/,paragraph:me,table:ee,text:/^[^\n]+/},be=X("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex(),we={...ge,table:be,paragraph:X(ce).replace("hr",se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",be).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex()},ye={...ge,html:X("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",fe).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ee,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:X(ce).replace("hr",se).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ae).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ve=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ke=/^( {2,}|\\)\n(?!\s*$)/,xe="\\p{P}\\p{S}",$e=X(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,xe).getRegex(),_e=X(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,xe).getRegex(),Ee=X("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,xe).getRegex(),Se=X("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,xe).getRegex(),Ce=X(/\\([punct])/,"gu").replace(/punct/g,xe).getRegex(),Le=X(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ae=X(fe).replace("(?:--\x3e|$)","--\x3e").getRegex(),Te=X("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ae).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Re=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ne=X(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Re).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),je=X(/^!?\[(label)\]\[(ref)\]/).replace("label",Re).replace("ref",le).getRegex(),Pe=X(/^!?\[(ref)\](?:\[\])?/).replace("ref",le).getRegex(),Ie={_backpedal:ee,anyPunctuation:Ce,autolink:Le,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:ke,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:ee,emStrongLDelim:_e,emStrongRDelimAst:Ee,emStrongRDelimUnd:Se,escape:ve,link:Ne,nolink:Pe,punctuation:$e,reflink:je,reflinkSearch:X("reflink|nolink(?!\\()","g").replace("reflink",je).replace("nolink",Pe).getRegex(),tag:Te,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:ee},Oe={...Ie,link:X(/^!?\[(label)\]\((.*?)\)/).replace("label",Re).getRegex(),reflink:X(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Re).getRegex()},ze={...Ie,escape:X(ve).replace("])","~|])").getRegex(),url:X(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},De={...ze,br:X(ke).replace("{2,}","*").getRegex(),text:X(ze.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qe={normal:ge,gfm:we,pedantic:ye},Me={normal:Ie,gfm:ze,breaks:De,pedantic:Oe};class Be{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||M,this.options.tokenizer=this.options.tokenizer||new oe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:qe.normal,inline:Me.normal};this.options.pedantic?(t.block=qe.pedantic,t.inline=Me.pedantic):this.options.gfm&&(t.block=qe.gfm,this.options.breaks?t.inline=Me.breaks:t.inline=Me.gfm),this.tokenizer.rules=t}static get rules(){return{block:qe,inline:Me}}static lex(e,t){return new Be(t).lex(e)}static lexInline(e,t){return new Be(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){let n,r,o,s;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],s&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),s=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,s,i,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(c));)c=c.slice(0,s.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class Fe{options;constructor(e){this.options=e||M}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+Z(r)+'">'+(n?e:Z(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:Z(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const r=Y(e);if(null===r)return n;let o='<a href="'+(e=r)+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>",o}image(e,t,n){const r=Y(e);if(null===r)return n;let o=`<img src="${e=r}" alt="${n}"`;return t&&(o+=` title="${t}"`),o+=">",o}text(e){return e}}class We{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class He{options;renderer;textRenderer;constructor(e){this.options=e||M,this.options.renderer=this.options.renderer||new Fe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new We}static parse(e,t){return new He(t).parse(e)}static parseInline(e,t){return new He(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const e=o,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(o.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=o;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,Q(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=o;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=o;let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let s="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];r="";for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});s+=this.renderer.tablerow(r)}n+=this.renderer.table(t,s);continue}case"blockquote":{const e=o,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=o,t=e.ordered,r=e.start,s=e.loose;let i="";for(let t=0;t<e.items.length;t++){const n=e.items[t],r=n.checked,o=n.task;let a="";if(n.task){const e=this.renderer.checkbox(!!r);s?n.tokens.length>0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(n.tokens,s),i+=this.renderer.listitem(a,o,!!r)}n+=this.renderer.list(i,t,r);continue}case"html":{const e=o;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=o;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let s=o,i=s.tokens?this.parseInline(s.tokens):s.text;for(;r+1<e.length&&"text"===e[r+1].type;)s=e[++r],i+="\n"+(s.tokens?this.parseInline(s.tokens):s.text);n+=t?this.renderer.paragraph(i):i;continue}default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const e=this.options.extensions.renderers[o.type].call({parser:this},o);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=e||"";continue}}switch(o.type){case"escape":{const e=o;n+=t.text(e.text);break}case"html":{const e=o;n+=t.html(e.text);break}case"link":{const e=o;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=o;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=o;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=o;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=o;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=o;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=o;n+=t.text(e.text);break}default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class Ue{options;constructor(e){this.options=e||M}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}const Ge=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(Be.lex,He.parse);parseInline=this.#e(Be.lexInline,He.parseInline);Parser=He;Renderer=Fe;TextRenderer=We;Lexer=Be;Tokenizer=oe;Hooks=Ue;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{const o=e[r].flat(1/0);n=n.concat(this.walkTokens(o,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new Fe(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const r=n,o=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new oe(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,o=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new Ue;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,o=e.hooks[r],s=t[r];Ue.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(o.call(t,e)).then((e=>s.call(t,e)));const n=o.call(t,e);return s.call(t,n)}:t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Be.lex(e,t??this.defaults)}parser(e,t){return He.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const o={...r},s={...this.defaults,...o};!0===this.defaults.async&&!1===o.async&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const i=this.#t(!!s.silent,!!s.async);if(null==n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then((t=>e(t,s))).then((e=>s.hooks?s.hooks.processAllTokens(e):e)).then((e=>s.walkTokens?Promise.all(this.walkTokens(e,s.walkTokens)).then((()=>e)):e)).then((e=>t(e,s))).then((e=>s.hooks?s.hooks.postprocess(e):e)).catch(i);try{s.hooks&&(n=s.hooks.preprocess(n));let r=e(n,s);s.hooks&&(r=s.hooks.processAllTokens(r)),s.walkTokens&&this.walkTokens(r,s.walkTokens);let o=t(r,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(e){return i(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+Z(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Ve(e,t){return Ge.parse(e,t)}Ve.options=Ve.setOptions=function(e){return Ge.setOptions(e),Ve.defaults=Ge.defaults,B(Ve.defaults),Ve},Ve.getDefaults=q,Ve.defaults=M,Ve.use=function(...e){return Ge.use(...e),Ve.defaults=Ge.defaults,B(Ve.defaults),Ve},Ve.walkTokens=function(e,t){return Ge.walkTokens(e,t)},Ve.parseInline=Ge.parseInline,Ve.Parser=He,Ve.parser=He.parse,Ve.Renderer=Fe,Ve.TextRenderer=We,Ve.Lexer=Be,Ve.lexer=Be.lex,Ve.Tokenizer=oe,Ve.Hooks=Ue,Ve.parse=Ve,Ve.options,Ve.setOptions,Ve.use,Ve.walkTokens,Ve.parseInline,He.parse,Be.lex;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Ze(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ke,Qe={exports:{}};Ke=Qe,function(e,t){Ke.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function s(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(t[0],(function(n,r){var o,s,a=(o=t[1],s=arguments,o.replace(/\$(\d{1,2})/g,(function(e,t){return s[t]||""})));return i(""===n?e[r-1]:n,a)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var s=r[o];if(s[0].test(t))return a(t,s)}return t}function l(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?i(r,o):e.hasOwnProperty(o)?i(r,e[o]):c(o,r,n)}}function u(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(o,o,n)===o}}function d(e,t,n){return(n?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=l(o,r,e),d.isPlural=u(o,r,e),d.singular=l(r,o,t),d.isSingular=u(r,o,t),d.addPluralRule=function(t,n){e.push([s(t),n])},d.addSingularRule=function(e,n){t.push([s(e),n])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},d.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),o[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return d.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return d.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return d.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eĆ©]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d}));var Je=Ze(Qe.exports),Xe=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=s.prototype;return o.delete=function(e){return this.has(e)&&delete e[this._]},o.get=function(e){return this.has(e)?e[this._]:void 0},o.has=function(e){return r.call(e,this._)},o.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},s;function s(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(i,this)}function i(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=o.prototype;function o(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=o}(Math.random(),Object.defineProperty)}function o(e,t,n,r,o,s){for(var i=("selectedIndex"in t),a=i;r<o;){var c,l=e(n[r],1);t.insertBefore(l,s),i&&a&&l.selected&&(a=!a,c=t.selectedIndex,t.selectedIndex=c<0?r:d.call(t.querySelectorAll("option"),l)),r++}}function s(e,t){return e==t}function i(e){return e}function a(e,t,n,r,o,s,i){var a=s-o;if(a<1)return-1;for(;a<=n-t;){for(var c=t,l=o;c<n&&l<s&&i(e[c],r[l]);)c++,l++;if(l===s)return t;t=c+1}return-1}function c(e,t,n,r,o){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:o}function l(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,o=t;r<o;){var s=(r+o)/2>>>0;n<e[s]?o=s:r=1+s}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||s,d=r.node||i,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,w=0;g<m&&w<b&&u(t[g],n[w]);)g++,w++;for(;g<m&&w<b&&u(t[m-1],n[b-1]);)m--,b--;var y=g===m,v=w===b;if(y&&v)return n;if(y&&w<b)return o(d,e,n,w,b,c(d,t,g,h,f)),n;if(v&&g<m)return l(d,t,g,m),n;var k=m-g,x=b-w,$=-1;if(k<x){if(-1<($=a(n,w,b,t,g,m,u)))return o(d,e,n,w,$,d(t[g],0)),o(d,e,n,$+k,b,c(d,t,m,h,f)),n}else if(x<k&&-1<($=a(t,g,m,n,w,b,u)))return l(d,t,g,$),l(d,t,$+x,m),n;return k<2||x<2?(o(d,e,n,w,b,d(t[g],0)),l(d,t,g,m)):k==x&&function(e,t,n,r,o,s){for(;r<o&&s(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?o(d,e,n,w,b,c(d,t,m,h,f)):function(e,t,n,r,s,i,a,c,u,d,f,h,m){!function(e,t,n,r,s,i,a,c,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:s++,f++;break;case 1:d.push(r[s]),o(t,n,r,s++,s,f<c?t(i[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(i[a])?a++:l(t,i,a++,a)}}(function(e,t,n,r,o,s,i){var a,c,l,u,d,p,f=n+s,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(c=(l=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;l<s&&c<n&&i(r[o+l],e[t+c]);)l++,c++;if(l===s&&c===n)break e;d[b+a]=l}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<l&&0<c&&i(r[o+l-1],e[t+c-1]);)m[g--]=0,l--,c--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=l-c)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(c--,m[g--]=1):(l--,m[g--]=-1)}return m}(n,r,i,a,c,d,h)||function(e,t,n,r,o,s,i,a){var c=0,l=r<a?r:a,u=Array(l++),d=Array(l);d[0]=-1;for(var f=1;f<l;f++)d[f]=i;for(var h=o.slice(s,i),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(c=p(d,l,g=b+s))&&(d[c]=g,u[c]={newi:m,oldi:g,prev:u[c-1]})}for(c=--l,--i;d[c]>i;)--c;l=a+r-c;var w=Array(l),y=u[c];for(--n;y;){for(var v=y.newi,k=y.oldi;v<n;)w[--l]=1,--n;for(;k<i;)w[--l]=-1,--i;w[--l]=0,--n,--i,y=y.prev}for(;t<=n;)w[--l]=1,--n;for(;s<=i;)w[--l]=-1,--i;return w}(n,r,s,i,a,c,u,d),e,t,n,r,a,c,f,m)}(d,e,n,w,b,x,t,g,m,k,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,w={};try{w.Map=Map}catch(u){w.Map=function(){var e=0,t=[],n=[];return{delete:function(o){var s=r(o);return s&&(t.splice(e,1),n.splice(e,1)),s},forEach:function(e,r){t.forEach((function(t,o){e.call(r,n[o],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(o,s){return n[r(o)?e:t.push(o)-1]=s,this}};function r(n){return-1<(e=t.indexOf(n))}}}var y=w.Map;function v(){return this}function k(e,t){var n="_"+e+"$";return{get:function(){return this[n]||x(this,n,t.call(this,e))},set:function(e){x(this,n,e)}}}var x=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var $,_,E,S,C,L,A={},T={},R=[],N=T.hasOwnProperty,j=0,P={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in T||(j=R.push(e)),T[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<j;n++){var r=R[n];if(N.call(e,r))return T[r](e[r],t)}}},I=Array.isArray||(_=($={}.toString).call([]),function(e){return $.call(e)===_}),O=(E=e,S="fragment",L="content"in D(C="template")?function(e){var t=D(C);return t.innerHTML=e,t.content}:function(e){var t,n=D(S),r=D(C);return z(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=D(S),n=D("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",z(t,n.firstChild.childNodes),t}:L)(e)});function z(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function D(e){return e===S?E.createDocumentFragment():E.createElementNS("http://www.w3.org/1999/xhtml",e)}var q,M,B,F,W,H,U,G,V,Z=(M="appendChild",B="cloneNode",F="createTextNode",H=(W="importNode")in(q=e),(U=q.createDocumentFragment())[M](q[F]("g")),U[M](q[F]("")),(H?q[W](U,!0):U[B](!0)).childNodes.length<2?function e(t,n){for(var r=t[B](),o=t.childNodes||[],s=o.length,i=0;n&&i<s;i++)r[M](e(o[i],n));return r}:H?q[W]:function(e,t){return e[B](!!t)}),K="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Q="-"+Math.random().toFixed(6)+"%",J=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Q+'"></p>',G.content.childNodes[0].getAttribute(V)==Q)||(Q="_dt: "+Q.slice(1,-1)+";",J=!0)}catch(u){}var X="\x3c!--"+Q+"--\x3e",Y=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,oe=" \\f\\n\\r\\t",se="[^"+oe+"\\/>\"'=]+",ie="["+oe+"]+"+se,ae="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ce="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+se.replace("\\/","")+"))?)",le=new RegExp(ae+ie+ce+"+)(["+oe+"]*/?>)","g"),ue=new RegExp(ae+ie+ce+"*)(["+oe+"]*/>)","g"),de=new RegExp("("+ie+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function pe(e,t,n,r){return"<"+t+n.replace(de,fe)+r}function fe(e,t,n){return t+(n||'"')+Q+(n||'"')}function he(e,t,n){return re.test(t)?e:"<"+t+n+"></"+t+">"}var me=J?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function ge(t,n,r,o){for(var s=t.childNodes,i=s.length,a=0;a<i;){var c=s[a];switch(c.nodeType){case ee:var l=o.concat(a);!function(t,n,r,o){for(var s,i=t.attributes,a=[],c=[],l=me(i,r),u=l.length,d=0;d<u;){var p=l[d++],f=p.value===Q;if(f||1<(s=p.value.split(X)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=i[m]||i[m.toLowerCase()];if(f)n.push(be(g,o,m,null));else{for(var b=s.length-2;b--;)r.shift();n.push(be(g,o,m,s))}}c.push(p)}}for(var w=((d=0)<(u=c.length)&&J&&!("ownerSVGElement"in t));d<u;){var y=c[d++];w&&(y.value=""),t.removeAttribute(y.name)}var v=t.nodeName;if(/^script$/i.test(v)){var k=e.createElement(v);for(u=i.length,d=0;d<u;)k.setAttributeNode(i[d++].cloneNode(!0));k.textContent=t.textContent,t.parentNode.replaceChild(k,t)}}(c,n,r,l),ge(c,n,r,l);break;case Y:var u=c.textContent;if(u===Q)r.shift(),n.push(ne.test(t.nodeName)?we(t,o):{type:"any",node:c,path:o.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"šŸ‘»":t.removeChild(c),a--,i--}break;case te:ne.test(t.nodeName)&&K.call(c.textContent)===X&&(r.shift(),n.push(we(t,o)))}a++}}function be(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function we(e,t){return{type:"text",node:e,path:t}}var ye,ve=(ye=new n,{get:function(e){return ye.get(e)},set:function(e,t){return ye.set(e,t),t}});function ke(e,t){var n=(e.convert||function(e){return e.join(X).replace(ue,he).replace(le,pe)})(t),r=e.transform;r&&(n=r(n));var o=O(n,e.type);$e(o);var s=[];return ge(o,s,t.slice(0),[]),{content:o,updates:function(n){for(var r=[],o=s.length,i=0,a=0;i<o;){var c=s[i++],l=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,c.path);switch(c.type){case"any":r.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var u=c.sparse,d=e.attribute(l,c.name,c.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return o+=a,function(){var e=arguments.length;if(o!==e-1)throw new Error(e-1+" values instead of "+o+"\n"+t.join("${value}"));for(var s=1,i=1;s<e;){var a=r[s-i];if(a.sparse){var c=a.values,l=c[0],u=1,d=c.length;for(i+=d-2;u<d;)l+=arguments[s++]+c[u++];a.fn(l)}else a.fn(arguments[s++])}return n}}}}var xe=[];function $e(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===K.call(r.textContent).length&&e.removeChild(r)}}var _e,Ee,Se=(_e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Ee=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Le(n,!0)}(e,t):Le(e.style,!1)});function Ce(e,t,n){return t+"-"+n.toLowerCase()}function Le(e,t){var n,r;return function(o){var s,i,a,c;switch(typeof o){case"object":if(o){if("object"===n){if(!t&&r!==o)for(i in r)i in o||(e[i]="")}else t?e.value="":e.cssText="";for(i in s=t?{}:e,o)a="number"!=typeof(c=o[i])||_e.test(i)?c:c+"px",!t&&/^--/.test(i)?s.setProperty(i,a):s[i]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Ee,Ce),":",e[t],";");return n.join("")}(r=s):r=o;break}default:r!=o&&(n="string",r=o,t?e.value=o||"":e.cssText=o||"")}}}var Ae,Te,Re=(Ae=[].slice,(Te=Ne.prototype).ELEMENT_NODE=1,Te.nodeType=111,Te.remove=function(e){var t,n=this.childNodes,r=this.firstChild,o=this.lastChild;return this._=null,e&&2===n.length?o.parentNode.removeChild(o):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(o),t.deleteContents()),r},Te.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,o=0,s=r.length;o<s;o++)t.appendChild(r[o]);return t},Ne);function Ne(e){var t=this.childNodes=Ae.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function je(e){return{html:e}}function Pe(e,t){switch(e.nodeType){case He:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case We:return Pe(e.render(),t);default:return e}}function Ie(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(je).then(t):Promise.resolve(P.invoke(e,t)).then(t)}function Oe(e){return null!=e&&"then"in e}var ze,De,qe,Me,Be,Fe="ownerSVGElement",We=v.prototype.nodeType,He=Re.prototype.nodeType,Ue=(De=(ze={Event:b,WeakSet:u}).Event,qe=ze.WeakSet,Me=!0,Be=null,function(e){return Me&&(Me=!Me,Be=new qe,function(e){var t=new qe,n=new qe;try{new MutationObserver(i).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,o=[],s=function(e){o.push(e),clearTimeout(r),r=setTimeout((function(){i(o.splice(r=0,o.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){s({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){s({addedNodes:[e.target],removedNodes:[]})}),!0)}function i(e){for(var r,o=e.length,s=0;s<o;s++)a((r=e[s]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var o,s=new De(t),i=e.length,a=0;a<i;1===(o=e[a++]).nodeType&&function e(t,n,r,o,s){Be.has(t)&&!o.has(t)&&(s.delete(t),o.add(t),t.dispatchEvent(n));for(var i=t.children||[],a=i.length,c=0;c<a;e(i[c++],n,r,o,s));}(o,s,t,n,r));}}(e.ownerDocument)),Be.add(e),e}),Ge=/^(?:form|list)$/i,Ve=[].slice;function Ze(t){return this.type=t,function(t){var n=xe,r=$e;return function(o){var s,i,a;return n!==o&&(s=t,i=n=o,a=ve.get(i)||ve.set(i,ke(s,i)),r=a.updates(Z.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ke=!(Ze.prototype={attribute:function(e,t,n){var r,o=Fe in e;if("style"===t)return Se(e,n,o);if("."===t.slice(0,1))return l=e,u=t.slice(1),o?function(e){try{l[u]=e}catch(t){l.setAttribute(u,e)}}:function(e){l[u]=e};if("?"===t.slice(0,1))return i=e,a=t.slice(1),function(e){c!==!!e&&((c=!!e)?i.setAttribute(a,""):i.removeAttribute(a))};if(/^on/.test(t)){var s=t.slice(2);return"connected"===s||"disconnected"===s?Ue(e):t.toLowerCase()in e&&(s=s.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(s,r,!1),(r=t)&&e.addEventListener(s,t,!1))}}if("data"===t||!o&&t in e&&!Ge.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in P.attributes)return function(n){var o=P.attributes[t](e,n);r!==o&&(null==(r=o)?e.removeAttribute(t):e.setAttribute(t,o))};var i,a,c,l,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Pe,before:e},o=Fe in e?"svg":"html",s=!1;return function i(a){switch(typeof a){case"string":case"number":case"boolean":s?n!==a&&(n=a,t[0].textContent=a):(s=!0,n=a,t=h(e.parentNode,t,[(c=a,e.ownerDocument.createTextNode(c))],r));break;case"function":i(a(e));break;case"object":case"undefined":if(null==a){s=!1,t=h(e.parentNode,t,[],r);break}default:if(s=!1,I(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":i({html:a});break;case"object":if(I(a[0])&&(a=a.concat.apply([],a)),Oe(a[0])){Promise.all(a).then(i);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Ve.call(a.childNodes):[a],r):Oe(a)?a.then(i):"placeholder"in a?Ie(a,i):"text"in a?i(String(a.text)):"any"in a?i(a.any):"html"in a?t=h(e.parentNode,t,Ve.call(O([].concat(a.html).join(""),o).childNodes),r):i("length"in a?Ve.call(a):P.invoke(a,i))}var c}},text:function(e){var t;return function n(r){var o;t!==r&&("object"==(o=typeof(t=r))&&r?Oe(r)?r.then(n):"placeholder"in r?Ie(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Ve.call(r).join(""):P.invoke(r,n)):"function"==o?n(r(e)):e.textContent=null==r?"":r)}}}),Qe=function(t){var r,o,s,i,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),c=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||c?(o={},s=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return o[t]||(o[t]=e)},Qe=c?s:(i=new n,function(e){return i.get(e)||(n=s(t=e),i.set(t,n),n);var t,n})):Ke=!0,Je(t)};function Je(e){return Ke?e:Qe(e)}function Xe(e){for(var t=arguments.length,n=[Je(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ye=new n,et=function(e){var t,n,r;return function(){var o=Xe.apply(null,arguments);return r!==o[0]?(r=o[0],n=new Ze(e),t=nt(n.apply(n,o))):n.apply(n,o),t}},tt=function(e,t){var n=t.indexOf(":"),r=Ye.get(e),o=t;return-1<n&&(o=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ye.set(e,r={}),r[o]||(r[o]=et(t))},nt=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Re(t):e},rt=new n;function ot(){var e=rt.get(this),t=Xe.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ze(Fe in this?"svg":"html");rt.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,it,at,ct,lt=P.define,ut=Ze.prototype;function dt(e){return arguments.length<2?null==e?et("html"):"string"==typeof e?dt.wire(null,e):"raw"in e?et("html")(e):"nodeType"in e?dt.bind(e):tt(e,"html"):("raw"in e?et("html"):dt.wire).apply(null,arguments)}return dt.Component=v,dt.bind=function(e){return ot.bind(e)},dt.define=lt,dt.diff=h,(dt.hyper=dt).observe=Ue,dt.tagger=ut,dt.wire=function(e,t){return null==e?et(t||"html"):tt(e,t||"html")},dt._={WeakMap:n,WeakSet:u},st=et,it=new n,at=Object.create,ct=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,o){var s,i,a,c=t.get(e)||ct(e,t);switch(typeof o){case"object":case"function":var l=c.w||(c.w=new n);return l.get(o)||(s=l,i=o,a=new e(r),s.set(i,a),a);default:var u=c.p||(c.p=at(null));return u[o]||(u[o]=new e(r))}}(this,it.get(e)||(r=e,o=new y,it.set(r,o),o),e,null==t?"default":t);var r,o}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:k("html",st),svg:k("svg",st),state:k("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var o in r)n[o]=r[o];return!1!==t&&this.render(),this}}}),dt}(document);const Ye=Xe,et=P,tt=Ve,nt=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(e=e.trim(),!e)throw new TypeError("Invalid input.");let t="",n="",r="",o=null,s=new Map,i="type",a=Array.from(e);for(let e=0;e<a.length;e++){const c=a[e];switch(i){case"type":if("/"===c){i="subtype";continue}t+=c;break;case"subtype":if(";"===c){i="param-start";continue}n+=c;break;case"param-start":if(O.test(c)||";"===c)continue;r+=c,i="param-name";break;case"param-name":if("="===c||";"===c){if("="===c){i="param-value",o=null;continue}s.set(r.toLowerCase(),null),r="";continue}r+=c;break;case"param-value":if('"'==c){i="collect-quoted-string";continue}if(";"===c){o=o.trimEnd(),i="param-start",D(s,r,o),r="";continue}o="string"==typeof o?o+c:c;break;case"collect-quoted-string":if('"'===c){D(s,r,o),i="ignore-input-until-next-param",r="",o=null;continue}if("\\"===c)continue;o="string"==typeof o?o+c:c;break;case"ignore-input-until-next-param":if(";"!==c)continue;i="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${i} `)}}r&&D(s,r,o);if(""===t.trim()||!I.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!I.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(s.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?I.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},rt=Je,ot=/-/g,st=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"});"en"===l||l.startsWith("en-");const it=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function at(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function ct(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function lt(e,t="long"){const n=new Intl.ListFormat(l,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:o})=>"element"===n&&t?t(o,r++,e):o))}}const ut=lt("conjunction"),dt=lt("disjunction");function pt(e,t){return ut(e,t).join("")}function ft(e){return e.trim().replace(/\s+/g," ")}function ht(e,t=l){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=function(e,t,n=l){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function mt(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){Rt(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function gt(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>Ye`${e}, `));return Ye`${r}${n[n.length-1]}`}function bt(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=r?n:n.toLowerCase();if(o=o.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),o?!/\.$/.test(o)&&/^[a-z]/i.test(t||o)||(o=`x${o}`):o="generatedID",t&&(o=`${t}-${o}`),e.ownerDocument.getElementById(o)){let t=0,n=`${o}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${o}-${t}`;o=n}return e.id=o,o}function wt(e){const t=new Set,n="ltNodefault"in e.dataset?"":ft(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>ft(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(ft(e))))}return[...t]}function yt(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function vt(e,t){const n=t.closest(it);let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function kt(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function xt(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function $t(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class _t extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function Et(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{yt(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),St(t),t}function St(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Ct(t)])e.remove()}function*Ct(e){for(;e.nextNode();)yield e.currentNode}class Lt extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class At extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||bt(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:s,title:i,details:a}=this;return{message:e,name:t,plugin:r,hint:o,elements:s,title:i,details:a,stack:n}}}function Tt(e,t,n={}){const r={...n,isWarning:!1};o("error",new At(e,t,r))}function Rt(e,t,n={}){const r={...n,isWarning:!0};o("warn",new At(e,t,r))}function Nt(e){return{showError:(t,n)=>Tt(t,e,n),showWarning:(t,n)=>Rt(t,e,n)}}function jt(e){return e?`\`${e}\``:""}function Pt(e,{quotes:t}={quotes:!1}){return dt(e,t?e=>jt(It(e)):jt).join("")}function It(e){return String(e)?`"${e}"`:""}function Ot(e,...t){return zt(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,s]=r.slice(1,-1).split("|");if(s){return`${e}[${o}](${new URL(s,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`})).join(""))}function zt(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter((e=>e.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}const Dt=new Map([["text/html","html"],["application/xml","xml"]]);function qt(e,t=document){const n=Dt.get(e);if(!n){const t=[...Dt.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Mt(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Mt(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;St(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),ct(r);const s=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&s.appendChild(i);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=Ye`<meta charset="utf-8" />`);s.appendChild(a);const c=`ReSpec ${window.respecVersion||"Developer Channel"}`,l=Ye` - <meta name="generator" content="${c}" /> - `;s.appendChild(l),t.prepend(s),o("beforesave",r)}(n);let r="";if("xml"===e)r=(new XMLSerializer).serializeToString(n);else!function(e){e.querySelectorAll("style").forEach((e=>{e.innerHTML=`\n${e.innerHTML}\n`})),e.querySelectorAll("head > *").forEach((e=>{e.outerHTML=`\n${e.outerHTML}`}))}(n),n.doctype&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML;return r}n("core/exporter",{rsDocToDataURL:qt});class Bt{constructor(){this._respecDonePromise=new Promise((e=>{s("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],s("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),s("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return Mt("html",document)}}const Ft="core/post-process";const Wt="core/pre-process";const Ht="core/base-runner";async function Ut(e){!function(){const e=new Bt;Object.defineProperty(document,"respec",{value:e})}(),o("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),s("amend-user-config",n),s("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of i)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)}))}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter((([e,t])=>!!e&&!!t)).map((([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let o;try{o=JSON.parse(r)}catch{o=r}return[n,o]})),r=Object.fromEntries(n);Object.assign(e,r),o("amend-user-config",r)}(respecConfig),performance.mark(`${Ht}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Tt("Every item in `preProcess` must be a JS function.",Wt),t})).map((async(t,n)=>{const r=Nt(`${Wt}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){Tt(`Function ${t.name} threw an error during \`preProcess\`.`,Wt,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}}(respecConfig);const t=e.filter((e=>{return(t=e)&&(t.run||t.Plugin);var t}));t.forEach((e=>!e.name&&console.warn("Plugin lacks name:",e))),await async function(e,t){for(const n of e.filter((e=>e.prepare)))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise((async(r,o)=>{const s=setTimeout((()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),o(new Error(t))}),15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){o(e)}finally{clearTimeout(s),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}}))}catch(e){console.error(e)}}}(t,respecConfig),o("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter((e=>{const t="function"==typeof e;return t||Tt("Every item in `postProcess` must be a JS function.",Ft),t})).map((async(t,n)=>{const r=Nt(`${Ft}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){Tt(`Function ${t.name} threw an error during \`postProcess\`.`,Ft,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),o("end-all"),ct(document),performance.mark(`${Ht}-end`),performance.measure(Ht,`${Ht}-start`,`${Ht}-end`)}var Gt=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} +window.respecVersion="35.2.0",function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=!!window.require;if(!t){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function n(e,n){t||(window.require.modules[e]=n)}const r=document.documentElement;r?.hasAttribute("lang")||(r.lang="en",r.hasAttribute("dir")||(r.dir="ltr"));const o={},s=r?.lang??"en";var i=Object.freeze({__proto__:null,l10n:o,lang:s,name:"core/l10n",run:function(e){e.l10n=o[s]||o.en}});const a=(e,t)=>t.some((t=>e instanceof t));let c,l;const u=new WeakMap,d=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return b(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){f=e(f)}function m(e){return(l||(l=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(w(this),t),b(this.request)}:function(...t){return b(e.apply(w(this),t))}}function g(e){return"function"==typeof e?m(e):(e instanceof IDBTransaction&&function(e){if(u.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)}));u.set(e,t)}(e),a(e,c||(c=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,f):e)}function b(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(b(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)}));return p.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=g(e);return t!==e&&(d.set(e,t),p.set(t,e)),t}const w=e=>p.get(e);const y=["get","getKey","getAll","getAllKeys","count"],v=["put","add","delete","clear"],k=new Map;function x(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(k.get(t))return k.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=v.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!y.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let i=s.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),o&&s.done]))[0]};return k.set(t,s),s}h((e=>({...e,get:(t,n,r)=>x(t,n)||e.get(t,n,r),has:(t,n)=>!!x(t,n)||e.has(t,n)})));const $=["continue","continuePrimaryKey","advance"],_={},E=new WeakMap,S=new WeakMap,C={get(e,t){if(!$.includes(t))return e[t];let n=_[t];return n||(n=_[t]=function(...e){E.set(this,S.get(this)[t](...e))}),n}};async function*L(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,C);for(S.set(n,t),p.set(n,w(t));t;)yield n,t=await(E.get(n)||t.continue()),E.delete(n)}function A(e,t){return t===Symbol.asyncIterator&&a(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&a(e,[IDBIndex,IDBObjectStore])}h((e=>({...e,get:(t,n,r)=>A(t,n)?L:e.get(t,n,r),has:(t,n)=>A(t,n)||e.has(t,n)})));var T=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),b(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=b(i);return r&&i.addEventListener("upgradeneeded",(e=>{r(b(i.result),e.oldVersion,e.newVersion,b(i.transaction),e)})),n&&i.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{s&&e.addEventListener("close",(()=>s())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:w,wrap:b});const R=/^[!#$%&'*+-.^`|~\w]+$/,N=/[\u000A\u000D\u0009\u0020]/u,j=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function P(e,t,n){(t&&""!==t&&!e.has(t)&&j.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function I(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let O={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function z(e){O=e}const D=/[&<>"']/,q=new RegExp(D.source,"g"),M=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,B=new RegExp(M.source,"g"),F={"&":"&","<":"<",">":">",'"':""","'":"'"},W=e=>F[e];function H(e,t){if(t){if(D.test(e))return e.replace(q,W)}else if(M.test(e))return e.replace(B,W);return e}const U=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function G(e){return e.replace(U,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const V=/(^|[^\[])\^/g;function Z(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(V,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}function K(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const Q={exec:()=>null};function J(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function X(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const s=e.charAt(r-o-1);if(s!==t||n){if(s===t||!n)break;o++}else o++}return e.slice(0,r-o)}function Y(e,t,n,r){const o=t.href,s=t.title?H(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:s,text:i,tokens:r.inlineTokens(i)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:s,text:H(i)}}class ee{options;rules;lexer;constructor(e){this.options=e||O}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:X(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=X(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");e=X(e.replace(/^ *>[ \t]?/gm,""),"\n");const n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const s=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let i="",a="",c=!1;for(;e;){let n=!1;if(!(t=s.exec(e)))break;if(this.rules.block.hr.test(e))break;i=t[0],e=e.substring(i.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),l=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=r.slice(u),u+=t[1].length);let d=!1;if(!r&&/^ *$/.test(l)&&(i+=l+"\n",e=e.substring(l.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const c=e.split("\n",1)[0];if(l=c,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),o.test(l))break;if(s.test(l))break;if(t.test(l))break;if(n.test(e))break;if(l.search(/[^ ]/)>=u||!l.trim())a+="\n"+l.slice(u);else{if(d)break;if(r.search(/[^ ]/)>=4)break;if(o.test(r))break;if(s.test(r))break;if(n.test(r))break;a+="\n"+l}d||l.trim()||(d=!0),i+=c+"\n",e=e.substring(c.length+1),r=l.slice(u)}}o.loose||(c?o.loose=!0:/\n *\n *$/.test(i)&&(c=!0));let p,f=null;this.options.gfm&&(f=/^\[[ xX]\] /.exec(a),f&&(p="[ ] "!==f[0],a=a.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:i,task:!!f,checked:p,loose:!1,text:a,tokens:[]}),o.raw+=i}o.items[o.items.length-1].raw=i.trimEnd(),o.items[o.items.length-1].text=a.trimEnd(),o.raw=o.raw.trimEnd();for(let e=0;e<o.items.length;e++)if(this.lexer.state.top=!1,o.items[e].tokens=this.lexer.blockTokens(o.items[e].text,[]),!o.loose){const t=o.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));o.loose=n}if(o.loose)for(let e=0;e<o.items.length;e++)o.items[e].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=J(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),o=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?s.align.push("right"):/^ *:-+: *$/.test(e)?s.align.push("center"):/^ *:-+ *$/.test(e)?s.align.push("left"):s.align.push(null);for(const e of n)s.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of o)s.rows.push(J(e,s.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:H(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=X(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),Y(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Y(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let o,s,i=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(s=[...o].length,r[3]||r[4]){i+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){a+=s;continue}if(i-=s,i>0)continue;s=Math.min(s,s+i+a);const t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+s);if(Math.min(n,s)%2){const e=c.slice(1,-1);return{type:"em",raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}const l=c.slice(2,-2);return{type:"strong",raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=H(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=H(t[1]),n="mailto:"+e):(e=H(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=H(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=H(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:H(t[0]),{type:"text",raw:t[0],text:e}}}}const te=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ne=/(?:[*+-]|\d{1,9}[.)])/,re=Z(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ne).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),oe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,se=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ie=Z(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",se).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ae=Z(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ne).getRegex(),ce="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",le=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ue=Z("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",le).replace("tag",ce).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),de=Z(oe).replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce).getRegex(),pe={blockquote:Z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",de).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:ie,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:te,html:ue,lheading:re,list:ae,newline:/^(?: *(?:\n|$))+/,paragraph:de,table:Q,text:/^[^\n]+/},fe=Z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce).getRegex(),he={...pe,table:fe,paragraph:Z(oe).replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",fe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ce).getRegex()},me={...pe,html:Z("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",le).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Q,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Z(oe).replace("hr",te).replace("heading"," *#{1,6} *[^\n]").replace("lheading",re).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ge=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,be=/^( {2,}|\\)\n(?!\s*$)/,we="\\p{P}\\p{S}",ye=Z(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,we).getRegex(),ve=Z(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,we).getRegex(),ke=Z("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,we).getRegex(),xe=Z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,we).getRegex(),$e=Z(/\\([punct])/,"gu").replace(/punct/g,we).getRegex(),_e=Z(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ee=Z(le).replace("(?:--\x3e|$)","--\x3e").getRegex(),Se=Z("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ee).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ce=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Le=Z(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Ce).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ae=Z(/^!?\[(label)\]\[(ref)\]/).replace("label",Ce).replace("ref",se).getRegex(),Te=Z(/^!?\[(ref)\](?:\[\])?/).replace("ref",se).getRegex(),Re={_backpedal:Q,anyPunctuation:$e,autolink:_e,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:be,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Q,emStrongLDelim:ve,emStrongRDelimAst:ke,emStrongRDelimUnd:xe,escape:ge,link:Le,nolink:Te,punctuation:ye,reflink:Ae,reflinkSearch:Z("reflink|nolink(?!\\()","g").replace("reflink",Ae).replace("nolink",Te).getRegex(),tag:Se,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:Q},Ne={...Re,link:Z(/^!?\[(label)\]\((.*?)\)/).replace("label",Ce).getRegex(),reflink:Z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ce).getRegex()},je={...Re,escape:Z(ge).replace("])","~|])").getRegex(),url:Z(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Pe={...je,br:Z(be).replace("{2,}","*").getRegex(),text:Z(je.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ie={normal:pe,gfm:he,pedantic:me},Oe={normal:Re,gfm:je,breaks:Pe,pedantic:Ne};class ze{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||O,this.options.tokenizer=this.options.tokenizer||new ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Ie.normal,inline:Oe.normal};this.options.pedantic?(t.block=Ie.pedantic,t.inline=Oe.pedantic):this.options.gfm&&(t.block=Ie.gfm,this.options.breaks?t.inline=Oe.breaks:t.inline=Oe.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ie,inline:Oe}}static lex(e,t){return new ze(t).lex(e)}static lexInline(e,t){return new ze(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){let n,r,o,s;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],s&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),s=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,s,i,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(c));)c=c.slice(0,s.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class De{options;constructor(e){this.options=e||O}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+H(r)+'">'+(n?e:H(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:H(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const r=K(e);if(null===r)return n;let o='<a href="'+(e=r)+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>",o}image(e,t,n){const r=K(e);if(null===r)return n;let o=`<img src="${e=r}" alt="${n}"`;return t&&(o+=` title="${t}"`),o+=">",o}text(e){return e}}class qe{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class Me{options;renderer;textRenderer;constructor(e){this.options=e||O,this.options.renderer=this.options.renderer||new De,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new qe}static parse(e,t){return new Me(t).parse(e)}static parseInline(e,t){return new Me(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const e=o,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(o.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=o;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,G(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=o;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=o;let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let s="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];r="";for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});s+=this.renderer.tablerow(r)}n+=this.renderer.table(t,s);continue}case"blockquote":{const e=o,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=o,t=e.ordered,r=e.start,s=e.loose;let i="";for(let t=0;t<e.items.length;t++){const n=e.items[t],r=n.checked,o=n.task;let a="";if(n.task){const e=this.renderer.checkbox(!!r);s?n.tokens.length>0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(n.tokens,s),i+=this.renderer.listitem(a,o,!!r)}n+=this.renderer.list(i,t,r);continue}case"html":{const e=o;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=o;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let s=o,i=s.tokens?this.parseInline(s.tokens):s.text;for(;r+1<e.length&&"text"===e[r+1].type;)s=e[++r],i+="\n"+(s.tokens?this.parseInline(s.tokens):s.text);n+=t?this.renderer.paragraph(i):i;continue}default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const e=this.options.extensions.renderers[o.type].call({parser:this},o);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=e||"";continue}}switch(o.type){case"escape":{const e=o;n+=t.text(e.text);break}case"html":{const e=o;n+=t.html(e.text);break}case"link":{const e=o;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=o;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=o;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=o;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=o;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=o;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=o;n+=t.text(e.text);break}default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class Be{options;constructor(e){this.options=e||O}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}const Fe=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(ze.lex,Me.parse);parseInline=this.#e(ze.lexInline,Me.parseInline);Parser=Me;Renderer=De;TextRenderer=qe;Lexer=ze;Tokenizer=ee;Hooks=Be;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{const o=e[r].flat(1/0);n=n.concat(this.walkTokens(o,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new De(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const r=n,o=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new ee(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,o=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new Be;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,o=e.hooks[r],s=t[r];Be.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(o.call(t,e)).then((e=>s.call(t,e)));const n=o.call(t,e);return s.call(t,n)}:t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ze.lex(e,t??this.defaults)}parser(e,t){return Me.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const o={...r},s={...this.defaults,...o};!0===this.defaults.async&&!1===o.async&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const i=this.#t(!!s.silent,!!s.async);if(null==n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then((t=>e(t,s))).then((e=>s.hooks?s.hooks.processAllTokens(e):e)).then((e=>s.walkTokens?Promise.all(this.walkTokens(e,s.walkTokens)).then((()=>e)):e)).then((e=>t(e,s))).then((e=>s.hooks?s.hooks.postprocess(e):e)).catch(i);try{s.hooks&&(n=s.hooks.preprocess(n));let r=e(n,s);s.hooks&&(r=s.hooks.processAllTokens(r)),s.walkTokens&&this.walkTokens(r,s.walkTokens);let o=t(r,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(e){return i(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+H(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function We(e,t){return Fe.parse(e,t)}function He(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}We.options=We.setOptions=function(e){return Fe.setOptions(e),We.defaults=Fe.defaults,z(We.defaults),We},We.getDefaults=I,We.defaults=O,We.use=function(...e){return Fe.use(...e),We.defaults=Fe.defaults,z(We.defaults),We},We.walkTokens=function(e,t){return Fe.walkTokens(e,t)},We.parseInline=Fe.parseInline,We.Parser=Me,We.parser=Me.parse,We.Renderer=De,We.TextRenderer=qe,We.Lexer=ze,We.lexer=ze.lex,We.Tokenizer=ee,We.Hooks=Be,We.parse=We,We.options,We.setOptions,We.use,We.walkTokens,We.parseInline,Me.parse,ze.lex;var Ue,Ge={exports:{}};var Ve,Ze=(Ue||(Ue=1,Ve=Ge,function(e,t){Ve.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function s(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(t[0],(function(n,r){var o,s,a=(o=t[1],s=arguments,o.replace(/\$(\d{1,2})/g,(function(e,t){return s[t]||""})));return i(""===n?e[r-1]:n,a)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var s=r[o];if(s[0].test(t))return a(t,s)}return t}function l(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?i(r,o):e.hasOwnProperty(o)?i(r,e[o]):c(o,r,n)}}function u(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(o,o,n)===o}}function d(e,t,n){return(n?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=l(o,r,e),d.isPlural=u(o,r,e),d.singular=l(r,o,t),d.isSingular=u(r,o,t),d.addPluralRule=function(t,n){e.push([s(t),n])},d.addSingularRule=function(e,n){t.push([s(e),n])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},d.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),o[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return d.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return d.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return d.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eĆ©]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d}))),Ge.exports),Ke=He(Ze),Qe=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=s.prototype;return o.delete=function(e){return this.has(e)&&delete e[this._]},o.get=function(e){return this.has(e)?e[this._]:void 0},o.has=function(e){return r.call(e,this._)},o.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},s;function s(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(i,this)}function i(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=o.prototype;function o(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=o}(Math.random(),Object.defineProperty)}function o(e,t,n,r,o,s){for(var i=("selectedIndex"in t),a=i;r<o;){var c,l=e(n[r],1);t.insertBefore(l,s),i&&a&&l.selected&&(a=!a,c=t.selectedIndex,t.selectedIndex=c<0?r:d.call(t.querySelectorAll("option"),l)),r++}}function s(e,t){return e==t}function i(e){return e}function a(e,t,n,r,o,s,i){var a=s-o;if(a<1)return-1;for(;a<=n-t;){for(var c=t,l=o;c<n&&l<s&&i(e[c],r[l]);)c++,l++;if(l===s)return t;t=c+1}return-1}function c(e,t,n,r,o){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:o}function l(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,o=t;r<o;){var s=(r+o)/2>>>0;n<e[s]?o=s:r=1+s}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||s,d=r.node||i,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,w=0;g<m&&w<b&&u(t[g],n[w]);)g++,w++;for(;g<m&&w<b&&u(t[m-1],n[b-1]);)m--,b--;var y=g===m,v=w===b;if(y&&v)return n;if(y&&w<b)return o(d,e,n,w,b,c(d,t,g,h,f)),n;if(v&&g<m)return l(d,t,g,m),n;var k=m-g,x=b-w,$=-1;if(k<x){if(-1<($=a(n,w,b,t,g,m,u)))return o(d,e,n,w,$,d(t[g],0)),o(d,e,n,$+k,b,c(d,t,m,h,f)),n}else if(x<k&&-1<($=a(t,g,m,n,w,b,u)))return l(d,t,g,$),l(d,t,$+x,m),n;return k<2||x<2?(o(d,e,n,w,b,d(t[g],0)),l(d,t,g,m)):k==x&&function(e,t,n,r,o,s){for(;r<o&&s(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?o(d,e,n,w,b,c(d,t,m,h,f)):function(e,t,n,r,s,i,a,c,u,d,f,h,m){!function(e,t,n,r,s,i,a,c,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:s++,f++;break;case 1:d.push(r[s]),o(t,n,r,s++,s,f<c?t(i[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(i[a])?a++:l(t,i,a++,a)}}(function(e,t,n,r,o,s,i){var a,c,l,u,d,p,f=n+s,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(c=(l=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;l<s&&c<n&&i(r[o+l],e[t+c]);)l++,c++;if(l===s&&c===n)break e;d[b+a]=l}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<l&&0<c&&i(r[o+l-1],e[t+c-1]);)m[g--]=0,l--,c--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=l-c)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(c--,m[g--]=1):(l--,m[g--]=-1)}return m}(n,r,i,a,c,d,h)||function(e,t,n,r,o,s,i,a){var c=0,l=r<a?r:a,u=Array(l++),d=Array(l);d[0]=-1;for(var f=1;f<l;f++)d[f]=i;for(var h=o.slice(s,i),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(c=p(d,l,g=b+s))&&(d[c]=g,u[c]={newi:m,oldi:g,prev:u[c-1]})}for(c=--l,--i;d[c]>i;)--c;l=a+r-c;var w=Array(l),y=u[c];for(--n;y;){for(var v=y.newi,k=y.oldi;v<n;)w[--l]=1,--n;for(;k<i;)w[--l]=-1,--i;w[--l]=0,--n,--i,y=y.prev}for(;t<=n;)w[--l]=1,--n;for(;s<=i;)w[--l]=-1,--i;return w}(n,r,s,i,a,c,u,d),e,t,n,r,a,c,f,m)}(d,e,n,w,b,x,t,g,m,k,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,w={};try{w.Map=Map}catch(u){w.Map=function(){var e=0,t=[],n=[];return{delete:function(o){var s=r(o);return s&&(t.splice(e,1),n.splice(e,1)),s},forEach:function(e,r){t.forEach((function(t,o){e.call(r,n[o],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(o,s){return n[r(o)?e:t.push(o)-1]=s,this}};function r(n){return-1<(e=t.indexOf(n))}}}var y=w.Map;function v(){return this}function k(e,t){var n="_"+e+"$";return{get:function(){return this[n]||x(this,n,t.call(this,e))},set:function(e){x(this,n,e)}}}var x=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var $,_,E,S,C,L,A={},T={},R=[],N=T.hasOwnProperty,j=0,P={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in T||(j=R.push(e)),T[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<j;n++){var r=R[n];if(N.call(e,r))return T[r](e[r],t)}}},I=Array.isArray||(_=($={}.toString).call([]),function(e){return $.call(e)===_}),O=(E=e,S="fragment",L="content"in D(C="template")?function(e){var t=D(C);return t.innerHTML=e,t.content}:function(e){var t,n=D(S),r=D(C);return z(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=D(S),n=D("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",z(t,n.firstChild.childNodes),t}:L)(e)});function z(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function D(e){return e===S?E.createDocumentFragment():E.createElementNS("http://www.w3.org/1999/xhtml",e)}var q,M,B,F,W,H,U,G,V,Z=(M="appendChild",B="cloneNode",F="createTextNode",H=(W="importNode")in(q=e),(U=q.createDocumentFragment())[M](q[F]("g")),U[M](q[F]("")),(H?q[W](U,!0):U[B](!0)).childNodes.length<2?function e(t,n){for(var r=t[B](),o=t.childNodes||[],s=o.length,i=0;n&&i<s;i++)r[M](e(o[i],n));return r}:H?q[W]:function(e,t){return e[B](!!t)}),K="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Q="-"+Math.random().toFixed(6)+"%",J=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Q+'"></p>',G.content.childNodes[0].getAttribute(V)==Q)||(Q="_dt: "+Q.slice(1,-1)+";",J=!0)}catch(u){}var X="\x3c!--"+Q+"--\x3e",Y=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,oe=" \\f\\n\\r\\t",se="[^"+oe+"\\/>\"'=]+",ie="["+oe+"]+"+se,ae="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ce="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+se.replace("\\/","")+"))?)",le=new RegExp(ae+ie+ce+"+)(["+oe+"]*/?>)","g"),ue=new RegExp(ae+ie+ce+"*)(["+oe+"]*/>)","g"),de=new RegExp("("+ie+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function pe(e,t,n,r){return"<"+t+n.replace(de,fe)+r}function fe(e,t,n){return t+(n||'"')+Q+(n||'"')}function he(e,t,n){return re.test(t)?e:"<"+t+n+"></"+t+">"}var me=J?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function ge(t,n,r,o){for(var s=t.childNodes,i=s.length,a=0;a<i;){var c=s[a];switch(c.nodeType){case ee:var l=o.concat(a);!function(t,n,r,o){for(var s,i=t.attributes,a=[],c=[],l=me(i,r),u=l.length,d=0;d<u;){var p=l[d++],f=p.value===Q;if(f||1<(s=p.value.split(X)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=i[m]||i[m.toLowerCase()];if(f)n.push(be(g,o,m,null));else{for(var b=s.length-2;b--;)r.shift();n.push(be(g,o,m,s))}}c.push(p)}}for(var w=((d=0)<(u=c.length)&&J&&!("ownerSVGElement"in t));d<u;){var y=c[d++];w&&(y.value=""),t.removeAttribute(y.name)}var v=t.nodeName;if(/^script$/i.test(v)){var k=e.createElement(v);for(u=i.length,d=0;d<u;)k.setAttributeNode(i[d++].cloneNode(!0));k.textContent=t.textContent,t.parentNode.replaceChild(k,t)}}(c,n,r,l),ge(c,n,r,l);break;case Y:var u=c.textContent;if(u===Q)r.shift(),n.push(ne.test(t.nodeName)?we(t,o):{type:"any",node:c,path:o.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"šŸ‘»":t.removeChild(c),a--,i--}break;case te:ne.test(t.nodeName)&&K.call(c.textContent)===X&&(r.shift(),n.push(we(t,o)))}a++}}function be(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function we(e,t){return{type:"text",node:e,path:t}}var ye,ve=(ye=new n,{get:function(e){return ye.get(e)},set:function(e,t){return ye.set(e,t),t}});function ke(e,t){var n=(e.convert||function(e){return e.join(X).replace(ue,he).replace(le,pe)})(t),r=e.transform;r&&(n=r(n));var o=O(n,e.type);$e(o);var s=[];return ge(o,s,t.slice(0),[]),{content:o,updates:function(n){for(var r=[],o=s.length,i=0,a=0;i<o;){var c=s[i++],l=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,c.path);switch(c.type){case"any":r.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var u=c.sparse,d=e.attribute(l,c.name,c.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return o+=a,function(){var e=arguments.length;if(o!==e-1)throw new Error(e-1+" values instead of "+o+"\n"+t.join("${value}"));for(var s=1,i=1;s<e;){var a=r[s-i];if(a.sparse){var c=a.values,l=c[0],u=1,d=c.length;for(i+=d-2;u<d;)l+=arguments[s++]+c[u++];a.fn(l)}else a.fn(arguments[s++])}return n}}}}var xe=[];function $e(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===K.call(r.textContent).length&&e.removeChild(r)}}var _e,Ee,Se=(_e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Ee=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Le(n,!0)}(e,t):Le(e.style,!1)});function Ce(e,t,n){return t+"-"+n.toLowerCase()}function Le(e,t){var n,r;return function(o){var s,i,a,c;switch(typeof o){case"object":if(o){if("object"===n){if(!t&&r!==o)for(i in r)i in o||(e[i]="")}else t?e.value="":e.cssText="";for(i in s=t?{}:e,o)a="number"!=typeof(c=o[i])||_e.test(i)?c:c+"px",!t&&/^--/.test(i)?s.setProperty(i,a):s[i]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Ee,Ce),":",e[t],";");return n.join("")}(r=s):r=o;break}default:r!=o&&(n="string",r=o,t?e.value=o||"":e.cssText=o||"")}}}var Ae,Te,Re=(Ae=[].slice,(Te=Ne.prototype).ELEMENT_NODE=1,Te.nodeType=111,Te.remove=function(e){var t,n=this.childNodes,r=this.firstChild,o=this.lastChild;return this._=null,e&&2===n.length?o.parentNode.removeChild(o):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(o),t.deleteContents()),r},Te.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,o=0,s=r.length;o<s;o++)t.appendChild(r[o]);return t},Ne);function Ne(e){var t=this.childNodes=Ae.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function je(e){return{html:e}}function Pe(e,t){switch(e.nodeType){case He:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case We:return Pe(e.render(),t);default:return e}}function Ie(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(je).then(t):Promise.resolve(P.invoke(e,t)).then(t)}function Oe(e){return null!=e&&"then"in e}var ze,De,qe,Me,Be,Fe="ownerSVGElement",We=v.prototype.nodeType,He=Re.prototype.nodeType,Ue=(De=(ze={Event:b,WeakSet:u}).Event,qe=ze.WeakSet,Me=!0,Be=null,function(e){return Me&&(Me=!Me,Be=new qe,function(e){var t=new qe,n=new qe;try{new MutationObserver(i).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,o=[],s=function(e){o.push(e),clearTimeout(r),r=setTimeout((function(){i(o.splice(r=0,o.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){s({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){s({addedNodes:[e.target],removedNodes:[]})}),!0)}function i(e){for(var r,o=e.length,s=0;s<o;s++)a((r=e[s]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var o,s=new De(t),i=e.length,a=0;a<i;1===(o=e[a++]).nodeType&&function e(t,n,r,o,s){Be.has(t)&&!o.has(t)&&(s.delete(t),o.add(t),t.dispatchEvent(n));for(var i=t.children||[],a=i.length,c=0;c<a;e(i[c++],n,r,o,s));}(o,s,t,n,r));}}(e.ownerDocument)),Be.add(e),e}),Ge=/^(?:form|list)$/i,Ve=[].slice;function Ze(t){return this.type=t,function(t){var n=xe,r=$e;return function(o){var s,i,a;return n!==o&&(s=t,i=n=o,a=ve.get(i)||ve.set(i,ke(s,i)),r=a.updates(Z.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ke=!(Ze.prototype={attribute:function(e,t,n){var r,o=Fe in e;if("style"===t)return Se(e,n,o);if("."===t.slice(0,1))return l=e,u=t.slice(1),o?function(e){try{l[u]=e}catch(t){l.setAttribute(u,e)}}:function(e){l[u]=e};if("?"===t.slice(0,1))return i=e,a=t.slice(1),function(e){c!==!!e&&((c=!!e)?i.setAttribute(a,""):i.removeAttribute(a))};if(/^on/.test(t)){var s=t.slice(2);return"connected"===s||"disconnected"===s?Ue(e):t.toLowerCase()in e&&(s=s.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(s,r,!1),(r=t)&&e.addEventListener(s,t,!1))}}if("data"===t||!o&&t in e&&!Ge.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in P.attributes)return function(n){var o=P.attributes[t](e,n);r!==o&&(null==(r=o)?e.removeAttribute(t):e.setAttribute(t,o))};var i,a,c,l,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Pe,before:e},o=Fe in e?"svg":"html",s=!1;return function i(a){switch(typeof a){case"string":case"number":case"boolean":s?n!==a&&(n=a,t[0].textContent=a):(s=!0,n=a,t=h(e.parentNode,t,[(c=a,e.ownerDocument.createTextNode(c))],r));break;case"function":i(a(e));break;case"object":case"undefined":if(null==a){s=!1,t=h(e.parentNode,t,[],r);break}default:if(s=!1,I(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":i({html:a});break;case"object":if(I(a[0])&&(a=a.concat.apply([],a)),Oe(a[0])){Promise.all(a).then(i);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Ve.call(a.childNodes):[a],r):Oe(a)?a.then(i):"placeholder"in a?Ie(a,i):"text"in a?i(String(a.text)):"any"in a?i(a.any):"html"in a?t=h(e.parentNode,t,Ve.call(O([].concat(a.html).join(""),o).childNodes),r):i("length"in a?Ve.call(a):P.invoke(a,i))}var c}},text:function(e){var t;return function n(r){var o;t!==r&&("object"==(o=typeof(t=r))&&r?Oe(r)?r.then(n):"placeholder"in r?Ie(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Ve.call(r).join(""):P.invoke(r,n)):"function"==o?n(r(e)):e.textContent=null==r?"":r)}}}),Qe=function(t){var r,o,s,i,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),c=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||c?(o={},s=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return o[t]||(o[t]=e)},Qe=c?s:(i=new n,function(e){return i.get(e)||(n=s(t=e),i.set(t,n),n);var t,n})):Ke=!0,Je(t)};function Je(e){return Ke?e:Qe(e)}function Xe(e){for(var t=arguments.length,n=[Je(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ye=new n,et=function(e){var t,n,r;return function(){var o=Xe.apply(null,arguments);return r!==o[0]?(r=o[0],n=new Ze(e),t=nt(n.apply(n,o))):n.apply(n,o),t}},tt=function(e,t){var n=t.indexOf(":"),r=Ye.get(e),o=t;return-1<n&&(o=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ye.set(e,r={}),r[o]||(r[o]=et(t))},nt=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Re(t):e},rt=new n;function ot(){var e=rt.get(this),t=Xe.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ze(Fe in this?"svg":"html");rt.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,it,at,ct,lt=P.define,ut=Ze.prototype;function dt(e){return arguments.length<2?null==e?et("html"):"string"==typeof e?dt.wire(null,e):"raw"in e?et("html")(e):"nodeType"in e?dt.bind(e):tt(e,"html"):("raw"in e?et("html"):dt.wire).apply(null,arguments)}return dt.Component=v,dt.bind=function(e){return ot.bind(e)},dt.define=lt,dt.diff=h,(dt.hyper=dt).observe=Ue,dt.tagger=ut,dt.wire=function(e,t){return null==e?et(t||"html"):tt(e,t||"html")},dt._={WeakMap:n,WeakSet:u},st=et,it=new n,at=Object.create,ct=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,o){var s,i,a,c=t.get(e)||ct(e,t);switch(typeof o){case"object":case"function":var l=c.w||(c.w=new n);return l.get(o)||(s=l,i=o,a=new e(r),s.set(i,a),a);default:var u=c.p||(c.p=at(null));return u[o]||(u[o]=new e(r))}}(this,it.get(e)||(r=e,o=new y,it.set(r,o),o),e,null==t?"default":t);var r,o}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:k("html",st),svg:k("svg",st),state:k("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var o in r)n[o]=r[o];return!1!==t&&this.render(),this}}}),dt}(document);const Je=Qe,Xe=T,Ye=We,et=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(e=e.trim(),!e)throw new TypeError("Invalid input.");let t="",n="",r="",o=null,s=new Map,i="type",a=Array.from(e);for(let e=0;e<a.length;e++){const c=a[e];switch(i){case"type":if("/"===c){i="subtype";continue}t+=c;break;case"subtype":if(";"===c){i="param-start";continue}n+=c;break;case"param-start":if(N.test(c)||";"===c)continue;r+=c,i="param-name";break;case"param-name":if("="===c||";"===c){if("="===c){i="param-value",o=null;continue}s.set(r.toLowerCase(),null),r="";continue}r+=c;break;case"param-value":if('"'==c){i="collect-quoted-string";continue}if(";"===c){o=o.trimEnd(),i="param-start",P(s,r,o),r="";continue}o="string"==typeof o?o+c:c;break;case"collect-quoted-string":if('"'===c){P(s,r,o),i="ignore-input-until-next-param",r="",o=null;continue}if("\\"===c)continue;o="string"==typeof o?o+c:c;break;case"ignore-input-until-next-param":if(";"!==c)continue;i="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${i} `)}}r&&P(s,r,o);if(""===t.trim()||!R.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!R.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(s.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?R.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},tt=Ke,nt=/-/g,rt=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"});"en"===s||s.startsWith("en-");const ot=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function st(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function it(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function at(e,t="long"){const n=new Intl.ListFormat(s,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:o})=>"element"===n&&t?t(o,r++,e):o))}}const ct=at("conjunction"),lt=at("disjunction");function ut(e,t){return ct(e,t).join("")}function dt(e){return e.trim().replace(/\s+/g," ")}function pt(e,t=s){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=function(e,t,n=s){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function ft(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){At(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace.",cause:e})}}}return e}function ht(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>Je`${e}, `));return Je`${r}${n[n.length-1]}`}function mt(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=r?n:n.toLowerCase();if(o=o.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),o?!/\.$/.test(o)&&/^[a-z]/i.test(t||o)||(o=`x${o}`):o="generatedID",t&&(o=`${t}-${o}`),e.ownerDocument.getElementById(o)){let t=0,n=`${o}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${o}-${t}`;o=n}return e.id=o,o}function gt(e){const t=new Set,n="ltNodefault"in e.dataset?"":dt(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>dt(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(dt(e))))}return[...t]}function bt(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function wt(e,t){const n=t.closest(ot);let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function yt(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function vt(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function kt(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class xt extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function $t(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{bt(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),_t(t),t}function _t(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Et(t)])e.remove()}function*Et(e){for(;e.nextNode();)yield e.currentNode}class St extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class Ct extends Error{constructor(e,t,n){super(e,{...n.cause&&{cause:n.cause}});const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||mt(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:s,title:i,details:a}=this;return{message:e,name:t,plugin:r,hint:o,elements:s,title:i,details:a,stack:n,...this.cause instanceof Error&&{cause:{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}}}}}function Lt(e,t,n={}){const r={...n,isWarning:!1};zt("error",new Ct(e,t,r))}function At(e,t,n={}){const r={...n,isWarning:!0};zt("warn",new Ct(e,t,r))}function Tt(e){return{showError:(t,n)=>Lt(t,e,n),showWarning:(t,n)=>At(t,e,n)}}function Rt(e){return e?`\`${e}\``:""}function Nt(e,{quotes:t}={quotes:!1}){return lt(e,t?e=>Rt(jt(e)):Rt).join("")}function jt(e){return String(e)?`"${e}"`:""}function Pt(e,...t){return It(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,s]=r.slice(1,-1).split("|");if(s){return`${e}[${o}](${new URL(s,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`})).join(""))}function It(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter((e=>e.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}const Ot=new EventTarget;function zt(e,t){if(Ot.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const n=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function Dt(e,t,n={once:!1}){Ot.addEventListener(e,(async n=>{try{await t(n.detail)}catch(t){Lt(`Error in handler for topic "${e}": ${t.message}`,`sub:${e}`,{cause:t})}}),n)}n("core/pubsubhub",{sub:Dt});const qt=["githubToken","githubUser"];const Mt=new Map([["text/html","html"],["application/xml","xml"]]);function Bt(e,t=document){const n=Mt.get(e);if(!n){const t=[...Mt.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Ft(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Ft(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;_t(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),it(r);const o=e.createDocumentFragment(),s=e.querySelector("meta[name='viewport']");s&&t.firstChild!==s&&o.appendChild(s);let i=e.querySelector("meta[charset], meta[content*='charset=']");i||(i=Je`<meta charset="utf-8" />`);o.appendChild(i);const a=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=Je` + <meta name="generator" content="${a}" /> + `;o.appendChild(c),t.prepend(o),zt("beforesave",r)}(n);let r="";if("xml"===e)r=(new XMLSerializer).serializeToString(n);else!function(e){e.querySelectorAll("style").forEach((e=>{e.innerHTML=`\n${e.innerHTML}\n`})),e.querySelectorAll("head > *").forEach((e=>{e.outerHTML=`\n${e.outerHTML}`}))}(n),n.doctype&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML;return r}n("core/exporter",{rsDocToDataURL:Bt});class Wt{constructor(){this._respecDonePromise=new Promise((e=>{Dt("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],Dt("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),Dt("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return Ft("html",document)}}const Ht="core/post-process";const Ut="core/pre-process";const Gt="core/base-runner";async function Vt(e){!function(){const e=new Wt;Object.defineProperty(document,"respec",{value:e})}(),zt("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),Dt("amend-user-config",n),Dt("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of qt)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)}))}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter((([e,t])=>!!e&&!!t)).map((([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let o;try{o=JSON.parse(r)}catch{o=r}return[n,o]})),r=Object.fromEntries(n);Object.assign(e,r),zt("amend-user-config",r)}(respecConfig),performance.mark(`${Gt}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Lt("Every item in `preProcess` must be a JS function.",Ut),t})).map((async(t,n)=>{const r=Tt(`${Ut}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){Lt(`Function ${t.name} threw an error during \`preProcess\`.`,Ut,{hint:"See developer console.",cause:e})}}));await Promise.all(t)}}(respecConfig);const t=e.filter((e=>{return(t=e)&&(t.run||t.Plugin);var t}));t.forEach((e=>!e.name&&console.warn("Plugin lacks name:",e))),await async function(e,t){for(const n of e.filter((e=>e.prepare)))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise((async(r,o)=>{const s=setTimeout((()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),o(new Error(t))}),15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){o(e)}finally{clearTimeout(s),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}}))}catch(e){console.error(e)}}}(t,respecConfig),zt("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter((e=>{const t="function"==typeof e;return t||Lt("Every item in `postProcess` must be a JS function.",Ht),t})).map((async(t,n)=>{const r=Tt(`${Ht}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){Lt(`Function ${t.name} threw an error during \`postProcess\`.`,Ht,{hint:"See developer console.",cause:e})}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),zt("end-all"),it(document),performance.mark(`${Gt}-end`),performance.measure(Gt,`${Gt}-start`,`${Gt}-end`)}var Zt=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} #respec-ui{position:fixed;display:flex;flex-direction:row-reverse;top:20px;right:20px;width:202px;text-align:right;z-index:9000} #respec-pill,.respec-info-button{height:2.4em;background:#fff;background:var(--bg,#fff);color:#787878;color:var(--tocnav-normal-text,#787878);border:1px solid #ccc;box-shadow:1px 1px 8px 0 rgba(100,100,100,.5);box-shadow:1px 1px 8px 0 var(--tocsidebar-shadow,rgba(100,100,100,.5));padding:.2em 0} .respec-info-button{border:none;opacity:.75;border-radius:2em;margin-right:1em;min-width:3.5em;will-change:opacity} @@ -64,37 +64,37 @@ to{margin-top:0;border:1px solid #ccc;border-radius:0;box-shadow:1px 1px 8px 0 r .respec-iframe:not(.ready){background:url(https://respec.org/xref/loader.gif) no-repeat center} .respec-iframe+a[href]{font-size:.9rem;float:right;margin:0 .5em .5em;border-bottom-width:1px} p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} -.respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const Vt=/>/gm,Zt=/&/gm;class Kt extends tt.Renderer{code(e,t,n){const{language:r,...o}=Kt.parseInfoString(t);if(/(^webidl$)/i.test(r))return`<pre class="idl">${e}</pre>`;const s=super.code(e,r,n).replace('class="language-','class="'),{example:i,illegalExample:a}=o;if(!i&&!a)return s;const c=i||a,l=`${r} ${i?"example":"illegal-example"}`;return s.replace("<pre>",`<pre title="${c}" class="${l}">`)}image(e,t,n){if(!t)return super.image(e,t,n);return String.raw` +.respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const Kt=/>/gm,Qt=/&/gm;class Jt extends Ye.Renderer{code(e,t,n){const{language:r,...o}=Jt.parseInfoString(t);if(/(^webidl$)/i.test(r))return`<pre class="idl">${e}</pre>`;const s=super.code(e,r,n).replace('class="language-','class="'),{example:i,illegalExample:a}=o;if(!i&&!a)return s;const c=i||a,l=`${r} ${i?"example":"illegal-example"}`;return s.replace("<pre>",`<pre title="${c}" class="${l}">`)}image(e,t,n){if(!t)return super.image(e,t,n);return String.raw` <figure> <img src="${e}" alt="${n}" /> <figcaption>${t}</figcaption> </figure> - `}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let o;if(r)try{o=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...o}}heading(e,t,n){const r=/(.+)\s+{#([\w-]+)}$/;if(r.test(e)){const[,n,o]=e.match(r);return`<h${t} id="${o}">${n}</h${t}>`}return super.heading(e,t,n)}}const Qt={gfm:!0,renderer:new Kt};function Jt(e,t={inline:!1}){const n=zt(e).replace(Vt,">").replace(Zt,"&");return t.inline?tt.parseInline(n,Qt):tt.parse(n,Qt)}function Xt(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=Jt(e.innerHTML)}const Yt=(en="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(en);return t.forEach(Xt),Array.from(t)});var en;var tn=Object.freeze({__proto__:null,markdownToHtml:Jt,name:"core/markdown",run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void Yt(document.body);const r=document.getElementById("respec-ui");r.remove();const o=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),o=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),o.trim()){const t=$t(e);e.append(`\n\n${t}`)}}}(o,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),Xt(o),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(o.querySelectorAll(".nolinks a[href]")),o.append(r),document.body.replaceWith(o)}});function nn(e,t){e&&Array.from(t).forEach((([t,n])=>{e.setAttribute(`aria-${t}`,n)}))}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=Gt,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const rn=Ye`<div id="respec-ui" class="removeOnSave" hidden></div>`,on=Ye`<ul + `}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let o;if(r)try{o=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...o}}heading(e,t,n){const r=/(.+)\s+{#([\w-]+)}$/;if(r.test(e)){const[,n,o]=e.match(r);return`<h${t} id="${o}">${n}</h${t}>`}return super.heading(e,t,n)}}const Xt={gfm:!0,renderer:new Jt};function Yt(e,t={inline:!1}){const n=It(e).replace(Kt,">").replace(Qt,"&");return t.inline?Ye.parseInline(n,Xt):Ye.parse(n,Xt)}function en(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=Yt(e.innerHTML)}const tn=(nn="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(nn);return t.forEach(en),Array.from(t)});var nn;var rn=Object.freeze({__proto__:null,markdownToHtml:Yt,name:"core/markdown",run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void tn(document.body);const r=document.getElementById("respec-ui");r.remove();const o=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),o=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),o.trim()){const t=kt(e);e.append(`\n\n${t}`)}}}(o,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),en(o),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(o.querySelectorAll(".nolinks a[href]")),o.append(r),document.body.replaceWith(o)}});function on(e,t){e&&Array.from(t).forEach((([t,n])=>{e.setAttribute(`aria-${t}`,n)}))}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=Zt,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const sn=Je`<div id="respec-ui" class="removeOnSave" hidden></div>`,an=Je`<ul id="respec-menu" role="menu" aria-labelledby="respec-pill" hidden -></ul>`,sn=Ye`<button +></ul>`,cn=Je`<button class="close-button" - onclick=${()=>bn.closeModal()} + onclick=${()=>yn.closeModal()} title="Close" > āŒ -</button>`;let an,cn;window.addEventListener("load",(()=>hn(on)));const ln=[],un=[],dn={};s("start-all",(()=>document.body.prepend(rn)),{once:!0}),s("end-all",(()=>document.body.prepend(rn)),{once:!0});const pn=Ye`<button id="respec-pill" disabled>ReSpec</button>`;function fn(){on.classList.toggle("respec-hidden"),on.classList.toggle("respec-visible"),on.hidden=!on.hidden}function hn(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",(e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))}))}rn.appendChild(pn),pn.addEventListener("click",(e=>{e.stopPropagation(),pn.setAttribute("aria-expanded",String(on.hidden)),fn(),on.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{on.hidden||fn()})),rn.appendChild(on),on.addEventListener("keydown",(e=>{"Escape"!==e.key||on.hidden||(pn.setAttribute("aria-expanded",String(on.hidden)),fn(),pn.focus())}));const mn=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function gn(e,t,n,r){t.push(e),dn.hasOwnProperty(n)||(dn[n]=function(e,t,n){const r=`respec-pill-${e}`,o=Ye`<button +</button>`;let ln,un;window.addEventListener("load",(()=>gn(an)));const dn=[],pn=[],fn={};Dt("start-all",(()=>document.body.prepend(sn)),{once:!0}),Dt("end-all",(()=>document.body.prepend(sn)),{once:!0});const hn=Je`<button id="respec-pill" disabled>ReSpec</button>`;function mn(){an.classList.toggle("respec-hidden"),an.classList.toggle("respec-visible"),an.hidden=!an.hidden}function gn(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",(e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))}))}sn.appendChild(hn),hn.addEventListener("click",(e=>{e.stopPropagation(),hn.setAttribute("aria-expanded",String(an.hidden)),mn(),an.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{an.hidden||mn()})),sn.appendChild(an),an.addEventListener("keydown",(e=>{"Escape"!==e.key||an.hidden||(hn.setAttribute("aria-expanded",String(an.hidden)),mn(),hn.focus())}));const bn=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function wn(e,t,n,r){t.push(e),fn.hasOwnProperty(n)||(fn[n]=function(e,t,n){const r=`respec-pill-${e}`,o=Je`<button id="${r}" class="respec-info-button" - ></button>`;o.addEventListener("click",(()=>{o.setAttribute("aria-expanded","true");const r=Ye`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(wn(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),r.appendChild(n)}bn.freshModal(n,r,o)}));const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return nn(o,s),o}(n,t,r),rn.appendChild(dn[n]));const o=dn[n];o.textContent=t.length;const s=1===t.length?rt.singular(r):r;nn(o,new Map([["label",`${t.length} ${s}`]]))}nn(pn,mn);const bn={show(){try{rn.hidden=!1}catch(e){console.error(e)}},hide(){rn.hidden=!0},enable(){pn.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,s=Ye`<button id="${o}" class="respec-option"> + ></button>`;o.addEventListener("click",(()=>{o.setAttribute("aria-expanded","true");const r=Je`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(vn(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),r.appendChild(n)}yn.freshModal(n,r,o)}));const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return on(o,s),o}(n,t,r),sn.appendChild(fn[n]));const o=fn[n];o.textContent=t.length;const s=1===t.length?tt.singular(r):r;on(o,new Map([["label",`${t.length} ${s}`]]))}on(hn,bn);const yn={show(){try{sn.hidden=!1}catch(e){console.error(e)}},hide(){sn.hidden=!0},enable(){hn.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,s=Je`<button id="${o}" class="respec-option"> <span class="respec-cmd-icon" aria-hidden="true">${r}</span> ${e}ā€¦ - </button>`,i=Ye`<li role="menuitem">${s}</li>`;return i.addEventListener("click",t),on.appendChild(i),s},error(e){gn(e,ln,"error","ReSpec Errors")},warning(e){gn(e,un,"warning","ReSpec Warnings")},closeModal(e){cn&&(cn.classList.remove("respec-show-overlay"),cn.classList.add("respec-hide-overlay"),cn.addEventListener("transitionend",(()=>{cn.remove(),cn=null}))),e&&e.setAttribute("aria-expanded","false"),an&&(an.remove(),an=null,pn.focus())},freshModal(e,t,n){an&&an.remove(),cn&&cn.remove(),cn=Ye`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,o=`${r}-heading`;an=Ye`<div + </button>`,i=Je`<li role="menuitem">${s}</li>`;return i.addEventListener("click",t),an.appendChild(i),s},error(e){wn(e,dn,"error","ReSpec Errors")},warning(e){wn(e,pn,"warning","ReSpec Warnings")},closeModal(e){un&&(un.classList.remove("respec-show-overlay"),un.classList.add("respec-hide-overlay"),un.addEventListener("transitionend",(()=>{un.remove(),un=null}))),e&&e.setAttribute("aria-expanded","false"),ln&&(ln.remove(),ln=null,hn.focus())},freshModal(e,t,n){ln&&ln.remove(),un&&un.remove(),un=Je`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,o=`${r}-heading`;ln=Je`<div id="${r}" class="respec-modal removeOnSave" role="dialog" aria-labelledby="${o}" > - ${sn} + ${cn} <h3 id="${o}">${e}</h3> <div class="inside">${t}</div> - </div>`;const s=new Map([["labelledby",o]]);nn(an,s),document.body.append(cn,an),cn.addEventListener("click",(()=>this.closeModal(n))),cn.classList.toggle("respec-show-overlay"),an.hidden=!1,hn(an)}};function wn(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${Jt(`<p class="respec-hint"><strong>How to fix:</strong> ${zt(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred <strong>${e.elements.length}</strong> times at:</p>\n ${Jt(e.elements.map(yn).join("\n"))}`:"",o=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";var s;return`${Jt(`**${s=e.message,s.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/</g,"<")}**`,{inline:!0})}${n}${r}${o}${t}`}function yn(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function vn(e){try{bn.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await Ut(e)}finally{bn.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&bn.closeModal()})),window.respecUI=bn,s("error",(e=>bn.error(e))),s("warn",(e=>bn.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const kn=[Promise.resolve().then((function(){return xn})),Promise.resolve().then((function(){return u})),Promise.resolve().then((function(){return Sn})),Promise.resolve().then((function(){return An})),Promise.resolve().then((function(){return Pn})),Promise.resolve().then((function(){return On})),Promise.resolve().then((function(){return Fn})),Promise.resolve().then((function(){return Qn})),Promise.resolve().then((function(){return tn})),Promise.resolve().then((function(){return Jn})),Promise.resolve().then((function(){return Xn})),Promise.resolve().then((function(){return ao})),Promise.resolve().then((function(){return wo})),Promise.resolve().then((function(){return yo})),Promise.resolve().then((function(){return $o})),Promise.resolve().then((function(){return Lo})),Promise.resolve().then((function(){return jo})),Promise.resolve().then((function(){return Oo})),Promise.resolve().then((function(){return Lr})),Promise.resolve().then((function(){return ts})),Promise.resolve().then((function(){return Go})),Promise.resolve().then((function(){return qr})),Promise.resolve().then((function(){return rs})),Promise.resolve().then((function(){return Gn})),Promise.resolve().then((function(){return os})),Promise.resolve().then((function(){return ps})),Promise.resolve().then((function(){return hs})),Promise.resolve().then((function(){return gs})),Promise.resolve().then((function(){return bs})),Promise.resolve().then((function(){return xs})),Promise.resolve().then((function(){return Ss})),Promise.resolve().then((function(){return Ns})),Promise.resolve().then((function(){return js})),Promise.resolve().then((function(){return Ms})),Promise.resolve().then((function(){return Vs})),Promise.resolve().then((function(){return Xs})),Promise.resolve().then((function(){return oi})),Promise.resolve().then((function(){return ii})),Promise.resolve().then((function(){return hi})),Promise.resolve().then((function(){return bi})),Promise.resolve().then((function(){return wi})),Promise.resolve().then((function(){return ki})),Promise.resolve().then((function(){return Ei})),Promise.resolve().then((function(){return Ai})),Promise.resolve().then((function(){return Ni})),Promise.resolve().then((function(){return Ii})),Promise.resolve().then((function(){return Di})),Promise.resolve().then((function(){return Bi}))];Promise.all(kn).then((e=>vn(e))).catch((e=>console.error(e)));var xn=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){window.location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(window.location.hash).slice(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}window.location.hash=`#${e}`}))}});const $n={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},_n=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["cc-by-nd",{name:"Creative Commons Attribution-NoDerivatives 4.0 International Public License",short:"CC-BY-ND",url:"https://creativecommons.org/licenses/by-nd/4.0/legalcode.nl"}]]),En={lint:{"privsec-section":!0},doJsonLd:!0,license:"cc-by",specStatus:"GN-BASIS",logos:[{src:"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg",alt:"Geonovum",id:"Geonovum",height:67,width:132,url:"https://www.geonovum.nl/"}]};var Sn=Object.freeze({__proto__:null,name:"geonovum/defaults",run:function(e){const t=!1!==e.lint&&{...$n.lint,...En.lint,...e.lint};Object.assign(e,{...$n,...En,...e,lint:t}),Object.assign(e,function(e){return{isCCBY:"cc-by"===e.license,licenseInfo:_n.get(e.license),isBasic:"GN-BASIS"===e.specStatus,isRegular:"GN-BASIS"===e.specStatus}}(e))}});var Cn=String.raw`@keyframes pop{ + </div>`;const s=new Map([["labelledby",o]]);on(ln,s),document.body.append(un,ln),un.addEventListener("click",(()=>this.closeModal(n))),un.classList.toggle("respec-show-overlay"),ln.hidden=!1,gn(ln)}};function vn(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${Yt(`<p class="respec-hint"><strong>How to fix:</strong> ${It(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred <strong>${e.elements.length}</strong> times at:</p>\n ${Yt(e.elements.map(kn).join("\n"))}`:"",o=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";var s;return`${Yt(`**${s=e.message,s.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/</g,"<")}**`,{inline:!0})}${n}${r}${o}${t}`}function kn(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function xn(e){try{yn.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await Vt(e)}finally{yn.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&yn.closeModal()})),window.respecUI=yn,Dt("error",(e=>yn.error(e))),Dt("warn",(e=>yn.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const $n=[Promise.resolve().then((function(){return _n})),Promise.resolve().then((function(){return i})),Promise.resolve().then((function(){return Ln})),Promise.resolve().then((function(){return Rn})),Promise.resolve().then((function(){return On})),Promise.resolve().then((function(){return Dn})),Promise.resolve().then((function(){return Hn})),Promise.resolve().then((function(){return Xn})),Promise.resolve().then((function(){return rn})),Promise.resolve().then((function(){return Yn})),Promise.resolve().then((function(){return er})),Promise.resolve().then((function(){return lo})),Promise.resolve().then((function(){return vo})),Promise.resolve().then((function(){return ko})),Promise.resolve().then((function(){return Eo})),Promise.resolve().then((function(){return To})),Promise.resolve().then((function(){return Io})),Promise.resolve().then((function(){return Do})),Promise.resolve().then((function(){return Tr})),Promise.resolve().then((function(){return rs})),Promise.resolve().then((function(){return Zo})),Promise.resolve().then((function(){return Br})),Promise.resolve().then((function(){return ss})),Promise.resolve().then((function(){return Zn})),Promise.resolve().then((function(){return is})),Promise.resolve().then((function(){return hs})),Promise.resolve().then((function(){return gs})),Promise.resolve().then((function(){return ws})),Promise.resolve().then((function(){return ys})),Promise.resolve().then((function(){return _s})),Promise.resolve().then((function(){return Ls})),Promise.resolve().then((function(){return Ps})),Promise.resolve().then((function(){return Is})),Promise.resolve().then((function(){return Fs})),Promise.resolve().then((function(){return Ks})),Promise.resolve().then((function(){return ei})),Promise.resolve().then((function(){return ii})),Promise.resolve().then((function(){return ci})),Promise.resolve().then((function(){return gi})),Promise.resolve().then((function(){return yi})),Promise.resolve().then((function(){return vi})),Promise.resolve().then((function(){return $i})),Promise.resolve().then((function(){return Ci})),Promise.resolve().then((function(){return Ri})),Promise.resolve().then((function(){return Pi})),Promise.resolve().then((function(){return zi})),Promise.resolve().then((function(){return Mi})),Promise.resolve().then((function(){return Wi}))];Promise.all($n).then((e=>xn(e))).catch((e=>console.error(e)));var _n=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){window.location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(window.location.hash).slice(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}window.location.hash=`#${e}`}))}});const En={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},Sn=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["cc-by-nd",{name:"Creative Commons Attribution-NoDerivatives 4.0 International Public License",short:"CC-BY-ND",url:"https://creativecommons.org/licenses/by-nd/4.0/legalcode.nl"}]]),Cn={lint:{"privsec-section":!0},doJsonLd:!0,license:"cc-by",specStatus:"GN-BASIS",logos:[{src:"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg",alt:"Geonovum",id:"Geonovum",height:67,width:132,url:"https://www.geonovum.nl/"}]};var Ln=Object.freeze({__proto__:null,name:"geonovum/defaults",run:function(e){const t=!1!==e.lint&&{...En.lint,...Cn.lint,...e.lint};Object.assign(e,{...En,...Cn,...e,lint:t}),Object.assign(e,function(e){return{isCCBY:"cc-by"===e.license,licenseInfo:Sn.get(e.license),isBasic:"GN-BASIS"===e.specStatus,isRegular:"GN-BASIS"===e.specStatus}}(e))}});var An=String.raw`@keyframes pop{ 0%{transform:scale(1,1)} 25%{transform:scale(1.25,1.25);opacity:.75} 100%{transform:scale(1,1)} @@ -135,74 +135,74 @@ dd{margin-left:0} } @media print{ .removeOnSave{display:none} -}`;const Ln=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Cn,document.head.appendChild(e),e}();var An=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Ln.remove()}});const Tn="geonovum/style";function Rn(e){const t=document.createElement("link");return t.rel="stylesheet",t.href=`https://tools.geostandaarden.nl/respec/style/${e}.css`,t}const Nn=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2016/fixup.js",as:"script"},{hint:"preconnect",href:"https://tools.geostandaarden.nl/"},{hint:"preload",href:"https://tools.geostandaarden.nl/respec/style/base.css",as:"style"},{hint:"preload",href:"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg",as:"image"}],t=document.createDocumentFragment();for(const n of e.map(at))t.appendChild(n);return t}(),jn=document.createElement("link");jn.rel="shortcut icon",jn.type="image/x-icon",jn.href="https://tools.geostandaarden.nl/respec/style/logos/Geonovum.ico",document.head.prepend(jn),document.head.querySelector("meta[name=viewport]")||Nn.prepend(function(){const e=document.createElement("meta");return e.name="viewport",e.content=function(e,t=", ",n="="){return Array.from(Object.entries(e)).map((([e,t])=>`${e}${n}${JSON.stringify(t)}`)).join(t)}({width:"device-width","initial-scale":"1","shrink-to-fit":"no"}).replace(/"/g,""),e}()),document.head.prepend(Nn);var Pn=Object.freeze({__proto__:null,name:Tn,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'GN-BASIS'.";e.specStatus="GN-BASIS",Rt(t,Tn)}document.body.querySelector("figure.scalable")&&(document.head.appendChild(Rn("leaflet")),document.head.appendChild(Rn("font-awesome")));let t="";switch(e.specStatus.toUpperCase()){case"GN-WV":t+="GN-WV.css";break;case"GN-CV":t+="GN-CV.css";break;case"GN-VV":t+="GN-VV.css";break;case"GN-DEF":t+="GN-DEF.css";break;case"GN-BASIS":t+="GN-BASIS.css";break;default:t="base.css"}e.noToc||s("end-all",(()=>{!function(e,t){const n=e.createElement("script");n.addEventListener("load",(()=>{window.location.hash&&(window.location.href=window.location.hash)}),{once:!0}),n.src=`https://www.w3.org/scripts/TR/${t}/fixup.js`,e.body.appendChild(n)}(document,"2016")}),{once:!0}),function(e,t){const n=[].concat(t).map((t=>{const n=e.createElement("link");return n.rel="stylesheet",n.href=t,n})).reduce(((e,t)=>(e.appendChild(t),e)),e.createDocumentFragment());e.head.appendChild(n)}(document,`https://tools.geostandaarden.nl/respec/style/${t}`)}});const In={en:{status_at_publication:Ye`This section describes the status of this +}`;const Tn=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=An,document.head.appendChild(e),e}();var Rn=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Tn.remove()}});const Nn="geonovum/style";function jn(e){const t=document.createElement("link");return t.rel="stylesheet",t.href=`https://tools.geostandaarden.nl/respec/style/${e}.css`,t}const Pn=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2016/fixup.js",as:"script"},{hint:"preconnect",href:"https://tools.geostandaarden.nl/"},{hint:"preload",href:"https://tools.geostandaarden.nl/respec/style/base.css",as:"style"},{hint:"preload",href:"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg",as:"image"}],t=document.createDocumentFragment();for(const n of e.map(st))t.appendChild(n);return t}(),In=document.createElement("link");In.rel="shortcut icon",In.type="image/x-icon",In.href="https://tools.geostandaarden.nl/respec/style/logos/Geonovum.ico",document.head.prepend(In),document.head.querySelector("meta[name=viewport]")||Pn.prepend(function(){const e=document.createElement("meta");return e.name="viewport",e.content=function(e,t=", ",n="="){return Array.from(Object.entries(e)).map((([e,t])=>`${e}${n}${JSON.stringify(t)}`)).join(t)}({width:"device-width","initial-scale":"1","shrink-to-fit":"no"}).replace(/"/g,""),e}()),document.head.prepend(Pn);var On=Object.freeze({__proto__:null,name:Nn,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'GN-BASIS'.";e.specStatus="GN-BASIS",At(t,Nn)}document.body.querySelector("figure.scalable")&&(document.head.appendChild(jn("leaflet")),document.head.appendChild(jn("font-awesome")));let t="";switch(e.specStatus.toUpperCase()){case"GN-WV":t+="GN-WV.css";break;case"GN-CV":t+="GN-CV.css";break;case"GN-VV":t+="GN-VV.css";break;case"GN-DEF":t+="GN-DEF.css";break;case"GN-BASIS":t+="GN-BASIS.css";break;default:t="base.css"}e.noToc||Dt("end-all",(()=>{!function(e,t){const n=e.createElement("script");n.addEventListener("load",(()=>{window.location.hash&&(window.location.href=window.location.hash)}),{once:!0}),n.src=`https://www.w3.org/scripts/TR/${t}/fixup.js`,e.body.appendChild(n)}(document,"2016")}),{once:!0}),function(e,t){const n=[].concat(t).map((t=>{const n=e.createElement("link");return n.rel="stylesheet",n.href=t,n})).reduce(((e,t)=>(e.appendChild(t),e)),e.createDocumentFragment());e.head.appendChild(n)}(document,`https://tools.geostandaarden.nl/respec/style/${t}`)}});const zn={en:{status_at_publication:Je`This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current Geonovum publications and the latest revision of this document can be found via <a href="https://www.geonovum.nl/geo-standaarden/alle-standaarden" >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a - >(in Dutch).`},nl:{status_at_publication:Ye`Deze paragraaf beschrijft de status van dit + >(in Dutch).`},nl:{status_at_publication:Je`Deze paragraaf beschrijft de status van dit document ten tijde van publicatie. Het is mogelijk dat er actuelere versies van dit document bestaan. Een lijst van Geonovum publicaties en de laatste gepubliceerde versie van dit document zijn te vinden op <a href="https://www.geonovum.nl/geo-standaarden/alle-standaarden" >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a - >.`}};Object.keys(In).forEach((e=>{c[e]||(c[e]={}),Object.assign(c[e],In[e])}));var On=Object.freeze({__proto__:null,name:"geonovum/l10n"});const zn="core/github";let Dn,qn;const Mn=new Promise(((e,t)=>{Dn=e,qn=e=>{Tt(e,zn),t(new Error(e))}})),Bn=ht({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"ģ°øģ—¬"},zh:{file_a_bug:"反馈错čÆÆ",participate:"参äøŽļ¼š"},ja:{commit_history:"å¤‰ę›“å±„ę­“",file_a_bug:"問锌報告",participate:"å‚åŠ ę–¹ę³•ļ¼š"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});var Fn=Object.freeze({__proto__:null,github:Mn,name:zn,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void Dn(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=Ot`Config option ${"[github]"} is missing property \`repoURL\`.`;return void qn(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=Ot`${"[github]"} configuration option is not a valid URL? (${n}).`;return void qn(e)}if("https://github.com"!==t.origin){const e=Ot`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void qn(e)}const[r,o]=t.pathname.split("/").filter((e=>e));if(!r||!o){const e=Ot`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void qn(e)}const s=e.github.branch||"gh-pages",i=new URL("./issues/",t).href,a=new URL(`./commits/${e.github.branch??""}`,t.href),c={edDraftURI:`https://${r.toLowerCase()}.github.io/${o}/`,githubToken:void 0,githubUser:void 0,issueBase:i,atRiskBase:i,otherLinks:[],pullBase:new URL("./pulls/",t).href,shortName:o};let l="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)l=e.githubAPI;else{Rt("The `githubAPI` configuration option is private and should not be added manually.",zn)}if(!e.excludeGithubLinks){const n={key:Bn.participate,data:[{value:`GitHub ${r}/${o}`,href:t},{value:Bn.file_a_bug,href:c.issueBase},{value:Bn.commit_history,href:a.href},{value:"Pull requests",href:c.pullBase}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(n)}const u={branch:s,repoURL:t.href,apiBase:l,fullName:`${r}/${o}`,issuesURL:i,pullsURL:c.pullBase,newIssuesURL:new URL("./new/choose",i).href,commitHistoryURL:a.href};Dn(u);const d={...c,...e,github:u,githubAPI:l};Object.assign(e,d)}});class Wn{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(Hn(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function Hn(e){const t=new Wn(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function Un(e){const t=Hn(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var Gn=Object.freeze({__proto__:null,name:"core/sections",restructure:Un,run:function(){Un(document.body)}});const Vn="core/data-include";function Zn(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=mt(e,r.dataset.oninclude,n),s="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let o=t;"markdown"===r&&(o=Jt(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&Un(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:s}),s||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function Kn(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const o=await fetch(n);Zn(await o.text(),r,n),t<3&&await Kn(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),Tt(r,Vn,{elements:[e]})}}));await Promise.all(r)}var Qn=Object.freeze({__proto__:null,name:Vn,run:async function(){await Kn(document,1)}});var Jn=Object.freeze({__proto__:null,name:"core/reindent",run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=zt(e.innerHTML)}});var Xn=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=mt(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const Yn=/^[a-z]+(\s+[a-z]+)+\??$/,er=/\B"([^"]*)"\B/,tr=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,nr=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,rr=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,or=/^(?:\w+)\??$/,sr=/^(\w+)\["([\w- ]*)"\]$/,ir=/\.?(\w+\(.*\)$)/,ar=/\/(.+)/,cr=/\[\[.+\]\]/;function lr(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Ye`<a + >.`}};Object.keys(zn).forEach((e=>{o[e]||(o[e]={}),Object.assign(o[e],zn[e])}));var Dn=Object.freeze({__proto__:null,name:"geonovum/l10n"});const qn="core/github";let Mn,Bn;const Fn=new Promise(((e,t)=>{Mn=e,Bn=e=>{Lt(e,qn),t(new Error(e))}})),Wn=pt({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"ģ°øģ—¬"},zh:{file_a_bug:"反馈错čÆÆ",participate:"参äøŽļ¼š"},ja:{commit_history:"å¤‰ę›“å±„ę­“",file_a_bug:"問锌報告",participate:"å‚åŠ ę–¹ę³•ļ¼š"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});var Hn=Object.freeze({__proto__:null,github:Fn,name:qn,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void Mn(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=Pt`Config option ${"[github]"} is missing property \`repoURL\`.`;return void Bn(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=Pt`${"[github]"} configuration option is not a valid URL? (${n}).`;return void Bn(e)}if("https://github.com"!==t.origin){const e=Pt`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void Bn(e)}const[r,o]=t.pathname.split("/").filter((e=>e));if(!r||!o){const e=Pt`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void Bn(e)}const s=e.github.branch||"gh-pages",i=new URL("./issues/",t).href,a=new URL(`./commits/${e.github.branch??""}`,t.href),c={edDraftURI:`https://${r.toLowerCase()}.github.io/${o}/`,githubToken:void 0,githubUser:void 0,issueBase:i,atRiskBase:i,otherLinks:[],pullBase:new URL("./pulls/",t).href,shortName:o};let l="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)l=e.githubAPI;else{At("The `githubAPI` configuration option is private and should not be added manually.",qn)}if(!e.excludeGithubLinks){const n={key:Wn.participate,data:[{value:`GitHub ${r}/${o}`,href:t},{value:Wn.file_a_bug,href:c.issueBase},{value:Wn.commit_history,href:a.href},{value:"Pull requests",href:c.pullBase}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(n)}const u={branch:s,repoURL:t.href,apiBase:l,fullName:`${r}/${o}`,issuesURL:i,pullsURL:c.pullBase,newIssuesURL:new URL("./new/choose",i).href,commitHistoryURL:a.href};Mn(u);const d={...c,...e,github:u,githubAPI:l};Object.assign(e,d)}});class Un{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(Gn(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function Gn(e){const t=new Un(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function Vn(e){const t=Gn(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var Zn=Object.freeze({__proto__:null,name:"core/sections",restructure:Vn,run:function(){Vn(document.body)}});const Kn="core/data-include";function Qn(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=ft(e,r.dataset.oninclude,n),s="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let o=t;"markdown"===r&&(o=Yt(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&Vn(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:s}),s||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function Jn(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const o=await fetch(n);Qn(await o.text(),r,n),t<3&&await Jn(e,t+1)}catch(t){Lt(`\`data-include\` failed: \`${n}\` (${t.message}).`,Kn,{elements:[e],cause:t})}}));await Promise.all(r)}var Xn=Object.freeze({__proto__:null,name:Kn,run:async function(){await Jn(document,1)}});var Yn=Object.freeze({__proto__:null,name:"core/reindent",run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=It(e.innerHTML)}});var er=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=ft(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const tr=/^[a-z]+(\s+[a-z]+)+\??$/,nr=/\B"([^"]*)"\B/,rr=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,or=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,sr=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,ir=/^(?:\w+)\??$/,ar=/^(\w+)\["([\w- ]*)"\]$/,cr=/\.?(\w+\(.*\)$)/,lr=/\/(.+)/,ur=/\[\[.+\]\]/;function dr(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Je`<a data-xref-type="_IDL_" data-link-type="idl" data-lt="${t}" ><code>${t+(r?"?":"")}</code></a - >`}function ur(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:s}=e,{identifier:i}=n||{},a="method"===r,c=a?Ye`(${gt(s,dr)})`:null,l=a?`(${s.join(", ")})`:"";return Ye`${n&&o?".":""}<a + >`}function pr(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:s}=e,{identifier:i}=n||{},a="method"===r,c=a?Je`(${ht(s,fr)})`:null,l=a?`(${s.join(", ")})`:"";return Je`${n&&o?".":""}<a data-xref-type="${r}" data-link-type="${r}" data-link-for="${i}" data-xref-for="${i}" data-lt="${`[[${t}]]${l}`}" ><code>[[${t}]]${c}</code></a - >`}function dr(e,t,n){if(t<n.length-1)return Ye`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,s=o?r[2]:r[0];return Ye`${o?"...":null}<var>${s}</var>`}function pr(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return Ye`${r?".":""}<a + >`}function fr(e,t,n){if(t<n.length-1)return Je`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,s=o?r[2]:r[0];return Je`${o?"...":null}<var>${s}</var>`}function hr(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return Je`${r?".":""}<a data-link-type="idl" data-xref-type="attribute|dict-member|const" data-link-for="${o}" data-xref-for="${o}" ><code>${n}</code></a - >`}function fr(e){const{args:t,identifier:n,type:r,parent:o,renderParent:s}=e,{renderText:i,renderArgs:a}=e,{identifier:c}=o||{},l=gt(a||t,dr),u=`${n}(${t.join(", ")})`;return Ye`${o&&s?".":""}<a + >`}function mr(e){const{args:t,identifier:n,type:r,parent:o,renderParent:s}=e,{renderText:i,renderArgs:a}=e,{identifier:c}=o||{},l=ht(a||t,fr),u=`${n}(${t.join(", ")})`;return Je`${o&&s?".":""}<a data-link-type="idl" data-xref-type="${r}" data-link-for="${c}" data-xref-for="${c}" data-lt="${u}" ><code>${i||n}</code></a - >${!i||a?Ye`<code>(${l})</code>`:""}`}function hr(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return Ye`"<a + >${!i||a?Je`<code>(${l})</code>`:""}`}function gr(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return Je`"<a data-link-type="idl" data-xref-type="enum-value" data-link-for="${o}" data-xref-for="${o}" data-lt="${n?null:"the-empty-string"}" ><code>${n}</code></a - >"`}function mr(e){const{identifier:t}=e;return Ye`"<a + >"`}function br(e){const{identifier:t}=e;return Je`"<a data-link-type="idl" data-cite="webidl" data-xref-type="exception" ><code>${t}</code></a - >"`}function gr(e){const{identifier:t,nullable:n}=e;return Ye`<a + >"`}function wr(e){const{identifier:t,nullable:n}=e;return Je`<a data-link-type="idl" data-cite="webidl" data-xref-type="interface" data-lt="${t}" ><code>${t+(n?"?":"")}</code></a - >`}function br(e){let t;try{t=function(e){const t=cr.test(e),n=t?ar:ir,[r,o]=e.split(n);if(t&&r&&!o)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const s=r.split(/[./]/).concat(o).filter((e=>e&&e.trim())).map((e=>e.trim())),i=!e.includes("/"),a=[];for(;s.length;){const t=s.pop();if(tr.test(t)){const[,e,n,r,o]=t.match(tr),s=n.split(/,\s*/).filter((e=>e)),c=r?.trim(),l=o?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:s,renderParent:i,renderText:c,renderArgs:l})}else if(sr.test(t)){const[,e,n]=t.match(sr);a.push({type:"enum",identifier:e,enumValue:n,renderParent:i})}else if(er.test(t)){const[,e]=t.match(er);i?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:i})}else if(nr.test(t)){const[,e,n]=t.match(nr),r=n?"method":"attribute",o=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:o,renderParent:i})}else if(rr.test(t)&&s.length){const[,e]=t.match(rr);a.push({type:"attribute",identifier:e,renderParent:i})}else if(Yn.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(!or.test(t)||0!==s.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=Ye`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Tt(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=Ye(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=lr(e);t&&r.push(t);break}case"attribute":r.push(pr(e));break;case"internal-slot":r.push(ur(e));break;case"method":r.push(fr(e));break;case"enum":r.push(hr(e));break;case"exception":r.push(mr(e));break;case"idl-primitive":r.push(gr(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const wr=new Set(["alias","reference"]),yr=async function(){const e=await et.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[...wr]){const r=e.transaction(n,"readwrite").store,o=IDBKeyRange.lowerBound(t);let s=await r.openCursor(o);for(;s?.value;){const e=s.value;(void 0===e.expires||e.expires<t)&&await r.delete(e.id),s=await s.continue()}}return e}();const vr={get ready(){return yr},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!wr.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:r},async get(e,t){if(!wr.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),o=await n.openCursor(r);return o?o.value:o},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const o={id:r,...e[r],expires:t};o.aliasOf?n.alias.push(o):n.reference.push(o)}const r=[...wr].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!wr.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){const o=await this.get(e,t.id);if(o?.expires<Date.now()){const{store:o}=n.transaction(e,"readwrite");await o.delete(t.id),r=!1}}const{store:o}=n.transaction(e,"readwrite");return r?await o.put(t):await o.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...wr],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},kr={},xr=new URL("https://api.specref.org/bibrefs?refs="),$r=at({hint:"dns-prefetch",href:xr.origin});let _r;document.head.appendChild($r);const Er=new Promise((e=>{_r=e}));async function Sr(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter((e=>e.trim()));if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(xr.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const o=await r.json(),s=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),s):s;await vr.addAll(o,e)}catch(e){console.error(e)}return o}async function Cr(e){const t=await Er;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await Cr(n.aliasOf):n}var Lr=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map((e=>e.toLowerCase())));Array.from(this.conf.informativeReferences).filter((t=>e.has(t.toLowerCase()))).forEach((e=>this.conf.informativeReferences.delete(e)))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=kr;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio[e].aliasOf)).filter((e=>!this.conf.localBiblio.hasOwnProperty(e)));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter((e=>!this.conf.localBiblio.hasOwnProperty(e))).concat(e).sort())),r=n.length?await async function(e){const t=[];try{await vr.ready;const n=e.map((async e=>({id:e,data:await vr.find(e)})));t.push(...await Promise.all(n))}catch(n){t.push(...e.map((e=>({id:e,data:null})))),console.warn(n)}return t}(n):[],o={hasData:[],noData:[]};r.forEach((e=>{(e.data?o.hasData:o.noData).push(e)})),o.hasData.forEach((e=>{kr[e.id]=e.data}));const s=o.noData.map((e=>e.id));if(s.length){const e=await Sr(s,{forceUpdate:!0});Object.assign(kr,e)}Object.assign(kr,this.conf.localBiblio),(()=>{_r(this.conf.biblio)})()}},biblio:kr,name:"core/biblio",resolveRef:Cr,updateFromNetwork:Sr});const Ar="core/render-biblio",Tr=ht({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"ģ°øģ”°"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},ja:{info_references:"参ē…§ē”Øå‚č€ƒę–‡ēŒ®",norm_references:"č¦ēƄēš„å‚č€ƒę–‡ēŒ®",references:"å‚č€ƒę–‡ēŒ®"},de:{info_references:"WeiterfĆ¼hrende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"éžč§„čŒƒę€§å¼•ē”Ø",norm_references:"č§„čŒƒę€§å¼•ē”Ø",references:"å‚č€ƒę–‡ēŒ®"}}),Rr=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]),Nr=(jr=".",e=>{const t=e.trim();return!t||t.endsWith(jr)?t:t+jr});var jr;function Pr(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(Ir)),o=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),s=o.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),i=Ye`<section> + >`}function yr(e){let t;try{t=function(e){const t=ur.test(e),n=t?lr:cr,[r,o]=e.split(n);if(t&&r&&!o)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const s=r.split(/[./]/).concat(o).filter((e=>e&&e.trim())).map((e=>e.trim())),i=!e.includes("/"),a=[];for(;s.length;){const t=s.pop();if(rr.test(t)){const[,e,n,r,o]=t.match(rr),s=n.split(/,\s*/).filter((e=>e)),c=r?.trim(),l=o?.split(/,\s*/).filter((e=>e));a.push({type:"method",identifier:e,args:s,renderParent:i,renderText:c,renderArgs:l})}else if(ar.test(t)){const[,e,n]=t.match(ar);a.push({type:"enum",identifier:e,enumValue:n,renderParent:i})}else if(nr.test(t)){const[,e]=t.match(nr);i?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:i})}else if(or.test(t)){const[,e,n]=t.match(or),r=n?"method":"attribute",o=n?.slice(1,-1).split(/,\s*/).filter((e=>e));a.push({type:"internal-slot",slotType:r,identifier:e,args:o,renderParent:i})}else if(sr.test(t)&&s.length){const[,e]=t.match(sr);a.push({type:"attribute",identifier:e,renderParent:i})}else if(tr.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(!ir.test(t)||0!==s.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=Je`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Lt(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=Je(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=dr(e);t&&r.push(t);break}case"attribute":r.push(hr(e));break;case"internal-slot":r.push(pr(e));break;case"method":r.push(mr(e));break;case"enum":r.push(gr(e));break;case"exception":r.push(br(e));break;case"idl-primitive":r.push(wr(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const vr=new Set(["alias","reference"]),kr=async function(){const e=await Xe.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[...vr]){const r=e.transaction(n,"readwrite").store,o=IDBKeyRange.lowerBound(t);let s=await r.openCursor(o);for(;s?.value;){const e=s.value;(void 0===e.expires||e.expires<t)&&await r.delete(e.id),s=await s.continue()}}return e}();const xr={get ready(){return kr},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!vr.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:r},async get(e,t){if(!vr.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),o=await n.openCursor(r);return o?o.value:o},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const o={id:r,...e[r],expires:t};o.aliasOf?n.alias.push(o):n.reference.push(o)}const r=[...vr].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!vr.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){const o=await this.get(e,t.id);if(o?.expires<Date.now()){const{store:o}=n.transaction(e,"readwrite");await o.delete(t.id),r=!1}}const{store:o}=n.transaction(e,"readwrite");return r?await o.put(t):await o.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...vr],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},$r={},_r=new URL("https://api.specref.org/bibrefs?refs="),Er=st({hint:"dns-prefetch",href:_r.origin});let Sr;document.head.appendChild(Er);const Cr=new Promise((e=>{Sr=e}));async function Lr(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter((e=>e.trim()));if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(_r.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const o=await r.json(),s=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),s):s;await xr.addAll(o,e)}catch(e){console.error(e)}return o}async function Ar(e){const t=await Cr;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await Ar(n.aliasOf):n}var Tr=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map((e=>e.toLowerCase())));Array.from(this.conf.informativeReferences).filter((t=>e.has(t.toLowerCase()))).forEach((e=>this.conf.informativeReferences.delete(e)))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=$r;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio[e].aliasOf)).filter((e=>!this.conf.localBiblio.hasOwnProperty(e)));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter((e=>!this.conf.localBiblio.hasOwnProperty(e))).concat(e).sort())),r=n.length?await async function(e){const t=[];try{await xr.ready;const n=e.map((async e=>({id:e,data:await xr.find(e)})));t.push(...await Promise.all(n))}catch(n){t.push(...e.map((e=>({id:e,data:null})))),console.warn(n)}return t}(n):[],o={hasData:[],noData:[]};r.forEach((e=>{(e.data?o.hasData:o.noData).push(e)})),o.hasData.forEach((e=>{$r[e.id]=e.data}));const s=o.noData.map((e=>e.id));if(s.length){const e=await Lr(s,{forceUpdate:!0});Object.assign($r,e)}Object.assign($r,this.conf.localBiblio),(()=>{Sr(this.conf.biblio)})()}},biblio:$r,name:"core/biblio",resolveRef:Ar,updateFromNetwork:Lr});const Rr="core/render-biblio",Nr=pt({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"ģ°øģ”°"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},ja:{info_references:"参ē…§ē”Øå‚č€ƒę–‡ēŒ®",norm_references:"č¦ēƄēš„å‚č€ƒę–‡ēŒ®",references:"å‚č€ƒę–‡ēŒ®"},de:{info_references:"WeiterfĆ¼hrende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"éžč§„čŒƒę€§å¼•ē”Ø",norm_references:"č§„čŒƒę€§å¼•ē”Ø",references:"å‚č€ƒę–‡ēŒ®"}}),jr=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]),Pr=(Ir=".",e=>{const t=e.trim();return!t||t.endsWith(Ir)?t:t+Ir});var Ir;function Or(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(zr)),o=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),s=o.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),i=Je`<section> <h3>${t}</h3> - <dl class="bibliography">${s.map(zr)}</dl> - </section>`;bt(i,"",t);const a=function(e){return e.reduce(((e,t)=>{const n=t.refcontent.id;return(e.has(n)?e.get(n):e.set(n,[]).get(n)).push(t.ref),e}),new Map)}(n);return function(e,t){e.map((({ref:e,refcontent:n})=>{const r=`#bib-${e.toLowerCase()}`,o=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(o),refcontent:n}})).forEach((({refUrl:e,elems:t,refcontent:n})=>{t.forEach((t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"}))}))}(o,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#bib-${t.toLowerCase()}"]`)].filter((({textContent:e})=>e.toLowerCase()===t.toLowerCase()));Tt(`Reference "[${t}]" not found.`,Ar,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),i}function Ir(e){let t=kr[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Tt(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,Ar)}else n=t.aliasOf,t=kr[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function Or(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,o=Ye`<cite + <dl class="bibliography">${s.map(qr)}</dl> + </section>`;mt(i,"",t);const a=function(e){return e.reduce(((e,t)=>{const n=t.refcontent.id;return(e.has(n)?e.get(n):e.set(n,[]).get(n)).push(t.ref),e}),new Map)}(n);return function(e,t){e.map((({ref:e,refcontent:n})=>{const r=`#bib-${e.toLowerCase()}`,o=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(o),refcontent:n}})).forEach((({refUrl:e,elems:t,refcontent:n})=>{t.forEach((t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"}))}))}(o,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#bib-${t.toLowerCase()}"]`)].filter((({textContent:e})=>e.toLowerCase()===t.toLowerCase()));Lt(`Reference "[${t}]" not found.`,Rr,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),i}function zr(e){let t=$r[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Lt(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,Rr)}else n=t.aliasOf,t=$r[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function Dr(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,o=Je`<cite ><a class="bibref" href="${r}" data-link-type="biblio">${t||n}</a></cite - >`;return t?o:Ye`[${o}]`}function zr(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return Ye` + >`;return t?o:Je`[${o}]`}function qr(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return Je` <dt id="${r}">[${t}]</dt> <dd> - ${n?{html:Dr(n)}:Ye`<em class="respec-offending-element" - >${Tr.reference_not_found}</em + ${n?{html:Mr(n)}:Je`<em class="respec-offending-element" + >${Nr.reference_not_found}</em >`} </dd> - `}function Dr(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${Nr(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${Rr.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var qr=Object.freeze({__proto__:null,name:Ar,renderInlineCitation:Or,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")||Ye`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(Ye`<h1>${Tr.references}</h1>`),r.classList.add("appendix"),n.length){const e=Pr(n,Tr.norm_references);r.appendChild(e)}if(t.length){const e=Pr(t,Tr.info_references);r.appendChild(e)}document.body.appendChild(r)}});const Mr="core/inlines",Br={},Fr=e=>new RegExp(e.map((e=>e.source)).join("|")),Wr=ht({en:{rfc2119Keywords:()=>Fr([/\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:()=>Fr([/\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/])}}),Hr=/(?:`[^`]+`)(?!`)/,Ur=/(?:{{[^}]+\?*}})/,Gr=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,Vr=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,Zr=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Kr=/(?:\[=[^=]+=\])/,Qr=/(?:\[\^[^^]+\^\])/;function Jr(e){const t=e.slice(2,-2).trim(),[n,r,o]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[s,i,a]=t.startsWith("/")?["element-attr",null,n]:o?["attr-value",`${n}/${r}`,o]:r?["element-attr",n,r]:["element",null,n];return Ye`<code + `}function Mr(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t.endsWith(".")||(t+=". ")),e.publisher&&(t=`${t} ${Pr(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${jr.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var Br=Object.freeze({__proto__:null,name:Rr,renderInlineCitation:Dr,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")||Je`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(Je`<h1>${Nr.references}</h1>`),r.classList.add("appendix"),n.length){const e=Or(n,Nr.norm_references);r.appendChild(e)}if(t.length){const e=Or(t,Nr.info_references);r.appendChild(e)}document.body.appendChild(r)}});const Fr="core/inlines",Wr={},Hr=e=>new RegExp(e.map((e=>e.source)).join("|")),Ur=pt({en:{rfc2119Keywords:()=>Hr([/\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:()=>Hr([/\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/])}}),Gr=/(?:`[^`]+`)(?!`)/,Vr=/(?:{{[^}]+\?*}})/,Zr=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,Kr=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,Qr=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Jr=/(?:\[=[^=]+=\])/,Xr=/(?:\[\^[^^]+\^\])/;function Yr(e){const t=e.slice(2,-2).trim(),[n,r,o]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[s,i,a]=t.startsWith("/")?["element-attr",null,n]:o?["attr-value",`${n}/${r}`,o]:r?["element-attr",n,r]:["element",null,n];return Je`<code ><a data-xref-type="${s}" data-xref-for="${i}" @@ -210,24 +210,24 @@ dd{margin-left:0} data-link-for="${i}" >${a}</a ></code - >`}function Xr(e){const t=ft(e),n=Ye`<em class="rfc2119">${t}</em>`;return Br[t]=!0,n}function Yr(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?Ye`<a href="${t}" data-matched-text="${e}"></a>`:Ye`<a data-cite="${t}" data-matched-text="${e}"></a>`}function eo(e,t){const n=ft(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=br(n);return!!t.parentElement.closest("dfn,a")?so(`\`${r.textContent}\``):r}function to(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,s]=r.split("|").map(ft),{type:i,illegal:a}=vt(o,t.parentElement),c=Or(o,s),l=o.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;Rt("Normative references in informative sections are not allowed. ",Mr,{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 no(e,t,n){return"ABBR"===t.parentElement.tagName?e:Ye`<abbr title="${n.get(e)}">${e}</abbr>`}function ro(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return Ye`<var data-type="${r}">${n}</var>`}function oo(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(ft).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const o=n.substring(0,r),s=n.substring(r+1,n.length);return[t(o),t(s)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[o,s]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],i=io(s),a=n?ft(n):null;return Ye`<a + >`}function eo(e){const t=dt(e),n=Je`<em class="rfc2119">${t}</em>`;return Wr[t]=!0,n}function to(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?Je`<a href="${t}" data-matched-text="${e}"></a>`:Je`<a data-cite="${t}" data-matched-text="${e}"></a>`}function no(e,t){const n=dt(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=yr(n);return!!t.parentElement.closest("dfn,a")?ao(`\`${r.textContent}\``):r}function ro(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,s]=r.split("|").map(dt),{type:i,illegal:a}=wt(o,t.parentElement),c=Dr(o,s),l=o.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;At("Normative references in informative sections are not allowed. ",Fr,{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 oo(e,t,n){return"ABBR"===t.parentElement.tagName?e:Je`<abbr title="${n.get(e)}">${e}</abbr>`}function so(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return Je`<var data-type="${r}">${n}</var>`}function io(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(dt).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const o=n.substring(0,r),s=n.substring(r+1,n.length);return[t(o),t(s)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[o,s]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],i=co(s),a=n?dt(n):null;return Je`<a data-link-type="dfn|abstract-op" data-link-for="${a}" data-xref-for="${a}" data-lt="${o}" >${i}</a - >`}function so(e){const t=e.slice(1,-1);return Ye`<code>${t}</code>`}function io(e){return Hr.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?so(e):io(e))):document.createTextNode(e)}var ao=Object.freeze({__proto__:null,name:Mr,rfc2119Usage:Br,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new _t,e.informativeReferences=new _t,e.respecRFC2119||(e.respecRFC2119=Br);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=ft(e),o=ft(r);t.set(n,o)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,o=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=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)),s=[];let i;for(;i=o.nextNode();)s.push(i);return s}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),s=Wr.rfc2119Keywords(),i=new RegExp(`(${Fr([s,Ur,Gr,Vr,Zr,Kr,Hr,Qr,...r?[r]:[]]).source})`);for(const n of o){const r=n.data.split(i);if(1===r.length)continue;const o=document.createDocumentFragment();let a=!0;for(const i of r)if(a=!a,a)switch(!0){case i.startsWith("{{"):o.append(eo(i,n));break;case i.startsWith("[[["):o.append(Yr(i));break;case i.startsWith("[["):o.append(...to(i,n,e));break;case i.startsWith("|"):o.append(ro(i));break;case i.startsWith("[="):o.append(oo(i));break;case i.startsWith("`"):o.append(so(i));break;case i.startsWith("[^"):o.append(Jr(i));break;case t.has(i):o.append(no(i,n,t));break;case s.test(i):o.append(Xr(i))}else o.append(i);n.replaceWith(o)}}});function co(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){Tt(`Invalid ${t} name "${e}": ${o.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function lo(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Tt(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const uo=new Lt;function po(e,t){for(const n of t)uo.has(n)||uo.set(n,new Set),uo.get(n).add(e)}const fo="core/dfn",ho=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:lo}],["element",{requiresFor:!1,validator:co}],["element-attr",{requiresFor:!1,validator:co}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:lo}],["event",{requiresFor:!1,validator:lo}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new nt(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return Tt(`Invalid ${t} "${e}": ${o.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:lo}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?lo(e.slice(1,-1),t,n,r):(Tt(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),mo=[...ho.keys()];function go(e,t){let n="";switch(!0){case mo.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>ho.has(e))),function(e,t,n){const r=ho.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=Ot`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,s=Ot`Use a ${"[data-dfn-for]"} attribute to associate this with ${o}.`;Tt(e,fo,{hint:s,elements:[n]})}r.validator&&r.validator(e,t,n,fo)}(t,n,e);break;case nr.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=Ot`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Tt(`Internal slot "${e}" must be associated with a WebIDL interface.`,fo,{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 o=["attribute","method"],{dfnType:s}=t.dataset;if(!o.includes(s)||r!==s){const n=Ot`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,s=`The only allowed types are: ${Pt(o,{quotes:!0})}. The slot "${e}" seems to be a "${jt(r)}"?`;return Tt(n,fo,{hint:s,elements:[t]}),"dfn"}return s}(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 bo(e){switch(!0){case e.matches(".export.no-export"):Tt(Ot`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,fo,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Tt(Ot`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,fo,{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 wo=Object.freeze({__proto__:null,name:fo,run:function(){for(const e of document.querySelectorAll("dfn")){const t=wt(e);if(po(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;go(e,n),bo(e),1===t.length&&n===ft(e.textContent)||(e.dataset.lt=t.join("|"))}}});var yo=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=ft(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=ft(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=ft(n).toLowerCase(),o=rt.isSingular(r)?rt.plural(r):rt.singular(r);return e.has(o)&&!t.has(o)?o:""}}();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("|"),po(e,n)}}))}});var vo=String.raw`span.example-title{text-transform:none} + >`}function ao(e){const t=e.slice(1,-1);return Je`<code>${t}</code>`}function co(e){return Gr.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?ao(e):co(e))):document.createTextNode(e)}var lo=Object.freeze({__proto__:null,name:Fr,rfc2119Usage:Wr,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new xt,e.informativeReferences=new xt,e.respecRFC2119||(e.respecRFC2119=Wr);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=dt(e),o=dt(r);t.set(n,o)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].join("\\b)|(?:\\b")}\\b)`):null,o=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=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)),s=[];let i;for(;i=o.nextNode();)s.push(i);return s}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),s=Ur.rfc2119Keywords(),i=new RegExp(`(${Hr([s,Vr,Zr,Kr,Qr,Jr,Gr,Xr,...r?[r]:[]]).source})`);for(const n of o){const r=n.data.split(i);if(1===r.length)continue;const o=document.createDocumentFragment();let a=!0;for(const i of r)if(a=!a,a)switch(!0){case i.startsWith("{{"):o.append(no(i,n));break;case i.startsWith("[[["):o.append(to(i));break;case i.startsWith("[["):o.append(...ro(i,n,e));break;case i.startsWith("|"):o.append(so(i));break;case i.startsWith("[="):o.append(io(i));break;case i.startsWith("`"):o.append(ao(i));break;case i.startsWith("[^"):o.append(Yr(i));break;case t.has(i):o.append(oo(i,n,t));break;case s.test(i):o.append(eo(i))}else o.append(i);n.replaceWith(o)}}});function uo(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){Lt(`Invalid ${t} name "${e}": ${o.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function po(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Lt(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const fo=new St;function ho(e,t){for(const n of t)fo.has(n)||fo.set(n,new Set),fo.get(n).add(e)}const mo="core/dfn",go=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:po}],["element",{requiresFor:!1,validator:uo}],["element-attr",{requiresFor:!1,validator:uo}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:po}],["event",{requiresFor:!1,validator:po}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new et(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return Lt(`Invalid ${t} "${e}": ${o.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:po}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?po(e.slice(1,-1),t,n,r):(Lt(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),bo=[...go.keys()];function wo(e,t){let n="";switch(!0){case bo.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>go.has(e))),function(e,t,n){const r=go.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=Pt`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,s=Pt`Use a ${"[data-dfn-for]"} attribute to associate this with ${o}.`;Lt(e,mo,{hint:s,elements:[n]})}r.validator&&r.validator(e,t,n,mo)}(t,n,e);break;case or.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=Pt`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Lt(`Internal slot "${e}" must be associated with a WebIDL interface.`,mo,{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 o=["attribute","method"],{dfnType:s}=t.dataset;if(!o.includes(s)||r!==s){const n=Pt`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,s=`The only allowed types are: ${Nt(o,{quotes:!0})}. The slot "${e}" seems to be a "${Rt(r)}"?`;return Lt(n,mo,{hint:s,elements:[t]}),"dfn"}return s}(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 yo(e){switch(!0){case e.matches(".export.no-export"):Lt(Pt`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,mo,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Lt(Pt`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,mo,{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 vo=Object.freeze({__proto__:null,name:mo,run:function(){for(const e of document.querySelectorAll("dfn")){const t=gt(e);if(ho(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;wo(e,n),yo(e),1===t.length&&n===dt(e.textContent)||(e.dataset.lt=t.join("|"))}}});var ko=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=dt(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=dt(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=dt(n).toLowerCase(),o=tt.isSingular(r)?tt.plural(r):tt.singular(r);return e.has(o)&&!t.has(o)?o:""}}();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("|"),ho(e,n)}}))}});var xo=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 ko=ht({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"ģ˜ˆģ‹œ"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function xo(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?Ye`<span class="example-title">: ${n.title}</span>`:"";return Ye`<div class="marker"> - <a class="self-link">${ko.example}<bdi>${r}</bdi></a +aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff}`;const $o=pt({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"ģ˜ˆģ‹œ"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function _o(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?Je`<span class="example-title">: ${n.title}</span>`:"";return Je`<div class="marker"> + <a class="self-link">${$o.example}<bdi>${r}</bdi></a >${o} - </div>`}var $o=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(Ye`<style> - ${vo} - </style>`,document.querySelector("link"));let t=0;e.forEach((e=>{const n=e.classList.contains("illegal-example"),r={number:t,illegal:n},{title:o}=e;if("aside"===e.localName){++t;const n=xo(e,t,r);e.prepend(n);const s=bt(e,"example",o||String(t));n.querySelector("a.self-link").href=`#${s}`}else{const n=!!e.closest("aside");n||++t,r.content=e.innerHTML,e.classList.remove("example","illegal-example");const s=e.id?e.id:null;s&&e.removeAttribute("id");const i=xo(e,n?0:t,r),a=Ye`<div class="example" id="${s}"> + </div>`}var Eo=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(Je`<style> + ${xo} + </style>`,document.querySelector("link"));let t=0;e.forEach((e=>{const n=e.classList.contains("illegal-example"),r={number:t,illegal:n},{title:o}=e;if("aside"===e.localName){++t;const n=_o(e,t,r);e.prepend(n);const s=mt(e,"example",o||String(t));n.querySelector("a.self-link").href=`#${s}`}else{const n=!!e.closest("aside");n||++t,r.content=e.innerHTML,e.classList.remove("example","illegal-example");const s=e.id?e.id:null;s&&e.removeAttribute("id");const i=_o(e,n?0:t,r),a=Je`<div class="example" id="${s}"> ${i} ${e.cloneNode(!0)} - </div>`;bt(a,"example",o||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var _o=String.raw`.issue-label{text-transform:initial} + </div>`;mt(a,"example",o||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var So=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} @@ -237,29 +237,29 @@ 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 Eo="core/issues-notes",So=ht({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:"č­¦å‘Š"}});function Co(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}}(),o=document.createElement("ul");e.forEach((e=>{const{type:s,displayType:i,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),o=e.classList.contains("atrisk"),s=t?"issue":n?"warning":r?"ednote":"note",i=t?o?So.feature_at_risk:So.issue:n?So.warning:r?So.editors_note:So.note;return{type:s,displayType:i,isFeatureAtRisk:o}}(e),c="issue"===s,l="span"===e.localName,{number:u}=e.dataset,d={type:s,inline:l,title:e.title,number:r(e)};if(!l){const r=Ye`<div class="${a?`${s} atrisk`:s}" role="${"note"===s?"note":null}"></div>`,l=document.createElement("span"),p=Ye`<div role="heading" class="${`${s}-title marker`}">${l}</div>`;bt(p,"h",s);let f,h=i;if(e.id?(r.id=e.id,e.removeAttribute("id")):bt(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 Ye`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return Ye`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),f=t.get(u),!f){Rt(`Failed to fetch issue number ${u}.`,Eo)}f&&!d.title&&(d.title=f.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?Ye`<span style="text-transform: none">: ${t.title}</span>`:"";return Ye`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(So.issue,d,r.id))}if(l.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},o=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,o=new URL("./issues/",t);o.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const s=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[o,s,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*o+.7152*s+.0722*i>.179?"#000":"#fff"}(n),i=`background-color: #${n}; color: ${s}`,a=`GitHub label: ${r}`;return Ye` <a +.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 Co="core/issues-notes",Lo=pt({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:"č­¦å‘Š"}});function Ao(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}}(),o=document.createElement("ul");e.forEach((e=>{const{type:s,displayType:i,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),o=e.classList.contains("atrisk"),s=t?"issue":n?"warning":r?"ednote":"note",i=t?o?Lo.feature_at_risk:Lo.issue:n?Lo.warning:r?Lo.editors_note:Lo.note;return{type:s,displayType:i,isFeatureAtRisk:o}}(e),c="issue"===s,l="span"===e.localName,{number:u}=e.dataset,d={type:s,inline:l,title:e.title,number:r(e)};if(!l){const r=Je`<div class="${a?`${s} atrisk`:s}" role="${"note"===s?"note":null}"></div>`,l=document.createElement("span"),p=Je`<div role="heading" class="${`${s}-title marker`}">${l}</div>`;mt(p,"h",s);let f,h=i;if(e.id?(r.id=e.id,e.removeAttribute("id")):mt(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 Je`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return Je`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),f=t.get(u),!f){At(`Failed to fetch issue number ${u}.`,Co)}f&&!d.title&&(d.title=f.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?Je`<span style="text-transform: none">: ${t.title}</span>`:"";return Je`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(Lo.issue,d,r.id))}if(l.textContent=h,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},o=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,o=new URL("./issues/",t);o.searchParams.set("q",`is:issue is:open label:"${e.name}"`);const s=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[o,s,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*o+.7152*s+.0722*i>.179?"#000":"#fff"}(n),i=`background-color: #${n}; color: ${s}`,a=`GitHub label: ${r}`;return Je` <a class="respec-gh-label" style="${i}" href="${o.href}" aria-label="${a}" >${r}</a - >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return Ye`<span class="issue-label">: ${t}${r}</span>`}(o,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(s),m.removeAttribute("data-number"),f&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(f.bodyHTML)),r.append(p,m);const g=xt(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(Ye`<p>${So.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${So.issue_summary}</h1>`)}(o)}var Lo=Object.freeze({__proto__:null,name:Eo,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 Tt(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,Eo),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github),{head:o}=document;o.insertBefore(Ye`<style> - ${_o} - </style>`,o.querySelector("link")),Co(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const Ao="core/best-practices",To={en:{best_practice:"Best Practice "},ja:{best_practice:"꜀č‰Æå®Ÿę–½ä¾‹ "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"ęœ€ä½³å®žč·µ "}},Ro=ht(To),No=l in To?l:"en";var jo=Object.freeze({__proto__:null,name:Ao,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=bt(e,"bp"),o=Ye`<a class="marker self-link" href="${`#${r}`}" - ><bdi lang="${No}">${Ro.best_practice}${t+1}</bdi></a - >`;if(n){const t=Ye`<li>${o}: ${Et(e)}</li>`;n.appendChild(t)}const s=e.closest("div");if(!s)return void e.classList.add("advisement");s.classList.add("advisement");const i=Ye`${o.cloneNode(!0)}: ${e}`;s.prepend(...i.childNodes)})),e.length)t&&(t.appendChild(Ye`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){Rt("Using best practices summary (#bp-summary) but no best practices found.",Ao),t.remove()}}});const Po="core/figures",Io=ht({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 Oo=Object.freeze({__proto__:null,name:Po,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;bt(e,"fig",r),kt(t,Ye`<span class="fig-title"></span>`),t.prepend(Ye`<a class="self-link" href="#${e.id}" - >${Io.fig}<bdi class="figno">${n+1}</bdi></a - >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{yt(e,"span").removeAttribute("href")})),Ye`<li class="tofline"> + >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return Je`<span class="issue-label">: ${t}${r}</span>`}(o,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(s),m.removeAttribute("data-number"),f&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(f.bodyHTML)),r.append(p,m);const g=vt(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(Je`<p>${Lo.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${Lo.issue_summary}</h1>`)}(o)}var To=Object.freeze({__proto__:null,name:Co,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 Lt(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,Co),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github),{head:o}=document;o.insertBefore(Je`<style> + ${So} + </style>`,o.querySelector("link")),Ao(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const Ro="core/best-practices",No={en:{best_practice:"Best Practice "},ja:{best_practice:"꜀č‰Æå®Ÿę–½ä¾‹ "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"ęœ€ä½³å®žč·µ "}},jo=pt(No),Po=s in No?s:"en";var Io=Object.freeze({__proto__:null,name:Ro,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=mt(e,"bp"),o=Je`<a class="marker self-link" href="${`#${r}`}" + ><bdi lang="${Po}">${jo.best_practice}${t+1}</bdi></a + >`;if(n){const t=Je`<li>${o}: ${$t(e)}</li>`;n.appendChild(t)}const s=e.closest("div");if(!s)return void e.classList.add("advisement");s.classList.add("advisement");const i=Je`${o.cloneNode(!0)}: ${e}`;s.prepend(...i.childNodes)})),e.length)t&&(t.appendChild(Je`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){At("Using best practices summary (#bp-summary) but no best practices found.",Ro),t.remove()}}});const Oo="core/figures",zo=pt({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 Do=Object.freeze({__proto__:null,name:Oo,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;mt(e,"fig",r),yt(t,Je`<span class="fig-title"></span>`),t.prepend(Je`<a class="self-link" href="#${e.id}" + >${zo.fig}<bdi class="figno">${n+1}</bdi></a + >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{bt(e,"span").removeAttribute("href")})),Je`<li class="tofline"> <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a> - </li>`}(t.id,r));else{Rt("Found a `<figure>` without a `<figcaption>`.",Po,{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=function(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}(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(Ye`<h1>${Io.list_of_figures}</h1>`,Ye`<ul class="tof"> + </li>`}(t.id,r));else{At("Found a `<figure>` without a `<figcaption>`.",Oo,{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=function(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}(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(Je`<h1>${zo.list_of_figures}</h1>`,Je`<ul class="tof"> ${e} - </ul>`))}});const zo="core/data-cite",Do="__SPEC__";async function qo(e){const{key:t,frag:n,path:r,href:o}=e;let s="",i="";if(t===Do)s=document.location.href;else{const e=await Cr(t);if(!e)return null;s=e.href,i=e.title}if(o)s=o;else{if(r){const e=r.startsWith("/")?`.${r}`:r;s=new URL(e,s).href}n&&(s=new URL(n,s).href)}return{href:s,title:i}}function Mo(e,t,n){const{href:r,title:o}=t,s=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=o),t.href=r,s){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?kt(e,t):(t.textContent=o,e.append(t)),s){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Tt("Exporting a linked external definition is not allowed.",zo,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function Bo(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const Fo=Bo("#"),Wo=Bo("/");function Ho(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:o,citeHref:s}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:o,isNormative:s}=r?Ho(r):{key:Do,isNormative:!1};return t.cite=s?o:`?${o}`,t.citeFrag=n.replace("#",""),Ho(e)}const i=r?`#${r}`:Fo(n),a=o||Wo(n).split("#")[0],{type:c}=vt(n,e),l="normative"===c,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:i,path:a,href:s}}function Uo(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 Go=Object.freeze({__proto__:null,THIS_SPEC:Do,name:zo,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(Ho).map((async e=>({entry:e,result:await Cr(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await Sr(n);r&&Object.assign(kr,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=Ho(t),r=await qo(n);if(r)Mo(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),Rt(n,zo,{elements:[t]})}}s("beforesave",Uo)},toCiteDetails:Ho});const Vo="core/link-to-dfn",Zo=[],Ko=ht({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:"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚"}});function Qo(e){const t=new Map,n=[];for(const r of uo.get(e)){const{dfnType:o="dfn"}=r.dataset,s=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const i of s){if(t.has(i)&&t.get(i).has(o)){const e=t.get(i).get(o),s="dfn"===e.localName,a="dfn"===r.localName,c=o===(e.dataset.dfnType||"dfn"),l=!i&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(i);if(s&&a&&c&&l){n.push(r);continue}}t.has(i)||t.set(i,new Map),t.get(i).set(o,r),("idl"in r.dataset||"dfn"!==o)&&t.get(i).set("idl",r),bt(r,"dfn",e)}}return{result:t,duplicates:n}}function Jo(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"";return wt(e).reduce(((e,r)=>{const o=r.split(".");return 2===o.length&&e.push({for:o[0],title:o[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r}),e}),[])}(e).find((e=>t.has(e.title)&&t.get(e.title).has(e.for)));if(!n)return;const r=t.get(n.title).get(n.for),{linkType:o}=e.dataset;if(o){for(const e of o.split("|"))if(r.get(e))return r.get(e);return r.get("dfn")}{const e=n.for?"idl":"dfn";return r.get(e)||r.get("idl")}}function Xo(e,t,n){let r=!1;const{linkFor:o}=e.dataset,{dfnFor:s}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(o&&!n.get(o)&&s&&!s.split(",").map((e=>e.trim())).includes(o))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"),o=Yo(e)&&Yo(t,n);r&&!o||kt(e,document.createElement("code"))}(e,t),!r}function Yo(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 es(e){e.forEach((e=>{Rt(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,Vo,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var ts=Object.freeze({__proto__:null,name:Vo,possibleExternalLinks:Zo,run:async function(e){const t=function(){const e=new Lt;for(const t of uo.keys()){const{result:n,duplicates:r}=Qo(t);e.set(t,n),r.length>0&&Tt(Ko.duplicateMsg(t),Vo,{title:Ko.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){Zo.push(e);continue}const r=Jo(e,t);if(r){Xo(e,r,t)||Zo.push(e)}else""===e.dataset.cite?n.push(e):Zo.push(e)}es(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${Do}$2`);const{key:r,isNormative:o}=Ho(t);r!==Do&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||es(Zo)}});const ns="core/contrib";var rs=Object.freeze({__proto__:null,name:ns,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Tt(Ot`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,ns)}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 o();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 Ye(t)`${n.map((({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`))}`;const r=n.map((e=>e.name||e.login));t.textContent=pt(r)}(r,n):n.textContent="Failed to fetch contributors.";async function o(){const{href:n}=new URL("contributors",t);try{const t=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let o,s;if("caches"in window)try{if(o=await caches.open(r.origin),s=await o.match(n),s&&new Date(s.headers.get("Expires"))>new Date)return s}catch(e){console.error("Failed to use Cache API.",e)}const i=await fetch(n);if(!i.ok&&s)return console.warn(`Returning a stale cached response for ${r}`),s;if(o&&i.ok){const e=i.clone(),r=new Headers(i.headers),s=new Date(Date.now()+t);r.set("Expires",s.toISOString());const a=new Response(await e.blob(),{headers:r});await o.put(n,a).catch(console.error)}return i}(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 Tt("Error loading contributors from GitHub.",ns),console.error(e),null}}}(t,n)}});var os=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);yt(e,`h${t}`)}))}});const ss=["h2","h3","h4","h5","h6"],is="core/structure",as=ht({en:{toc:"Table of Contents"},zh:{toc:"内容大ēŗ²"},ko:{toc:"ėŖ©ģ°Ø"},ja:{toc:"ē›®ę¬”"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function cs(e,t,{prefix:n=""}={}){let r=!1,o=0,s=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const i=Ye`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=s,r=!0);let e=a.isIntro?"":r?ls(s-o+1):n+s;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(s+=1,a.header.prepend(Ye`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=ds(a.header,n),o=cs(a.subsections,t,{prefix:e});o&&r.append(o),i.append(r)}}return i}function ls(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function us(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(!ss.includes(r.localName))continue;const o=r.textContent;bt(e,null,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:us(e)})}return n}function ds(e,t){const n=Ye`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=yt(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{yt(e,"span").removeAttribute("id")})),Ye`<li class="tocline">${n}</li>`}var ps=Object.freeze({__proto__:null,name:is,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(xt(e,"section").length+1,6)}`;e.localName!==t&&yt(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)){Tt("`data-max-toc` must have a value between 0-6 (inclusive).",is,{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=cs(us(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=Ye`<nav id="toc"></nav>`,n=Ye`<h2 class="introductory">${as.toc}</h2>`;bt(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 o=Ye`<p role="navigation" id="back-to-top"> + </ul>`))}});const qo="core/data-cite",Mo="__SPEC__";async function Bo(e){const{key:t,frag:n,path:r,href:o}=e;let s="",i="";if(t===Mo)s=document.location.href;else{const e=await Ar(t);if(!e)return null;s=e.href,i=e.title}if(o)s=o;else{if(r){const e=r.startsWith("/")?`.${r}`:r;s=new URL(e,s).href}n&&(s=new URL(n,s).href)}return{href:s,title:i}}function Fo(e,t,n){const{href:r,title:o}=t,s=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=o),t.href=r,s){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?yt(e,t):(t.textContent=o,e.append(t)),s){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Lt("Exporting a linked external definition is not allowed.",qo,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function Wo(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const Ho=Wo("#"),Uo=Wo("/");function Go(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:o,citeHref:s}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:o,isNormative:s}=r?Go(r):{key:Mo,isNormative:!1};return t.cite=s?o:`?${o}`,t.citeFrag=n.replace("#",""),Go(e)}const i=r?`#${r}`:Ho(n),a=o||Uo(n).split("#")[0],{type:c}=wt(n,e),l="normative"===c,u=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:i,path:a,href:s}}function Vo(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 Zo=Object.freeze({__proto__:null,THIS_SPEC:Mo,name:qo,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(Go).map((async e=>({entry:e,result:await Ar(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await Lr(n);r&&Object.assign($r,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=Go(t),r=await Bo(n);if(r)Fo(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),At(n,qo,{elements:[t]})}}Dt("beforesave",Vo)},toCiteDetails:Go});const Ko="core/link-to-dfn",Qo=[],Jo=pt({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:"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚"}});function Xo(e){const t=new Map,n=[];for(const r of fo.get(e)){const{dfnType:o="dfn"}=r.dataset,s=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const i of s){if(t.has(i)&&t.get(i).has(o)){const e=t.get(i).get(o),s="dfn"===e.localName,a="dfn"===r.localName,c=o===(e.dataset.dfnType||"dfn"),l=!i&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(i);if(s&&a&&c&&l){n.push(r);continue}}t.has(i)||t.set(i,new Map),t.get(i).set(o,r),("idl"in r.dataset||"dfn"!==o)&&t.get(i).set("idl",r),mt(r,"dfn",e)}}return{result:t,duplicates:n}}function Yo(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"";return gt(e).reduce(((e,r)=>{const o=r.split(".");return 2===o.length&&e.push({for:o[0],title:o[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r}),e}),[])}(e).find((e=>t.has(e.title)&&t.get(e.title).has(e.for)));if(!n)return;const r=t.get(n.title).get(n.for),{linkType:o}=e.dataset;if(o){for(const e of o.split("|"))if(r.get(e))return r.get(e);return r.get("dfn")}{const e=n.for?"idl":"dfn";return r.get(e)||r.get("idl")}}function es(e,t,n){let r=!1;const{linkFor:o}=e.dataset,{dfnFor:s}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(o&&!n.get(o)&&s&&!s.split(",").map((e=>e.trim())).includes(o))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"),o=ts(e)&&ts(t,n);r&&!o||yt(e,document.createElement("code"))}(e,t),!r}function ts(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 ns(e){e.forEach((e=>{At(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,Ko,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var rs=Object.freeze({__proto__:null,name:Ko,possibleExternalLinks:Qo,run:async function(e){const t=function(){const e=new St;for(const t of fo.keys()){const{result:n,duplicates:r}=Xo(t);e.set(t,n),r.length>0&&Lt(Jo.duplicateMsg(t),Ko,{title:Jo.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){Qo.push(e);continue}const r=Yo(e,t);if(r){es(e,r,t)||Qo.push(e)}else""===e.dataset.cite?n.push(e):Qo.push(e)}ns(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${Mo}$2`);const{key:r,isNormative:o}=Go(t);r!==Mo&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||ns(Qo)}});const os="core/contrib";var ss=Object.freeze({__proto__:null,name:os,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Lt(Pt`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,os)}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 o();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 Je(t)`${n.map((({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`))}`;const r=n.map((e=>e.name||e.login));t.textContent=ut(r)}(r,n):n.textContent="Failed to fetch contributors.";async function o(){const{href:n}=new URL("contributors",t);try{const t=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let o,s;if("caches"in window)try{if(o=await caches.open(r.origin),s=await o.match(n),s&&new Date(s.headers.get("Expires"))>new Date)return s}catch(e){console.error("Failed to use Cache API.",e)}const i=await fetch(n);if(!i.ok&&s)return console.warn(`Returning a stale cached response for ${r}`),s;if(o&&i.ok){const e=i.clone(),r=new Headers(i.headers),s=new Date(Date.now()+t);r.set("Expires",s.toISOString());const a=new Response(await e.blob(),{headers:r});await o.put(n,a).catch(console.error)}return i}(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 Lt("Error loading contributors from GitHub.",os,{cause:e}),null}}}(t,n)}});var is=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);bt(e,`h${t}`)}))}});const as=["h2","h3","h4","h5","h6"],cs="core/structure",ls=pt({en:{toc:"Table of Contents"},zh:{toc:"内容大ēŗ²"},ko:{toc:"ėŖ©ģ°Ø"},ja:{toc:"ē›®ę¬”"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function us(e,t,{prefix:n=""}={}){let r=!1,o=0,s=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const i=Je`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=s,r=!0);let e=a.isIntro?"":r?ds(s-o+1):n+s;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(s+=1,a.header.prepend(Je`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=fs(a.header,n),o=us(a.subsections,t,{prefix:e});o&&r.append(o),i.append(r)}}return i}function ds(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function ps(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(!as.includes(r.localName))continue;const o=r.textContent;mt(e,null,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:ps(e)})}return n}function fs(e,t){const n=Je`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=bt(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{bt(e,"span").removeAttribute("id")})),Je`<li class="tocline">${n}</li>`}var hs=Object.freeze({__proto__:null,name:cs,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(vt(e,"section").length+1,6)}`;e.localName!==t&&bt(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)){Lt("`data-max-toc` must have a value between 0-6 (inclusive).",cs,{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=us(ps(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=Je`<nav id="toc"></nav>`,n=Je`<h2 class="introductory">${ls.toc}</h2>`;mt(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 o=Je`<p role="navigation" id="back-to-top"> <a href="#title"><abbr title="Back to Top">↑</abbr></a> - </p>`;document.body.append(o)}(t)}o("toc")}});const fs=ht({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:"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚"}});var hs=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(Ye`<p><em>${fs.informative}</em></p>`)}))}});const ms=ht({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${ft(t.textContent)}`),n}}});var gs=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||(bt(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=ms.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=Ye`<div class="header-wrapper"></div>`;n.replaceWith(o);const s=Ye`<a + </p>`;document.body.append(o)}(t)}zt("toc")}});const ms=pt({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:"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚"}});var gs=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(Je`<p><em>${ms.informative}</em></p>`)}))}});const bs=pt({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${dt(t.textContent)}`),n}}});var ws=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||(mt(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=bs.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=Je`<div class="header-wrapper"></div>`;n.replaceWith(o);const s=Je`<a href="#${t}" class="self-link" aria-label="${r}" - ></a>`;o.append(n,s)}}});var bs=Object.freeze({__proto__:null,name:"geonovum/conformance",run:function(){const e=document.querySelector("section#conformance");e&&function(e){const t=Ye` + ></a>`;o.append(n,s)}}});var ys=Object.freeze({__proto__:null,name:"geonovum/conformance",run:function(){const e=document.querySelector("section#conformance");e&&function(e){const t=Je` <h2>Conformiteit</h2> <p> Naast onderdelen die als niet normatief gemarkeerd zijn, zijn ook alle @@ -267,20 +267,20 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} is alles in dit document normatief. </p> <p>Informatief en normatief.</p> - `;e.prepend(...t.childNodes)}(e)}});const ws="ui/save-html",ys=ht({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"äæå­˜ć™ć‚‹"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"åƼå‡ŗ"}}),vs=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return qt(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return qt(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}}];function ks(e,t){const{id:n,href:r,ext:o,title:s,type:i}=e,a=function(e,t=""){return st.format(e).replace(ot,t)}(t.publishDate||new Date),c=[t.specStatus,t.shortName||"spec",a].join("-");return Ye`<a + `;e.prepend(...t.childNodes)}(e)}});const vs="ui/save-html",ks=pt({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"äæå­˜ć™ć‚‹"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"åƼå‡ŗ"}}),xs=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return Bt(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return Bt(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}}];function $s(e,t){const{id:n,href:r,ext:o,title:s,type:i}=e,a=function(e,t=""){return rt.format(e).replace(nt,t)}(t.publishDate||new Date),c=[t.specStatus,t.shortName||"spec",a].join("-");return Je`<a href="${r}" id="${n}" download="${c}.${o}" type="${i}" class="respec-save-button" - onclick=${()=>bn.closeModal()} + onclick=${()=>yn.closeModal()} >${s}</a - >`}var xs=Object.freeze({__proto__:null,exportDocument:function(e,t){return Rt("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",ws,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),qt(t)},name:ws,run:function(e){const t={async show(t){await document.respec.ready;const n=Ye`<div class="respec-save-buttons"> - ${vs.map((t=>ks(t,e)))} - </div>`;bn.freshModal(ys.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=bn.addCommand(ys.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","šŸ’¾"))}});const $s="https://respec.org/specref/",_s=ht({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"ä»•ę§˜ę¤œē“¢"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"ꐜē“¢ Specref"}}),Es=bn.addCommand(_s.search_specref,(function(){const e=Ye` - <iframe class="respec-iframe" src="${$s}" onload=${e=>e.target.classList.add("ready")}></iframe> - <a href="${$s}" target="_blank">Open Search UI in a new tab</a> - `;bn.freshModal(_s.search_specref,e,Es)}),"Ctrl+Shift+Alt+space","šŸ”Ž");var Ss=Object.freeze({__proto__:null});const Cs=ht({en:{about_respec:"About"},zh:{about_respec:"关äŗŽ"},nl:{about_respec:"Over"},ja:{about_respec:"ć“ć‚Œć«ć¤ć„ć¦"},de:{about_respec:"Ɯber"}});window.respecVersion=window.respecVersion||"Developer Edition";const Ls=document.createElement("div"),As=Ye.bind(Ls),Ts=bn.addCommand(`${Cs.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(Rs).forEach((t=>{e.push(t)}));As` + >`}var _s=Object.freeze({__proto__:null,exportDocument:function(e,t){return At("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",vs,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),Bt(t)},name:vs,run:function(e){const t={async show(t){await document.respec.ready;const n=Je`<div class="respec-save-buttons"> + ${xs.map((t=>$s(t,e)))} + </div>`;yn.freshModal(ks.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=yn.addCommand(ks.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","šŸ’¾"))}});const Es="https://respec.org/specref/",Ss=pt({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"ä»•ę§˜ę¤œē“¢"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"ꐜē“¢ Specref"}}),Cs=yn.addCommand(Ss.search_specref,(function(){const e=Je` + <iframe class="respec-iframe" src="${Es}" onload=${e=>e.target.classList.add("ready")}></iframe> + <a href="${Es}" target="_blank">Open Search UI in a new tab</a> + `;yn.freshModal(Ss.search_specref,e,Cs)}),"Ctrl+Shift+Alt+space","šŸ”Ž");var Ls=Object.freeze({__proto__:null});const As=pt({en:{about_respec:"About"},zh:{about_respec:"关äŗŽ"},nl:{about_respec:"Over"},ja:{about_respec:"ć“ć‚Œć«ć¤ć„ć¦"},de:{about_respec:"Ɯber"}});window.respecVersion=window.respecVersion||"Developer Edition";const Ts=document.createElement("div"),Rs=Je.bind(Ts),Ns=yn.addCommand(`${As.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(js).forEach((t=>{e.push(t)}));Rs` <p> ReSpec is a document production toolchain, with a notable focus on W3C specifications. </p> @@ -304,15 +304,15 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} </thead> <tbody>${e}</tbody> </table> -`,bn.freshModal(`${Cs.about_respec} - ${window.respecVersion}`,Ls,Ts)}),"Ctrl+Shift+Alt+A","ā„¹ļø");function Rs({name:e,duration:t}){return Ye` +`,yn.freshModal(`${As.about_respec} - ${window.respecVersion}`,Ts,Ns)}),"Ctrl+Shift+Alt+A","ā„¹ļø");function js({name:e,duration:t}){return Je` <tr> <td><a href="${`https://github.com/speced/respec/blob/develop/src/${e}.js`}">${e}</a></td> <td>${t}</td> </tr> - `}var Ns=Object.freeze({__proto__:null});var js=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=Ye`<meta + `}var Ps=Object.freeze({__proto__:null});var Is=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=Je`<meta name="revision" content="${e.gitRevision}" - />`;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)}});var Ps=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)}});var Os=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} } @@ -327,21 +327,21 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} .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 Is(t){const n=await fetch(new URL(`../../${t}`,e&&e.src||new URL("respec-geonovum.js",document.baseURI).href));return await n.text()}const Os=at({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(Os);const zs=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return Fi}))).default}catch{return Is("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();n("core/worker",zs.then((e=>({worker:e}))));const Ds=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function qs(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:Ds(),languages:t},r=await zs;return r.postMessage(n),new Promise(((e,t)=>{const o=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(s){const{data:{id:i,language:a,value:c}}=s;i===n.id&&(r.removeEventListener("message",t),clearTimeout(o),e({language:a,value:c}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:o,value:s}=r;switch(e.localName){case"pre":e.classList.remove(o),e.innerHTML=`<code class="hljs${o?` ${o}`:""}">${s}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=s,e.classList.add("hljs"),o&&e.classList.add(o)}e.setAttribute("aria-busy","false")}var Ms=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(qs);document.head.appendChild(Ye`<style> - ${Ps} - </style>`),await Promise.all(n)}});const Bs=ht({en:{missing_test_suite_uri:Ot`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:Ot`ć“ć®ä»•ę§˜å†…ć«ćƒ†ć‚¹ćƒˆć®é …ē›®ć‚’ę¤œå‡ŗć—ć¾ć—ćŸćŒļ¼ŒReSpec 恮čØ­å®šć« ${"[testSuiteURI]"} ćŒč¦‹ć¤ć‹ć‚Šć¾ć›ć‚“ļ¼Ž`,tests:"ćƒ†ć‚¹ćƒˆ",test:"ćƒ†ć‚¹ćƒˆ"},de:{missing_test_suite_uri:Ot`Die Spezifikation enthƤlt Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:Ot`ęœ¬č§„čŒƒäø­åŒ…å«ęµ‹čƕļ¼Œä½†åœØ ReSpec 配ē½®äø­ē¼ŗ少 ${"[testSuiteURI]"}怂`,tests:"굋čƕ",test:"굋čƕ"}}),Fs="core/data-tests";function Ws(e){const t=[],[n]=new URL(e).pathname.split("/").reverse(),r=n.split(".");let[o]=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"),o=o.replace(".https",""),t.push(e)}if(o.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"),o=o.replace("-manual",""),t.push(e)}return Ye` +.hljs-link{text-decoration:underline}`;async function zs(t){const n=await fetch(new URL(`../../${t}`,e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-geonovum.js",document.baseURI).href));return await n.text()}const Ds=st({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(Ds);const qs=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return Hi}))).default}catch{return zs("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();n("core/worker",qs.then((e=>({worker:e}))));const Ms=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function Bs(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:Ms(),languages:t},r=await qs;return r.postMessage(n),new Promise(((e,t)=>{const o=setTimeout((()=>{t(new Error("Timed out waiting for highlight."))}),4e3);r.addEventListener("message",(function t(s){const{data:{id:i,language:a,value:c}}=s;i===n.id&&(r.removeEventListener("message",t),clearTimeout(o),e({language:a,value:c}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:o,value:s}=r;switch(e.localName){case"pre":e.classList.remove(o),e.innerHTML=`<code class="hljs${o?` ${o}`:""}">${s}</code>`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=s,e.classList.add("hljs"),o&&e.classList.add(o)}e.setAttribute("aria-busy","false")}var Fs=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(Bs);document.head.appendChild(Je`<style> + ${Os} + </style>`),await Promise.all(n)}});const Ws=pt({en:{missing_test_suite_uri:Pt`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:Pt`ć“ć®ä»•ę§˜å†…ć«ćƒ†ć‚¹ćƒˆć®é …ē›®ć‚’ę¤œå‡ŗć—ć¾ć—ćŸćŒļ¼ŒReSpec 恮čØ­å®šć« ${"[testSuiteURI]"} ćŒč¦‹ć¤ć‹ć‚Šć¾ć›ć‚“ļ¼Ž`,tests:"ćƒ†ć‚¹ćƒˆ",test:"ćƒ†ć‚¹ćƒˆ"},de:{missing_test_suite_uri:Pt`Die Spezifikation enthƤlt Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:Pt`ęœ¬č§„čŒƒäø­åŒ…å«ęµ‹čƕļ¼Œä½†åœØ ReSpec 配ē½®äø­ē¼ŗ少 ${"[testSuiteURI]"}怂`,tests:"굋čƕ",test:"굋čƕ"}}),Hs="core/data-tests";function Us(e){const t=[],[n]=new URL(e).pathname.split("/").reverse(),r=n.split(".");let[o]=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"),o=o.replace(".https",""),t.push(e)}if(o.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"),o=o.replace("-manual",""),t.push(e)}return Je` <li> <a href="${e}">${o}</a> ${t} </li> - `}function Hs(e,t,n){return e.map((e=>{try{return new URL(e,t).href}catch{Rt(Ot`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,Fs,{elements:[n]})}})).filter((e=>e))}function Us(e,t){const n=e.filter(((e,t,n)=>n.indexOf(e)!==t));if(n.length){const e=Ot`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=Ot`To fix, remove duplicates from ${"[data-tests]"}: ${function(e,{quotes:t}={quotes:!1}){return pt(e,t?e=>jt(It(e)):jt)}(n,{quotes:!0})}.`;Rt(e,Fs,{hint:r,elements:[t]})}}function Gs(e){const t=[...new Set(e)];return Ye` + `}function Gs(e,t,n){return e.map((e=>{try{return new URL(e,t).href}catch{At(Pt`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,Hs,{elements:[n]})}})).filter((e=>e))}function Vs(e,t){const n=e.filter(((e,t,n)=>n.indexOf(e)!==t));if(n.length){const e=Pt`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=Pt`To fix, remove duplicates from ${"[data-tests]"}: ${function(e,{quotes:t}={quotes:!1}){return ut(e,t?e=>Rt(jt(e)):Rt)}(n,{quotes:!0})}.`;At(e,Hs,{hint:r,elements:[t]})}}function Zs(e){const t=[...new Set(e)];return Je` <details class="respec-tests-details removeOnSave"> <summary>tests: ${t.length}</summary> <ul> - ${t.map(Ws)} + ${t.map(Us)} </ul> </details> - `}var Vs=Object.freeze({__proto__:null,name:Fs,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=Hs(n.dataset.tests.split(/,/gm).map((e=>e.trim())),e.testSuiteURI,n);Us(t,n);const r=Gs(t);n.append(r)}else Tt(Bs.missing_test_suite_uri,Fs)}});const Zs="core/list-sorter";function Ks(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function Qs(e,t){return[...e.querySelectorAll(":scope > li")].sort(Ks(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function Js(e,t){return[...e.querySelectorAll(":scope > dt")].sort(Ks(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,o=document.createDocumentFragment();let{nextSibling:s}=t;for(;s&&s.nextSibling;){o.appendChild(s.cloneNode(!0));const{nodeType:e,nodeName:t}=s.nextSibling;if(e===n&&t===r)break;s=s.nextSibling}return o.prepend(t.cloneNode(!0)),e.appendChild(o),e}),document.createDocumentFragment())}var Xs=Object.freeze({__proto__:null,name:Zs,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=Js(t,n);break;case"ol":case"ul":e=Qs(t,n);break;default:Rt(`ReSpec can't sort ${t.localName} elements.`,Zs,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:Js,sortListItems:Qs});var Ys=String.raw`var:hover{text-decoration:underline;cursor:pointer} + `}var Ks=Object.freeze({__proto__:null,name:Hs,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=Gs(n.dataset.tests.split(/,/gm).map((e=>e.trim())),e.testSuiteURI,n);Vs(t,n);const r=Zs(t);n.append(r)}else Lt(Ws.missing_test_suite_uri,Hs)}});const Qs="core/list-sorter";function Js(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function Xs(e,t){return[...e.querySelectorAll(":scope > li")].sort(Js(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function Ys(e,t){return[...e.querySelectorAll(":scope > dt")].sort(Js(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,o=document.createDocumentFragment();let{nextSibling:s}=t;for(;s&&s.nextSibling;){o.appendChild(s.cloneNode(!0));const{nodeType:e,nodeName:t}=s.nextSibling;if(e===n&&t===r)break;s=s.nextSibling}return o.prepend(t.cloneNode(!0)),e.appendChild(o),e}),document.createDocumentFragment())}var ei=Object.freeze({__proto__:null,name:Qs,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=Ys(t,n);break;case"ol":case"ul":e=Xs(t,n);break;default:At(`ReSpec can't sort ${t.localName} elements.`,Qs,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:Ys,sortListItems:Xs});var ti=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)} @@ -355,11 +355,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} -}`;function ei(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=ft(e.textContent),n=e.closest(".algorithm, section"),r=ni(e),o=[...n.querySelectorAll("var")].filter((e=>ft(e.textContent)===t&&e.closest(".algorithm, section")===n)),s=o[0].classList.contains("respec-hl");if(ti.set(r,s),s)return o.forEach((e=>ri(e,r))),[];o.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return o}(t),r=()=>{const e=ni(t);n.forEach((t=>ri(t,e))),[...ti.keys()].forEach((e=>ti.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const ti=new Map([["respec-hl-c1",!0],["respec-hl-c2",!0],["respec-hl-c3",!0],["respec-hl-c4",!0],["respec-hl-c5",!0],["respec-hl-c6",!0],["respec-hl-c7",!0]]);function ni(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===ti.get("respec-hl-c1")?"respec-hl-c1":[...ti.keys()].find((e=>ti.get(e)))||"respec-hl-c1"}function ri(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var oi=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=Ys,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",ei))),s("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(ri)}))}});var si=String.raw`:root{--assertion-border:#aaa;--assertion-bg:#eee;--assertion-text:black} +}`;function ni(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=dt(e.textContent),n=e.closest(".algorithm, section"),r=oi(e),o=[...n.querySelectorAll("var")].filter((e=>dt(e.textContent)===t&&e.closest(".algorithm, section")===n)),s=o[0].classList.contains("respec-hl");if(ri.set(r,s),s)return o.forEach((e=>si(e,r))),[];o.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return o}(t),r=()=>{const e=oi(t);n.forEach((t=>si(t,e))),[...ri.keys()].forEach((e=>ri.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const ri=new Map([["respec-hl-c1",!0],["respec-hl-c2",!0],["respec-hl-c3",!0],["respec-hl-c4",!0],["respec-hl-c5",!0],["respec-hl-c6",!0],["respec-hl-c7",!0]]);function oi(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===ri.get("respec-hl-c1")?"respec-hl-c1":[...ri.keys()].find((e=>ri.get(e)))||"respec-hl-c1"}function si(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var ii=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=ti,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",ni))),Dt("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(si)}))}});var ai=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 ii=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(Ye`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=si,document.head.appendChild(t)}});const ai="core/anchor-expander";function ci(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Tt(`Found matching element "${t}", but it has no title or marker.`,ai,{title:"Missing title.",elements:[n]})}const o=Et(r);n.append(...o.childNodes),n.classList.add("box-ref")}function li(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Tt(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,ai,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...Et(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...o),n.classList.add("fig-ref");const s=r.querySelector(".fig-title");!n.hasAttribute("title")&&s&&(n.title=ft(s.textContent))}function ui(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Tt(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,ai,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...Et(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...o),n.classList.add("table-ref");const s=r.querySelector(".table-title");!n.hasAttribute("title")&&s&&(n.title=ft(s.textContent))}function di(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)pi(r,n),fi(r,n);else{n.textContent=n.getAttribute("href");Tt("Found matching section, but the section was lacking a heading element.",ai,{title:`No matching id in document: "${t}".`,elements:[n]})}}function pi(e,t){const n=e.querySelector(".self-link"),r=[...Et(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=yt(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function fi(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const o=t.closest(`[${n}]`);o&&o.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var hi=Object.freeze({__proto__:null,name:ai,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":pi(n,t);break;case"section":di(n,e,t);break;case"figure":li(n,e,t);break;case"table":ui(n,e,t);break;case"aside":case"div":ci(n,e,t);break;default:t.textContent=t.getAttribute("href");Tt("ReSpec doesn't support expanding this kind of reference.",ai,{title:`Can't expand "#${e}".`,elements:[t]})}fi(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Tt(`Couldn't expand inline reference. The id "${e}" is not in the document.`,ai,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var mi=String.raw`dfn{cursor:pointer} +}`;var ci=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(Je`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=ai,document.head.appendChild(t)}});const li="core/anchor-expander";function ui(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Lt(`Found matching element "${t}", but it has no title or marker.`,li,{title:"Missing title.",elements:[n]})}const o=$t(r);n.append(...o.childNodes),n.classList.add("box-ref")}function di(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Lt(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,li,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...$t(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...o),n.classList.add("fig-ref");const s=r.querySelector(".fig-title");!n.hasAttribute("title")&&s&&(n.title=dt(s.textContent))}function pi(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Lt(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,li,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...$t(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...o),n.classList.add("table-ref");const s=r.querySelector(".table-title");!n.hasAttribute("title")&&s&&(n.title=dt(s.textContent))}function fi(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)hi(r,n),mi(r,n);else{n.textContent=n.getAttribute("href");Lt("Found matching section, but the section was lacking a heading element.",li,{title:`No matching id in document: "${t}".`,elements:[n]})}}function hi(e,t){const n=e.querySelector(".self-link"),r=[...$t(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=bt(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function mi(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const o=t.closest(`[${n}]`);o&&o.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n))}}var gi=Object.freeze({__proto__:null,name:li,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":hi(n,t);break;case"section":fi(n,e,t);break;case"figure":di(n,e,t);break;case"table":pi(n,e,t);break;case"aside":case"div":ui(n,e,t);break;default:t.textContent=t.getAttribute("href");Lt("ReSpec doesn't support expanding this kind of reference.",li,{title:`Can't expand "#${e}".`,elements:[t]})}mi(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Lt(`Couldn't expand inline reference. The id "${e}" is not in the document.`,li,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var bi=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} @@ -376,7 +376,7 @@ var.respec-hl{background:0 0;color:#000;box-shadow:unset} .dfn-panel a[href]:hover{border-bottom-width:1px} .dfn-panel ul{padding:0} .dfn-panel li{margin-left:1em} -.dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto}`;function gi(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),o=`dfn-panel-for-${e.id}`,s=e.getAttribute("aria-label")||ft(e.textContent),i=Ye` +.dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto}`;function wi(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),o=`dfn-panel-for-${e.id}`,s=e.getAttribute("aria-label")||dt(e.textContent),i=Je` <div class="dfn-panel" id="${o}" @@ -393,11 +393,11 @@ var.respec-hl{background:0 0;color:#000;box-shadow:unset} aria-label="Permalink for definition: ${s}. Activate to close this dialog." >Permalink</a > - ${function(e){return e.matches("dfn[data-export]")?Ye`<span + ${function(e){return e.matches("dfn[data-export]")?Je`<span class="marker dfn-exported" title="Definition can be referenced by other specifications" >exported</span - >`:null}(e)} ${function(e,t){if(!e.hasAttribute("data-idl"))return null;for(const n of t){if(n.dataset.linkType!==e.dataset.dfnType)continue;const t=n.closest("pre.idl");if(t&&t.id){const e=`#${t.id}`;return Ye`<a + >`:null}(e)} ${function(e,t){if(!e.hasAttribute("data-idl"))return null;for(const n of t){if(n.dataset.linkType!==e.dataset.dfnType)continue;const t=n.closest("pre.idl");if(t&&t.id){const e=`#${t.id}`;return Je`<a href="${e}" class="marker idl-block" title="Jump to IDL declaration" @@ -405,16 +405,16 @@ var.respec-hl{background:0 0;color:#000;box-shadow:unset} >`}}return null}(e,r)} </div> <p><b>Referenced in:</b></p> - ${function(e,t){if(!t.length)return Ye`<ul> + ${function(e,t){if(!t.length)return Je`<ul> <li>Not referenced in this document.</li> - </ul>`;const n=new Map;t.forEach(((t,r)=>{const o=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=o);const s=function(e){const t=e.closest("section");if(!t)return null;const n=t.querySelector("h1, h2, h3, h4, h5, h6");return n?`Ā§ ${ft(n.textContent)}`:null}(t);(n.get(s)||n.set(s,[]).get(s)).push(o)}));const r=([e,t])=>[{title:e,id:t[0],text:e}].concat(t.slice(1).map(((e,t)=>({title:`Reference ${t+2}`,text:`(${t+2})`,id:e})))),o=e=>Ye`<li> - ${r(e).map((e=>Ye`<a href="#${e.id}" title="${e.title}">${e.text}</a + </ul>`;const n=new Map;t.forEach(((t,r)=>{const o=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=o);const s=function(e){const t=e.closest("section");if(!t)return null;const n=t.querySelector("h1, h2, h3, h4, h5, h6");return n?`Ā§ ${dt(n.textContent)}`:null}(t);(n.get(s)||n.set(s,[]).get(s)).push(o)}));const r=([e,t])=>[{title:e,id:t[0],text:e}].concat(t.slice(1).map(((e,t)=>({title:`Reference ${t+2}`,text:`(${t+2})`,id:e})))),o=e=>Je`<li> + ${r(e).map((e=>Je`<a href="#${e.id}" title="${e.title}">${e.text}</a >${" "}`))} - </li>`;return Ye`<ul> + </li>`;return Je`<ul> ${[...n].map(o)} </ul>`}(t,r)} </div> - `;return i}var bi=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(Ye`<style> - ${mi} - </style>`,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(gi(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");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 Wi}))).default}catch{return Is("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});var wi=Object.freeze({__proto__:null,name:"core/dfn-contract",run:function(){!function(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}(),function(){const e=document.querySelectorAll("dl.definitions dt:has(dfn[data-dfn-type])");for(const t of e){const e=t.querySelector("dfn[data-dfn-type]").id,n=t.nextElementSibling;n&&!n.dataset.defines&&e&&(n.dataset.defines=`#${e}`)}const t=document.querySelectorAll(".definition:has(dfn[data-dfn-type])");for(const e of t){const t=e.querySelector("dfn[data-dfn-type]");t.id&&!e.dataset.defines&&(e.dataset.defines=`#${t.id}`)}}()}});const yi="core/linter-rules/check-charset",vi=ht({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ `<meta>` ꠇē­¾",hint:'å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ `<head>` éƒØ分ā€”ā€” `<meta charset="utf-8">` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚'}});var ki=Object.freeze({__proto__:null,name:yi,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||Rt(vi.msg,yi,{hint:vi.hint,elements:[...t]})}});const xi="core/linter-rules/check-punctuation",$i=[".",":","!","?"],_i=ht({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${$i.map((e=>`"${e}"`)).join(", ")}.`}});var Ei=Object.freeze({__proto__:null,name:xi,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${$i.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&Rt(_i.msg,xi,{hint:_i.hint,elements:n})}});const Si="core/linter-rules/local-refs-exist",Ci=ht({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function Li(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Ai=Object.freeze({__proto__:null,name:Si,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Li);t.length&&Rt(Ci.msg,Si,{hint:Ci.hint,elements:t})}});const Ti="core/linter-rules/no-headingless-sections",Ri=ht({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂",hint:"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂"}});var Ni=Object.freeze({__proto__:null,name:Ti,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,#abstract,#sotd)")].filter((({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement)));t.length&&Rt(Ri.msg,Ti,{hint:Ri.hint,elements:t})}});const ji="core/linter-rules/no-unused-vars",Pi=ht({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var Ii=Object.freeze({__proto__:null,name:ji,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const o=new Map;for(const e of r){const t=ft(e.textContent);(o.get(t)||o.set(t,[]).get(t)).push(e)}for(const e of o.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&Rt(Pi.msg,ji,{hint:Pi.hint,elements:t})}});const Oi="core/linter-rules/privsec-section",zi=ht({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."}});var Di=Object.freeze({__proto__:null,name:Oi,run:function(e){var t;e.lint?.["privsec-section"]&&e.isRecTrack&&(t=document,!Array.from(t.querySelectorAll("h2, h3, h4, h5, h6")).some((({textContent:e})=>{const t=/(privacy|security)/im.test(e),n=/(considerations)/im.test(e);return t&&n||t})))&&Rt(zi.msg,Oi,{hint:zi.hint})}});const qi="core/linter-rules/no-http-props",Mi=ht({en:{msg:Ot`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:Ot`${"[respecConfig]"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,hint:"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š"}});var Bi=Object.freeze({__proto__:null,name:qi,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter((t=>t.endsWith("URI")&&e[t]||"prevED"===t)).filter((t=>new URL(e[t],parent.location.href).href.startsWith("http://")));if(t.length){const e=pt(t,(e=>Ot`${`[${e}]`}`));Rt(Mi.msg,qi,{hint:Mi.hint+e})}}}),Fi=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'}),Wi=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 <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); + `;return i}var yi=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(Je`<style> + ${bi} + </style>`,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(wi(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");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 Ui}))).default}catch{return zs("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});var vi=Object.freeze({__proto__:null,name:"core/dfn-contract",run:function(){!function(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}(),function(){const e=document.querySelectorAll("dl.definitions dt:has(dfn[data-dfn-type])");for(const t of e){const e=t.querySelector("dfn[data-dfn-type]").id,n=t.nextElementSibling;n&&!n.dataset.defines&&e&&(n.dataset.defines=`#${e}`)}const t=document.querySelectorAll(".definition:has(dfn[data-dfn-type])");for(const e of t){const t=e.querySelector("dfn[data-dfn-type]");t.id&&!e.dataset.defines&&(e.dataset.defines=`#${t.id}`)}}()}});const ki="core/linter-rules/check-charset",xi=pt({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ `<meta>` ꠇē­¾",hint:'å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ `<head>` éƒØ分ā€”ā€” `<meta charset="utf-8">` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚'}});var $i=Object.freeze({__proto__:null,name:ki,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||At(xi.msg,ki,{hint:xi.hint,elements:[...t]})}});const _i="core/linter-rules/check-punctuation",Ei=[".",":","!","?"],Si=pt({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Ei.map((e=>`"${e}"`)).join(", ")}.`}});var Ci=Object.freeze({__proto__:null,name:_i,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Ei.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&At(Si.msg,_i,{hint:Si.hint,elements:n})}});const Li="core/linter-rules/local-refs-exist",Ai=pt({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function Ti(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Ri=Object.freeze({__proto__:null,name:Li,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Ti);t.length&&At(Ai.msg,Li,{hint:Ai.hint,elements:t})}});const Ni="core/linter-rules/no-headingless-sections",ji=pt({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂",hint:"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂"}});var Pi=Object.freeze({__proto__:null,name:Ni,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,#abstract,#sotd)")].filter((({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement)));t.length&&At(ji.msg,Ni,{hint:ji.hint,elements:t})}});const Ii="core/linter-rules/no-unused-vars",Oi=pt({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var zi=Object.freeze({__proto__:null,name:Ii,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const o=new Map;for(const e of r){const t=dt(e.textContent);(o.get(t)||o.set(t,[]).get(t)).push(e)}for(const e of o.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&At(Oi.msg,Ii,{hint:Oi.hint,elements:t})}});const Di="core/linter-rules/privsec-section",qi=pt({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."}});var Mi=Object.freeze({__proto__:null,name:Di,run:function(e){var t;e.lint?.["privsec-section"]&&e.isRecTrack&&(t=document,!Array.from(t.querySelectorAll("h2, h3, h4, h5, h6")).some((({textContent:e})=>{const t=/(privacy|security)/im.test(e),n=/(considerations)/im.test(e);return t&&n||t})))&&At(qi.msg,Di,{hint:qi.hint})}});const Bi="core/linter-rules/no-http-props",Fi=pt({en:{msg:Pt`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:Pt`${"[respecConfig]"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,hint:"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š"}});var Wi=Object.freeze({__proto__:null,name:Bi,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter((t=>t.endsWith("URI")&&e[t]||"prevED"===t)).filter((t=>new URL(e[t],parent.location.href).href.startsWith("http://")));if(t.length){const e=ut(t,(e=>Pt`${`[${e}]`}`));At(Fi.msg,Bi,{hint:Fi.hint+e})}}}),Hi=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'}),Ui=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 <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); //# sourceMappingURL=respec-geonovum.js.map diff --git a/builds/respec-geonovum.js.map b/builds/respec-geonovum.js.map index 2a3b7255bc..7e6a7a0e02 100644 --- a/builds/respec-geonovum.js.map +++ b/builds/respec-geonovum.js.map @@ -1 +1 @@ -{"version":3,"file":"respec-geonovum.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/index.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/utils.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/geonovum.js","../src/core/location-hash.js","../src/core/defaults.js","../src/geonovum/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/geonovum/style.js","../src/geonovum/l10n.js","../src/core/github.js","../src/core/sections.js","../src/core/data-include.js","../src/core/reindent.js","../src/core/data-transform.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/geonovum/conformance.js","../src/ui/save-html.js","../src/ui/search-specref.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/data-tests.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/dfn-contract.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/no-http-props.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\n// Explicitly default lang and dir on <html> if not set.\n// We assume English and ltr as default for international standards.\nif (!html?.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html?.lang ?? \"en\";\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst transactionDoneMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(this.request);\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nconst advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance'];\nconst methodMap = {};\nconst advanceResults = new WeakMap();\nconst ittrProxiedCursorToOriginalProxy = new WeakMap();\nconst cursorIteratorTraps = {\n get(target, prop) {\n if (!advanceMethodProps.includes(prop))\n return target[prop];\n let cachedFunc = methodMap[prop];\n if (!cachedFunc) {\n cachedFunc = methodMap[prop] = function (...args) {\n advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args));\n };\n }\n return cachedFunc;\n },\n};\nasync function* iterate(...args) {\n // tslint:disable-next-line:no-this-assignment\n let cursor = this;\n if (!(cursor instanceof IDBCursor)) {\n cursor = await cursor.openCursor(...args);\n }\n if (!cursor)\n return;\n cursor = cursor;\n const proxiedCursor = new Proxy(cursor, cursorIteratorTraps);\n ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor);\n // Map this double-proxy back to the original, so other cursor methods work.\n reverseTransformCache.set(proxiedCursor, unwrap(cursor));\n while (cursor) {\n yield proxiedCursor;\n // If one of the advancing methods was not called, call continue().\n cursor = await (advanceResults.get(proxiedCursor) || cursor.continue());\n advanceResults.delete(proxiedCursor);\n }\n}\nfunction isIteratorProp(target, prop) {\n return ((prop === Symbol.asyncIterator &&\n instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) ||\n (prop === 'iterate' && instanceOfAny(target, [IDBIndex, IDBObjectStore])));\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get(target, prop, receiver) {\n if (isIteratorProp(target, prop))\n return iterate;\n return oldTraps.get(target, prop, receiver);\n },\n has(target, prop) {\n return isIteratorProp(target, prop) || oldTraps.has(target, prop);\n },\n}));\n\nexport { deleteDB, openDB, unwrap, wrap };\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (Ćæ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v12.0.2 - a markdown parser\n * Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\n/**\n * Gets the original marked default options.\n */\nfunction _getDefaults() {\n return {\n async: false,\n breaks: false,\n extensions: null,\n gfm: true,\n hooks: null,\n pedantic: false,\n renderer: null,\n silent: false,\n tokenizer: null,\n walkTokens: null\n };\n}\nlet _defaults = _getDefaults();\nfunction changeDefaults(newDefaults) {\n _defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape$1(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n }\n else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n return html;\n}\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon')\n return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\nconst caret = /(^|[^\\[])\\^/g;\nfunction edit(regex, opt) {\n let source = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n let valSource = typeof val === 'string' ? val : val.source;\n valSource = valSource.replace(caret, '$1');\n source = source.replace(name, valSource);\n return obj;\n },\n getRegex: () => {\n return new RegExp(source, opt);\n }\n };\n return obj;\n}\nfunction cleanUrl(href) {\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n }\n catch (e) {\n return null;\n }\n return href;\n}\nconst noopTest = { exec: () => null };\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false;\n let curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\')\n escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n }\n else {\n // add space before unescaped |\n return ' |';\n }\n }), cells = row.split(/ \\|/);\n let i = 0;\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) {\n cells.shift();\n }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) {\n cells.pop();\n }\n if (count) {\n if (cells.length > count) {\n cells.splice(count);\n }\n else {\n while (cells.length < count)\n cells.push('');\n }\n }\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param str\n * @param c\n * @param invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n }\n else if (currChar !== c && invert) {\n suffLen++;\n }\n else {\n break;\n }\n }\n return str.slice(0, l - suffLen);\n}\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n let level = 0;\n for (let i = 0; i < str.length; i++) {\n if (str[i] === '\\\\') {\n i++;\n }\n else if (str[i] === b[0]) {\n level++;\n }\n else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape$1(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape$1(text)\n };\n}\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n if (matchIndentToCode === null) {\n return text;\n }\n const indentToCode = matchIndentToCode[1];\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n const [indentInNode] = matchIndentInNode;\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n return node;\n })\n .join('\\n');\n}\n/**\n * Tokenizer\n */\nclass _Tokenizer {\n options;\n rules; // set by the lexer\n lexer; // set by the lexer\n constructor(options) {\n this.options = options || _defaults;\n }\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, '$1') : cap[2],\n text\n };\n }\n }\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n }\n else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n // precede setext continuation with 4 spaces so it isn't a setext\n let text = cap[0].replace(/\\n {0,3}((?:=+|-+) *)(?=\\n|$)/g, '\\n $1');\n text = rtrim(text.replace(/^ *>[ \\t]?/gm, ''), '\\n');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n let raw = '';\n let itemContents = '';\n let endsWithBlankLine = false;\n // Check if current bullet point can start a new List Item\n while (src) {\n let endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n raw = cap[0];\n src = src.substring(raw.length);\n let line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n let nextLine = src.split('\\n', 1)[0];\n let indent = 0;\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimStart();\n }\n else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n let blankLine = false;\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n // Check if following lines should be included in List Item\n while (src) {\n const rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n }\n else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n itemContents += '\\n' + nextLine;\n }\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n }\n else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n let istask = null;\n let ischecked;\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents,\n tokens: []\n });\n list.raw += raw;\n }\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimEnd();\n (list.items[list.items.length - 1]).text = itemContents.trimEnd();\n list.raw = list.raw.trimEnd();\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (let i = 0; i < list.items.length; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n list.loose = hasMultipleLineBreaks;\n }\n }\n // Set all items to loose if list is loose\n if (list.loose) {\n for (let i = 0; i < list.items.length; i++) {\n list.items[i].loose = true;\n }\n }\n return list;\n }\n }\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n block: true,\n raw: cap[0],\n pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',\n text: cap[0]\n };\n return token;\n }\n }\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline.anyPunctuation, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (!cap) {\n return;\n }\n if (!/[:|]/.test(cap[2])) {\n // delimiter row must have a pipe (|) or colon (:) otherwise it is a setext heading\n return;\n }\n const headers = splitCells(cap[1]);\n const aligns = cap[2].replace(/^\\||\\| *$/g, '').split('|');\n const rows = cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : [];\n const item = {\n type: 'table',\n raw: cap[0],\n header: [],\n align: [],\n rows: []\n };\n if (headers.length !== aligns.length) {\n // header and align columns must be equal, rows can be different.\n return;\n }\n for (const align of aligns) {\n if (/^ *-+: *$/.test(align)) {\n item.align.push('right');\n }\n else if (/^ *:-+: *$/.test(align)) {\n item.align.push('center');\n }\n else if (/^ *:-+ *$/.test(align)) {\n item.align.push('left');\n }\n else {\n item.align.push(null);\n }\n }\n for (const header of headers) {\n item.header.push({\n text: header,\n tokens: this.lexer.inline(header)\n });\n }\n for (const row of rows) {\n item.rows.push(splitCells(row, item.header.length).map(cell => {\n return {\n text: cell,\n tokens: this.lexer.inline(cell)\n };\n }));\n }\n return item;\n }\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape$1(cap[1])\n };\n }\n }\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n }\n else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n }\n else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n return {\n type: 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n block: false,\n text: cap[0]\n };\n }\n }\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n }\n else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n if (link) {\n href = link[1];\n title = link[3];\n }\n }\n else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n }\n else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline.anyPunctuation, '$1') : href,\n title: title ? title.replace(this.rules.inline.anyPunctuation, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n const linkString = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n const link = links[linkString.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrongLDelim.exec(src);\n if (!match)\n return;\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u))\n return;\n const nextChar = match[1] || match[2] || '';\n if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {\n // unicode Regex counts emoji as 1 char; spread into array for proper count (used multiple times below)\n const lLength = [...match[0]].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;\n endReg.lastIndex = 0;\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n if (!rDelim)\n continue; // skip single * in __abc*abc__\n rLength = [...rDelim].length;\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n }\n else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n delimTotal -= rLength;\n if (delimTotal > 0)\n continue; // Haven't found enough closing delimiters\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n // char length can be >1 for unicode characters;\n const lastCharLength = [...match[0]][0].length;\n const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape$1(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n autolink(src) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[1]);\n href = 'mailto:' + text;\n }\n else {\n text = escape$1(cap[1]);\n href = text;\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n url(src) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[0]);\n href = 'mailto:' + text;\n }\n else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? '';\n } while (prevCapZero !== cap[0]);\n text = escape$1(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n }\n else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n inlineText(src) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = cap[0];\n }\n else {\n text = escape$1(cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst newline = /^(?: *(?:\\n|$))+/;\nconst blockCode = /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/;\nconst fences = /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/;\nconst hr = /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/;\nconst heading = /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/;\nconst bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nconst lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\\n(?!\\s*?\\n|bull |blockCode|fences|blockquote|heading|html))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/)\n .replace(/bull/g, bullet) // lists can interrupt\n .replace(/blockCode/g, / {4}/) // indented code blocks can interrupt\n .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt\n .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n .getRegex();\nconst _paragraph = /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/;\nconst blockText = /^[^\\n]+/;\nconst _blockLabel = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nconst def = edit(/^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/)\n .replace('label', _blockLabel)\n .replace('title', /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/)\n .getRegex();\nconst list = edit(/^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/)\n .replace(/bull/g, bullet)\n .getRegex();\nconst _tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title'\n + '|tr|track|ul';\nconst _comment = /<!--(?:-?>|[\\s\\S]*?(?:-->|$))/;\nconst html = edit('^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')', 'i')\n .replace('comment', _comment)\n .replace('tag', _tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst paragraph = edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\nconst blockquote = edit(/^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/)\n .replace('paragraph', paragraph)\n .getRegex();\n/**\n * Normal Block Grammar\n */\nconst blockNormal = {\n blockquote,\n code: blockCode,\n def,\n fences,\n heading,\n hr,\n html,\n lheading,\n list,\n newline,\n paragraph,\n table: noopTest,\n text: blockText\n};\n/**\n * GFM Block Grammar\n */\nconst gfmTable = edit('^ *([^\\\\n ].*)\\\\n' // Header\n + ' {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)') // Cells\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\nconst blockGfm = {\n ...blockNormal,\n table: gfmTable,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('table', gfmTable) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex()\n};\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\nconst blockPedantic = {\n ...blockNormal,\n html: edit('^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', _comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', lheading)\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .replace('|tag', '')\n .getRegex()\n};\n/**\n * Inline-Level Grammar\n */\nconst escape = /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/;\nconst inlineCode = /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/;\nconst br = /^( {2,}|\\\\)\\n(?!\\s*$)/;\nconst inlineText = /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/;\n// list of unicode punctuation marks, plus any missing characters from CommonMark spec\nconst _punctuation = '\\\\p{P}\\\\p{S}';\nconst punctuation = edit(/^((?![*_])[\\spunctuation])/, 'u')\n .replace(/punctuation/g, _punctuation).getRegex();\n// sequences em should skip over [title](link), `code`, <html>\nconst blockSkip = /\\[[^[\\]]*?\\]\\([^\\(\\)]*?\\)|`[^`]*?`|<[^<>]*?>/g;\nconst emStrongLDelim = edit(/^(?:\\*+(?:((?!\\*)[punct])|[^\\s*]))|^_+(?:((?!_)[punct])|([^\\s_]))/, 'u')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst emStrongRDelimAst = edit('^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)' // Skip orphan inside strong\n + '|[^*]+(?=[^*])' // Consume to delim\n + '|(?!\\\\*)[punct](\\\\*+)(?=[\\\\s]|$)' // (1) #*** can only be a Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?!\\\\*)(?=[punct\\\\s]|$)' // (2) a***#, a*** can only be a Right Delimiter\n + '|(?!\\\\*)[punct\\\\s](\\\\*+)(?=[^punct\\\\s])' // (3) #***a, ***a can only be Left Delimiter\n + '|[\\\\s](\\\\*+)(?!\\\\*)(?=[punct])' // (4) ***# can only be Left Delimiter\n + '|(?!\\\\*)[punct](\\\\*+)(?!\\\\*)(?=[punct])' // (5) #***# can be either Left or Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?=[^punct\\\\s])', 'gu') // (6) a***a can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\n// (6) Not allowed for _\nconst emStrongRDelimUnd = edit('^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)' // Skip orphan inside strong\n + '|[^_]+(?=[^_])' // Consume to delim\n + '|(?!_)[punct](_+)(?=[\\\\s]|$)' // (1) #___ can only be a Right Delimiter\n + '|[^punct\\\\s](_+)(?!_)(?=[punct\\\\s]|$)' // (2) a___#, a___ can only be a Right Delimiter\n + '|(?!_)[punct\\\\s](_+)(?=[^punct\\\\s])' // (3) #___a, ___a can only be Left Delimiter\n + '|[\\\\s](_+)(?!_)(?=[punct])' // (4) ___# can only be Left Delimiter\n + '|(?!_)[punct](_+)(?!_)(?=[punct])', 'gu') // (5) #___# can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst anyPunctuation = edit(/\\\\([punct])/, 'gu')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst autolink = edit(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/)\n .replace('scheme', /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/)\n .replace('email', /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/)\n .getRegex();\nconst _inlineComment = edit(_comment).replace('(?:-->|$)', '-->').getRegex();\nconst tag = edit('^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>') // CDATA section\n .replace('comment', _inlineComment)\n .replace('attribute', /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst _inlineLabel = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\nconst link = edit(/^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/)\n .replace('label', _inlineLabel)\n .replace('href', /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/)\n .replace('title', /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/)\n .getRegex();\nconst reflink = edit(/^!?\\[(label)\\]\\[(ref)\\]/)\n .replace('label', _inlineLabel)\n .replace('ref', _blockLabel)\n .getRegex();\nconst nolink = edit(/^!?\\[(ref)\\](?:\\[\\])?/)\n .replace('ref', _blockLabel)\n .getRegex();\nconst reflinkSearch = edit('reflink|nolink(?!\\\\()', 'g')\n .replace('reflink', reflink)\n .replace('nolink', nolink)\n .getRegex();\n/**\n * Normal Inline Grammar\n */\nconst inlineNormal = {\n _backpedal: noopTest, // only used for GFM url\n anyPunctuation,\n autolink,\n blockSkip,\n br,\n code: inlineCode,\n del: noopTest,\n emStrongLDelim,\n emStrongRDelimAst,\n emStrongRDelimUnd,\n escape,\n link,\n nolink,\n punctuation,\n reflink,\n reflinkSearch,\n tag,\n text: inlineText,\n url: noopTest\n};\n/**\n * Pedantic Inline Grammar\n */\nconst inlinePedantic = {\n ...inlineNormal,\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', _inlineLabel)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', _inlineLabel)\n .getRegex()\n};\n/**\n * GFM Inline Grammar\n */\nconst inlineGfm = {\n ...inlineNormal,\n escape: edit(escape).replace('])', '~|])').getRegex(),\n url: edit(/^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/, 'i')\n .replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/)\n .getRegex(),\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n};\n/**\n * GFM + Line Breaks Inline Grammar\n */\nconst inlineBreaks = {\n ...inlineGfm,\n br: edit(br).replace('{2,}', '*').getRegex(),\n text: edit(inlineGfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n/**\n * exports\n */\nconst block = {\n normal: blockNormal,\n gfm: blockGfm,\n pedantic: blockPedantic\n};\nconst inline = {\n normal: inlineNormal,\n gfm: inlineGfm,\n breaks: inlineBreaks,\n pedantic: inlinePedantic\n};\n\n/**\n * Block Lexer\n */\nclass _Lexer {\n tokens;\n options;\n state;\n tokenizer;\n inlineQueue;\n constructor(options) {\n // TokenList cannot be created in one go\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || _defaults;\n this.options.tokenizer = this.options.tokenizer || new _Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n }\n else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n }\n else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new _Lexer(options);\n return lexer.lex(src);\n }\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new _Lexer(options);\n return lexer.inlineTokens(src);\n }\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n this.blockTokens(src, this.tokens);\n for (let i = 0; i < this.inlineQueue.length; i++) {\n const next = this.inlineQueue[i];\n this.inlineTokens(next.src, next.tokens);\n }\n this.inlineQueue = [];\n return this.tokens;\n }\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n }\n else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n let token;\n let lastToken;\n let cutSrc;\n let lastParagraphClipped;\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unnecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n this.state.top = true;\n return tokens;\n }\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n // Mask out escaped characters\n while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);\n }\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // autolink\n if (token = this.tokenizer.autolink(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass _Renderer {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/^\\S*/)?.[0];\n code = code.replace(/\\n$/, '') + '\\n';\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n return '<pre><code class=\"language-'\n + escape$1(lang)\n + '\">'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n html(html, block) {\n return html;\n }\n heading(text, level, raw) {\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n hr() {\n return '<hr>\\n';\n }\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul';\n const startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n listitem(text, task, checked) {\n return `<li>${text}</li>\\n`;\n }\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\">';\n }\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n table(header, body) {\n if (body)\n body = `<tbody>${body}</tbody>`;\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n /**\n * span level renderer\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n em(text) {\n return `<em>${text}</em>`;\n }\n codespan(text) {\n return `<code>${text}</code>`;\n }\n br() {\n return '<br>';\n }\n del(text) {\n return `<del>${text}</del>`;\n }\n link(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n image(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += '>';\n return out;\n }\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass _TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n em(text) {\n return text;\n }\n codespan(text) {\n return text;\n }\n del(text) {\n return text;\n }\n html(text) {\n return text;\n }\n text(text) {\n return text;\n }\n link(href, title, text) {\n return '' + text;\n }\n image(href, title, text) {\n return '' + text;\n }\n br() {\n return '';\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass _Parser {\n options;\n renderer;\n textRenderer;\n constructor(options) {\n this.options = options || _defaults;\n this.options.renderer = this.options.renderer || new _Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new _TextRenderer();\n }\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new _Parser(options);\n return parser.parse(tokens);\n }\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new _Parser(options);\n return parser.parseInline(tokens);\n }\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const genericToken = token;\n const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(genericToken.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n const headingToken = token;\n out += this.renderer.heading(this.parseInline(headingToken.tokens), headingToken.depth, unescape(this.parseInline(headingToken.tokens, this.textRenderer)));\n continue;\n }\n case 'code': {\n const codeToken = token;\n out += this.renderer.code(codeToken.text, codeToken.lang, !!codeToken.escaped);\n continue;\n }\n case 'table': {\n const tableToken = token;\n let header = '';\n // header\n let cell = '';\n for (let j = 0; j < tableToken.header.length; j++) {\n cell += this.renderer.tablecell(this.parseInline(tableToken.header[j].tokens), { header: true, align: tableToken.align[j] });\n }\n header += this.renderer.tablerow(cell);\n let body = '';\n for (let j = 0; j < tableToken.rows.length; j++) {\n const row = tableToken.rows[j];\n cell = '';\n for (let k = 0; k < row.length; k++) {\n cell += this.renderer.tablecell(this.parseInline(row[k].tokens), { header: false, align: tableToken.align[k] });\n }\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n const blockquoteToken = token;\n const body = this.parse(blockquoteToken.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n const listToken = token;\n const ordered = listToken.ordered;\n const start = listToken.start;\n const loose = listToken.loose;\n let body = '';\n for (let j = 0; j < listToken.items.length; j++) {\n const item = listToken.items[j];\n const checked = item.checked;\n const task = item.task;\n let itemBody = '';\n if (item.task) {\n const checkbox = this.renderer.checkbox(!!checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n }\n else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox + ' '\n });\n }\n }\n else {\n itemBody += checkbox + ' ';\n }\n }\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, !!checked);\n }\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n const htmlToken = token;\n out += this.renderer.html(htmlToken.text, htmlToken.block);\n continue;\n }\n case 'paragraph': {\n const paragraphToken = token;\n out += this.renderer.paragraph(this.parseInline(paragraphToken.tokens));\n continue;\n }\n case 'text': {\n let textToken = token;\n let body = textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text;\n while (i + 1 < tokens.length && tokens[i + 1].type === 'text') {\n textToken = tokens[++i];\n body += '\\n' + (textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'escape': {\n const escapeToken = token;\n out += renderer.text(escapeToken.text);\n break;\n }\n case 'html': {\n const tagToken = token;\n out += renderer.html(tagToken.text);\n break;\n }\n case 'link': {\n const linkToken = token;\n out += renderer.link(linkToken.href, linkToken.title, this.parseInline(linkToken.tokens, renderer));\n break;\n }\n case 'image': {\n const imageToken = token;\n out += renderer.image(imageToken.href, imageToken.title, imageToken.text);\n break;\n }\n case 'strong': {\n const strongToken = token;\n out += renderer.strong(this.parseInline(strongToken.tokens, renderer));\n break;\n }\n case 'em': {\n const emToken = token;\n out += renderer.em(this.parseInline(emToken.tokens, renderer));\n break;\n }\n case 'codespan': {\n const codespanToken = token;\n out += renderer.codespan(codespanToken.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n const delToken = token;\n out += renderer.del(this.parseInline(delToken.tokens, renderer));\n break;\n }\n case 'text': {\n const textToken = token;\n out += renderer.text(textToken.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\nclass _Hooks {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess',\n 'processAllTokens'\n ]);\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n /**\n * Process all tokens before walk tokens\n */\n processAllTokens(tokens) {\n return tokens;\n }\n}\n\nclass Marked {\n defaults = _getDefaults();\n options = this.setOptions;\n parse = this.#parseMarkdown(_Lexer.lex, _Parser.parse);\n parseInline = this.#parseMarkdown(_Lexer.lexInline, _Parser.parseInline);\n Parser = _Parser;\n Renderer = _Renderer;\n TextRenderer = _TextRenderer;\n Lexer = _Lexer;\n Tokenizer = _Tokenizer;\n Hooks = _Hooks;\n constructor(...args) {\n this.use(...args);\n }\n /**\n * Run callback for every token\n */\n walkTokens(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(this, token));\n switch (token.type) {\n case 'table': {\n const tableToken = token;\n for (const cell of tableToken.header) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n for (const row of tableToken.rows) {\n for (const cell of row) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n const listToken = token;\n values = values.concat(this.walkTokens(listToken.items, callback));\n break;\n }\n default: {\n const genericToken = token;\n if (this.defaults.extensions?.childTokens?.[genericToken.type]) {\n this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {\n const tokens = genericToken[childTokens].flat(Infinity);\n values = values.concat(this.walkTokens(tokens, callback));\n });\n }\n else if (genericToken.tokens) {\n values = values.concat(this.walkTokens(genericToken.tokens, callback));\n }\n }\n }\n }\n return values;\n }\n use(...args) {\n const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n // set async to true if it was set to true before\n opts.async = this.defaults.async || opts.async || false;\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if ('renderer' in ext) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function (...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n }\n else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if ('tokenizer' in ext) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n const extLevel = extensions[ext.level];\n if (extLevel) {\n extLevel.unshift(ext.tokenizer);\n }\n else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n }\n else {\n extensions.startBlock = [ext.start];\n }\n }\n else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n }\n else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if ('childTokens' in ext && ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = this.defaults.renderer || new _Renderer(this.defaults);\n for (const prop in pack.renderer) {\n if (!(prop in renderer)) {\n throw new Error(`renderer '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const rendererProp = prop;\n const rendererFunc = pack.renderer[rendererProp];\n const prevRenderer = renderer[rendererProp];\n // Replace renderer with func to run extension, but fall back if false\n renderer[rendererProp] = (...args) => {\n let ret = rendererFunc.apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret || '';\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);\n for (const prop in pack.tokenizer) {\n if (!(prop in tokenizer)) {\n throw new Error(`tokenizer '${prop}' does not exist`);\n }\n if (['options', 'rules', 'lexer'].includes(prop)) {\n // ignore options, rules, and lexer properties\n continue;\n }\n const tokenizerProp = prop;\n const tokenizerFunc = pack.tokenizer[tokenizerProp];\n const prevTokenizer = tokenizer[tokenizerProp];\n // Replace tokenizer with func to run extension, but fall back if false\n // @ts-expect-error cannot type tokenizer function dynamically\n tokenizer[tokenizerProp] = (...args) => {\n let ret = tokenizerFunc.apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = this.defaults.hooks || new _Hooks();\n for (const prop in pack.hooks) {\n if (!(prop in hooks)) {\n throw new Error(`hook '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const hooksProp = prop;\n const hooksFunc = pack.hooks[hooksProp];\n const prevHook = hooks[hooksProp];\n if (_Hooks.passThroughHooks.has(prop)) {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (arg) => {\n if (this.defaults.async) {\n return Promise.resolve(hooksFunc.call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n const ret = hooksFunc.call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n }\n else {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (...args) => {\n let ret = hooksFunc.apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = this.defaults.walkTokens;\n const packWalktokens = pack.walkTokens;\n opts.walkTokens = function (token) {\n let values = [];\n values.push(packWalktokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n this.defaults = { ...this.defaults, ...opts };\n });\n return this;\n }\n setOptions(opt) {\n this.defaults = { ...this.defaults, ...opt };\n return this;\n }\n lexer(src, options) {\n return _Lexer.lex(src, options ?? this.defaults);\n }\n parser(tokens, options) {\n return _Parser.parse(tokens, options ?? this.defaults);\n }\n #parseMarkdown(lexer, parser) {\n return (src, options) => {\n const origOpt = { ...options };\n const opt = { ...this.defaults, ...origOpt };\n // Show warning if an extension set async to true but the parse was called with async: false\n if (this.defaults.async === true && origOpt.async === false) {\n if (!opt.silent) {\n console.warn('marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.');\n }\n opt.async = true;\n }\n const throwError = this.#onError(!!opt.silent, !!opt.async);\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens)\n .then(tokens => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n let tokens = lexer(src, opt);\n if (opt.hooks) {\n tokens = opt.hooks.processAllTokens(tokens);\n }\n if (opt.walkTokens) {\n this.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n }\n catch (e) {\n return throwError(e);\n }\n };\n }\n #onError(silent, async) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape$1(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n return msg;\n }\n if (async) {\n return Promise.reject(e);\n }\n throw e;\n };\n }\n}\n\nconst markedInstance = new Marked();\nfunction marked(src, opt) {\n return markedInstance.parse(src, opt);\n}\n/**\n * Sets the default options.\n *\n * @param options Hash of options\n */\nmarked.options =\n marked.setOptions = function (options) {\n markedInstance.setOptions(options);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n };\n/**\n * Gets the original marked default options.\n */\nmarked.getDefaults = _getDefaults;\nmarked.defaults = _defaults;\n/**\n * Use Extension\n */\nmarked.use = function (...args) {\n markedInstance.use(...args);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n};\n/**\n * Run callback for every token\n */\nmarked.walkTokens = function (tokens, callback) {\n return markedInstance.walkTokens(tokens, callback);\n};\n/**\n * Compiles markdown to HTML without enclosing `p` tag.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options\n * @return String of compiled HTML\n */\nmarked.parseInline = markedInstance.parseInline;\n/**\n * Expose\n */\nmarked.Parser = _Parser;\nmarked.parser = _Parser.parse;\nmarked.Renderer = _Renderer;\nmarked.TextRenderer = _TextRenderer;\nmarked.Lexer = _Lexer;\nmarked.lexer = _Lexer.lex;\nmarked.Tokenizer = _Tokenizer;\nmarked.Hooks = _Hooks;\nmarked.parse = marked;\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = _Parser.parse;\nconst lexer = _Lexer.lex;\n\nexport { _Hooks as Hooks, _Lexer as Lexer, Marked, _Parser as Parser, _Renderer as Renderer, _TextRenderer as TextRenderer, _Tokenizer as Tokenizer, _defaults as defaults, _getDefaults as getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n//# sourceMappingURL=marked.esm.js.map\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralize$1 = {exports: {}};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eĆ©]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t}); \n} (pluralize$1));\n\nvar pluralizeExports = pluralize$1.exports;\nvar pluralize = /*@__PURE__*/getDefaultExportFromCjs(pluralizeExports);\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"šŸ‘»\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint });\n console.error(e);\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up šŸ˜–\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message);\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return { message, name, plugin, hint, elements, title, details, stack };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Creates showError, showWarning utilities for use in custom pre-process and\n * post-process plugins.\n * @param {string} pluginName\n */\nexport function makePluginUtils(pluginName) {\n /** @typedef {Parameters<typeof showError>[2]} Options */\n return {\n /** @type {(message: string, options?: Options) => void} */\n showError: (msg, options) => showError(msg, pluginName, options),\n /** @type {(message: string, options?: Options) => void} */\n showWarning: (msg, options) => showWarning(msg, pluginName, options),\n };\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n\n/**\n * Takes a text string, trims it, splits it into lines,\n * finds the common indentation level, and then de-indents every line\n * by that common indentation level.\n *\n * @param {string} text - The text to be re-indented.\n * @returns {string} The re-indented text.\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n background: var(--bg, #fff);\n color: rgb(120, 120, 120);\n color: var(--tocnav-normal-text, rgb(120, 120, 120));\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n box-shadow: 1px 1px 8px 0 var(--tocsidebar-shadow, rgba(100, 100, 100, 0.5));\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: var(--bg, #fff);\n color: var(--text, black);\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: var(--def-text, white);\n background: var(--def-bg, rgb(42, 90, 168));\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: var(--def-text, white);\n background: var(--defrow-border, rgb(42, 90, 168));\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: var(--tocnav-active-bg, #193766);\n color: var(--tocnav-active-text, black);\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"āš ļø\";\n}\n\n.respec-error-list > li::before {\n content: \"šŸ’„\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: var(--bg, #fff);\n color: var(--text, black);\n border: 5px solid #666;\n border-color: var(--tocsidebar-shadow, #666);\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n left: 0 !important;\n text-align: center;\n background: var(--tocsidebar-shadow, #ddd);\n color: var(--text, black);\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: var(--bg, white);\n color: var(--text, black);\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: var(--tocnav-hover-bg, #eee);\n color: var(--tocnav-hover-text, black);\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/markedjs/marked\n *\n */\n\nimport { getElementIndentation, reindent } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\n\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\n\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super\n .code(code, language, isEscaped)\n .replace(`class=\"language-`, `class=\"`);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw);\n }\n}\n\n/** @type {import('marked').MarkedOptions} */\nconst config = {\n gfm: true,\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport { reindent, xmlEscape } from \"./utils.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n āŒ\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}ā€¦\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${xmlEscape(err.message)}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/geonovum/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/geonovum/style.js\"),\n import(\"../src/geonovum/l10n.js\"),\n import(\"../src/core/github.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/geonovum/conformance.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/search-specref.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/data-tests.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/dfn-contract.js\"),\n /* Linter must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/core/linter-rules/privsec-section.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// As ReSpec injects a bunch of stuff async, the scroll position is not always\n// at the right place when we are done processing. The purpose of this module\n// is to reset window's location hash, which will cause the browser to scroll\n// the window to the correct point in the document when processing is done.\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!window.location.hash) {\n return;\n }\n\n // We have to use .then() here because otherwise we would get stuck\n // awaiting this plugin to finish.\n document.respec.ready.then(() => {\n const hash = decodeURIComponent(window.location.hash).slice(1);\n\n let newHash = hash;\n /** @type {HTMLElement|null} */\n const element = document.getElementById(newHash);\n\n // Check if hash contains any non-word character.\n const isLegacyFrag = /\\W/.test(newHash);\n\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/speced/respec/issues/1353\n if (!element && isLegacyFrag) {\n const id = newHash\n // Replace all non-word characters with a dash.\n .replace(/[\\W]+/gim, \"-\")\n // Remove any leading dashes.\n .replace(/^-+/, \"\")\n // Remove any trailing dashes.\n .replace(/-+$/, \"\");\n\n /** @type {HTMLElement|null} */\n const updatedElement = document.getElementById(id);\n if (updatedElement) {\n newHash = id;\n }\n }\n window.location.hash = `#${newHash}`;\n });\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for Geonovum documents\n */\nexport const name = \"geonovum/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst licenses = new Map([\n [\n \"cc0\",\n {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n ],\n [\n \"cc-by\",\n {\n name: \"Creative Commons Attribution 4.0 International Public License\",\n short: \"CC-BY\",\n url: \"https://creativecommons.org/licenses/by/4.0/legalcode\",\n },\n ],\n [\n \"cc-by-nd\",\n {\n name: \"Creative Commons Attribution-NoDerivatives 4.0 International Public License\",\n short: \"CC-BY-ND\",\n url: \"https://creativecommons.org/licenses/by-nd/4.0/legalcode.nl\",\n },\n ],\n]);\n\nconst geonovumDefaults = {\n lint: {\n \"privsec-section\": true,\n },\n doJsonLd: true,\n license: \"cc-by\",\n specStatus: \"GN-BASIS\",\n logos: [\n {\n src: \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg\",\n alt: \"Geonovum\",\n id: \"Geonovum\",\n height: 67,\n width: 132,\n url: \"https://www.geonovum.nl/\",\n },\n ],\n};\n\nfunction computeProps(conf) {\n return {\n isCCBY: conf.license === \"cc-by\",\n licenseInfo: licenses.get(conf.license),\n isBasic: conf.specStatus === \"GN-BASIS\",\n isRegular: conf.specStatus === \"GN-BASIS\",\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...geonovumDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...geonovumDefaults,\n ...conf,\n lint,\n });\n // computed properties\n Object.assign(conf, computeProps(conf));\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOF --- */\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"Ā§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// The purpose of this module is to insert the default ReSpec CSS into the document.\n// If you don't want to use the default ReSpec CSS, set the `noReSpecCSS` configuration\n// option to `true`. If you want to use your own styles, create a ReSpec profile that\n// includes your own styles and sets the `noReSpecCSS` configuration option to `true`.\n\n/**\n * Module Name.\n * @type {string}\n */\nexport const name = \"core/style\";\n\nimport css from \"../styles/respec.css.js\";\n\n// Opportunistically inserts the style to reduce some FOUC.\n/** @type {HTMLStyleElement} */\nconst styleElement = insertStyle();\n\n/**\n * Inserts the ReSpec CSS as a `style` element into the document's `head`.\n * @return {HTMLStyleElement} The `style` element that was inserted.\n */\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\n/**\n * Removes the ReSpec CSS if the `noReSpecCSS` configuration option is `true`.\n * @param {Conf} conf The document configuration object.\n */\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n// Module geonovum/style\n// Inserts a link to the appropriate Geonovum style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport {\n createResourceHint,\n linkCSS,\n showWarning,\n toKeyValuePairs,\n} from \"../core/utils.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"geonovum/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n script.addEventListener(\n \"load\",\n () => {\n if (window.location.hash) {\n window.location.href = window.location.hash;\n }\n },\n { once: true }\n );\n script.src = `https://www.w3.org/scripts/TR/${version}/fixup.js`;\n doc.body.appendChild(script);\n}\n\n/**\n * Make a best effort to attach meta viewport at the top of the head.\n * Other plugins might subsequently push it down, but at least we start\n * at the right place. When ReSpec exports the HTML, it again moves the\n * meta viewport to the top of the head - so to make sure it's the first\n * thing the browser sees. See js/ui/save-html.js.\n */\nfunction createMetaViewport() {\n const meta = document.createElement(\"meta\");\n meta.name = \"viewport\";\n const contentProps = {\n width: \"device-width\",\n \"initial-scale\": \"1\",\n \"shrink-to-fit\": \"no\",\n };\n meta.content = toKeyValuePairs(contentProps).replace(/\"/g, \"\");\n return meta;\n}\n\nfunction createStyle(css_name) {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = `https://tools.geostandaarden.nl/respec/style/${css_name}.css`;\n return link;\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C fixup.js\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2016/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preconnect\", // for Geonovum styles and scripts.\n href: \"https://tools.geostandaarden.nl/\",\n },\n {\n hint: \"preload\", // all Geonovum specs import base.css.\n href: \"https://tools.geostandaarden.nl/respec/style/base.css\",\n as: \"style\",\n },\n {\n hint: \"preload\", // all Geonovum specs show the logo.\n href: \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg\",\n as: \"image\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// add favicon for Geonovum\nconst favicon = document.createElement(\"link\");\nfavicon.rel = \"shortcut icon\";\nfavicon.type = \"image/x-icon\";\nfavicon.href =\n \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.ico\";\ndocument.head.prepend(favicon);\n\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(createMetaViewport());\n}\n\ndocument.head.prepend(elements);\n\n// export function run(conf, doc, cb) {\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"`respecConfig.specStatus` missing. Defaulting to 'GN-BASIS'.\";\n conf.specStatus = \"GN-BASIS\";\n showWarning(msg, name);\n }\n\n if (document.body.querySelector(\"figure.scalable\")) {\n // Apply leaflet style if class scalable is present\n document.head.appendChild(createStyle(\"leaflet\"));\n document.head.appendChild(createStyle(\"font-awesome\"));\n }\n\n let styleFile = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"GN-WV\":\n styleFile += \"GN-WV.css\";\n break;\n case \"GN-CV\":\n styleFile += \"GN-CV.css\";\n break;\n case \"GN-VV\":\n styleFile += \"GN-VV.css\";\n break;\n case \"GN-DEF\":\n styleFile += \"GN-DEF.css\";\n break;\n case \"GN-BASIS\":\n styleFile += \"GN-BASIS.css\";\n break;\n default:\n styleFile = \"base.css\";\n }\n\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://tools.geostandaarden.nl/respec/style/${styleFile}`;\n linkCSS(document, finalStyleURL);\n}\n","// @ts-check\n// Module geonovum/l10n\n// Looks at the lang attribute on the root element and uses it to manage the config.l10n object so\n// that other parts of the system can localise their text\nimport { html } from \"../core/import-maps.js\";\nimport { l10n } from \"../core/l10n.js\";\nexport const name = \"geonovum/l10n\";\nconst additions = {\n en: {\n status_at_publication: html`This section describes the status of this\n document at the time of its publication. Other documents may supersede\n this document. A list of current Geonovum publications and the latest\n revision of this document can be found via\n <a href=\"https://www.geonovum.nl/geo-standaarden/alle-standaarden\"\n >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a\n >(in Dutch).`,\n },\n nl: {\n status_at_publication: html`Deze paragraaf beschrijft de status van dit\n document ten tijde van publicatie. Het is mogelijk dat er actuelere\n versies van dit document bestaan. Een lijst van Geonovum publicaties en de\n laatste gepubliceerde versie van dit document zijn te vinden op\n <a href=\"https://www.geonovum.nl/geo-standaarden/alle-standaarden\"\n >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a\n >.`,\n },\n};\n\nObject.keys(additions).forEach(key => {\n if (!l10n[key]) l10n[key] = {};\n Object.assign(l10n[key], additions[key]);\n});\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/speced/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"ģ°øģ—¬\",\n },\n zh: {\n file_a_bug: \"反馈错čÆÆ\",\n participate: \"参äøŽļ¼š\",\n },\n ja: {\n commit_history: \"å¤‰ę›“å±„ę­“\",\n file_a_bug: \"問锌報告\",\n participate: \"å‚åŠ ę–¹ę³•ļ¼š\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${ghURL.href}).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n console.error(msg, el, err);\n showError(msg, name, { elements: [el] });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","// @ts-check\n/**\n * @module core/reindent\n *\n * Normalizes indents across the pre elements in the document,\n * so that indentation inside <pre> won't affect the rendered result.\n */\nimport { reindent } from \"./utils.js\";\nexport const name = \"core/reindent\";\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/speced/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"ģ°øģ”°\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参ē…§ē”Øå‚č€ƒę–‡ēŒ®\",\n norm_references: \"č¦ēƄēš„å‚č€ƒę–‡ēŒ®\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n de: {\n info_references: \"WeiterfĆ¼hrende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"éžč§„čŒƒę€§å¼•ē”Ø\",\n norm_references: \"č§„čŒƒę€§å¼•ē”Ø\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMƜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NƖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDƜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKƖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;\"?<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn or a `a`, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn,a\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn|abstract-op\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n /** @param {string} str */\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"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`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"ģ˜ˆģ‹œ\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-color: var(--warning-border, #f11);\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n background: var(--warning-bg, #fbe9e9);\n color: black;\n color: var(--text, black);\n}\n\n.warning-title:before {\n content: \"āš \"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"ę³Ø\",\n editors_note: \"ē·Ø者ę³Ø\",\n feature_at_risk: \"(å¤‰ę›“ć®åÆčƒ½ę€§ć®ć‚ć‚‹ę©Ÿčƒ½) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 恮要ē“„\",\n no_issues_in_spec: \"ć“ć®ä»•ę§˜ć«ćÆęœŖč§£ę±ŗ恮 issues ćÆå«ć¾ć‚Œć¦ć„ć¾ć›ć‚“ļ¼Ž\",\n warning: \"č­¦å‘Š\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"CuestiĆ³n\",\n issue_summary: \"Resumen de la cuestiĆ³n\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificaciĆ³n.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthƤlt keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"ē¼–者ę³Ø\",\n feature_at_risk: \"ļ¼ˆęœ‰åÆčƒ½å˜åŠØēš„ē‰¹ę€§ļ¼‰Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue ꀻē»“\",\n no_issues_in_spec: \"ęœ¬č§„čŒƒäø­ęœŖ列å‡ŗ任何 issue怂\",\n note: \"ę³Ø\",\n warning: \"č­¦å‘Š\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"꜀č‰Æå®Ÿę–½ä¾‹ \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"ęœ€ä½³å®žč·µ \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"å›³ć®ćƒŖć‚¹ćƒˆ\",\n },\n ko: {\n fig: \"ź·øė¦¼ \",\n list_of_figures: \"ź·øė¦¼ ėŖ©ė”\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范äø­åŒ…含ēš„图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of the specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n *\n * @module core/data-cite\n */\n\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to the current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n * @type {string}\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * Gets the link properties for the given citation details.\n * @param {CiteDetails} citeDetails - The citation details.\n * @returns {Promise<LinkProps|null>} The link properties or null if not found.\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/speced/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n\n return { href, title };\n}\n\n/**\n * Links the given element with the provided link properties and citation details.\n * @param {HTMLElement} elem - The element to link.\n * @param {LinkProps} linkProps - The link properties.\n * @param {CiteDetails} citeDetails - The citation details.\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n anchor.dataset.cite = citeDetails.key;\n anchor.dataset.citePath = citeDetails.path;\n anchor.dataset.citeFrag = citeDetails.frag;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting a linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * Converts the given raw key to citation details.\n * @param {HTMLElement} elem - The element containing the citation details.\n * @returns {CiteDetails} The citation details.\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as a fragment\n return toCiteDetails(elem);\n }\n\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\n/**\n * Runs the data-cite processing on elements with the data-cite attribute.\n */\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetches and updates `biblio` with entries corresponding to the given elements.\n * @param {HTMLElement[]} elems - The elements requiring biblio entries.\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/**\n * Cleans up the data-cite attributes from the document.\n * @param {Document} doc - The document to cleanup.\n */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ć®é‡č¤‡å®šē¾©`;\n },\n duplicateTitle: \"恓恮ꖇę›øå†…ć§č¤‡ę•°å›žå®šē¾©ć•ć‚Œć¦ć„ć¾ć™ļ¼Ž\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthƤlt mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ēš„重复定义`;\n },\n duplicateTitle: \"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n for (const type of linkType.split(\"|\")) {\n if (dfnsByType.get(type)) {\n return dfnsByType.get(type);\n }\n }\n return dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name);\n console.error(error);\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大ēŗ²\",\n },\n ko: {\n toc: \"ėŖ©ģ°Ø\",\n },\n ja: {\n toc: \"ē›®ę¬”\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at Ā§1, we will keep Ā§1.1 but not Ā§1.1.1\n // Similarly, `data-max-toc=1` will keep Ā§1, but not Ā§1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"ģ“ ė¶€ė¶„ģ€ ė¹„ź·œė²”ģ ģž…ė‹ˆė‹¤.\",\n },\n ja: {\n informative: \"恓恮ēƀćÆä»•ę§˜ć«ćÆå«ć¾ć‚Œć¾ć›ć‚“ļ¼Ž\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module geonovum/conformance\n// Handle the conformance section properly.\n// based on W3C conformance, but because Geonovum has different requirements, have a separate module\nimport { html } from \"../core/import-maps.js\";\nexport const name = \"geonovum/conformance\";\n\n/**\n * @param {Element} conformance\n */\nfunction processConformance(conformance) {\n const content = html`\n <h2>Conformiteit</h2>\n <p>\n Naast onderdelen die als niet normatief gemarkeerd zijn, zijn ook alle\n diagrammen, voorbeelden, en noten in dit document niet normatief. Verder\n is alles in dit document normatief.\n </p>\n <p>Informatief en normatief.</p>\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run() {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance) {\n processConformance(conformance);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"äæå­˜ć™ć‚‹\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"åƼå‡ŗ\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"šŸ’¾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/search-specref\n// Search Specref database\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/specref/\";\n\nconst localizationStrings = {\n en: {\n search_specref: \"Search Specref\",\n },\n nl: {\n search_specref: \"Doorzoek Specref\",\n },\n ja: {\n search_specref: \"ä»•ę§˜ę¤œē“¢\",\n },\n de: {\n search_specref: \"Spezifikationen durchsuchen\",\n },\n zh: {\n search_specref: \"ꐜē“¢ Specref\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst button = ui.addCommand(\n l10n.search_specref,\n show,\n \"Ctrl+Shift+Alt+space\",\n \"šŸ”Ž\"\n);\n\nfunction show() {\n const onLoad = e => e.target.classList.add(\"ready\");\n /** @type {HTMLElement} */\n const specrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=${onLoad}></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.search_specref, specrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关äŗŽ\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"ć“ć‚Œć«ć¤ć„ć¦\",\n },\n de: {\n about_respec: \"Ɯber\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ā„¹ļø\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/speced/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/speced/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\nimport { html } from \"../core/import-maps.js\";\n\nexport const name = \"core/seo\";\n\nexport function run(conf) {\n if (conf.gitRevision) {\n // This allows to set a git revision of the source used to produce the\n // generated content. Typically, this would be set when generating the\n // static HTML via a build process.\n // 'revision' is the name recommended in https://wiki.whatwg.org/wiki/MetaExtensions\n const metaElem = html`<meta\n name=\"revision\"\n content=\"${conf.gitRevision}\"\n />`;\n document.head.appendChild(metaElem);\n }\n\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","/*\nOne Light for ReSpec, with better color contrast\nAdapted from Atom One Light by Daniel Gamage (https://github.com/highlightjs/highlight.js/blob/c0b6ddbaaf7/src/styles/atom-one-light.css>\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n --base: #fafafa;\n --mono-1: #383a42;\n --mono-2: #686b77;\n --mono-3: #717277;\n --hue-1: #0b76c5;\n --hue-2: #336ae3;\n --hue-3: #a626a4;\n --hue-4: #42803c;\n --hue-5: #ca4706;\n --hue-5-2: #c91243;\n --hue-6: #986801;\n --hue-6-2: #9a6a01;\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n .hljs {\n --base: #282c34;\n --mono-1: #abb2bf;\n --mono-2: #818896;\n --mono-3: #5c6370;\n --hue-1: #56b6c2;\n --hue-2: #61aeee;\n --hue-3: #c678dd;\n --hue-4: #98c379;\n --hue-5: #e06c75;\n --hue-5-2: #be5046;\n --hue-6: #d19a66;\n --hue-6-2: #e6c07b;\n }\n}\n\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n color: var(--mono-1, #383a42);\n background: #fafafa;\n background: var(--base, #fafafa);\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n color: var(--mono-3, #717277);\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n color: var(--hue-3, #a626a4);\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n color: var(--hue-5, #ca4706);\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n color: var(--hue-1, #0b76c5);\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n color: var(--hue-4, #42803c);\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n color: var(--hue-6-2, #9a6a01);\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n color: var(--hue-6, #986801);\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n color: var(--hue-2, #336ae3);\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\n/**\n * Module core/data-tests\n *\n * Allows specs to link to test files in a test suite, by adding `details` of where\n * particular tests for a testable assertion can be found.\n *\n * `data-tests` takes a space separated list of URLs, e.g. data-test=\"foo.html bar.html\".\n *\n * Docs: https://respec.org/doc/#data-tests\n */\nimport {\n codedJoinAnd,\n docLink,\n getIntlData,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst localizationStrings = {\n en: {\n missing_test_suite_uri: docLink`Found tests in your spec, but missing ${\"[testSuiteURI]\"} in your ReSpec config.`,\n tests: \"tests\",\n test: \"test\",\n },\n ja: {\n missing_test_suite_uri: docLink`ć“ć®ä»•ę§˜å†…ć«ćƒ†ć‚¹ćƒˆć®é …ē›®ć‚’ę¤œå‡ŗć—ć¾ć—ćŸćŒļ¼ŒReSpec 恮čØ­å®šć« ${\"[testSuiteURI]\"} ćŒč¦‹ć¤ć‹ć‚Šć¾ć›ć‚“ļ¼Ž`,\n tests: \"ćƒ†ć‚¹ćƒˆ\",\n test: \"ćƒ†ć‚¹ćƒˆ\",\n },\n de: {\n missing_test_suite_uri: docLink`Die Spezifikation enthƤlt Tests, aber in der ReSpec-Konfiguration ist keine ${\"[testSuiteURI]\"} angegeben.`,\n tests: \"Tests\",\n test: \"Test\",\n },\n zh: {\n missing_test_suite_uri: docLink`ęœ¬č§„čŒƒäø­åŒ…å«ęµ‹čƕļ¼Œä½†åœØ ReSpec 配ē½®äø­ē¼ŗ少 ${\"[testSuiteURI]\"}怂`,\n tests: \"굋čƕ\",\n test: \"굋čƕ\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport const name = \"core/data-tests\";\n\nfunction toListItem(href) {\n const emojiList = [];\n const [testFile] = new URL(href).pathname.split(\"/\").reverse();\n const testParts = testFile.split(\".\");\n let [testFileName] = testParts;\n\n const isSecureTest = testParts.find(part => part === \"https\");\n if (isSecureTest) {\n const requiresConnectionEmoji = document.createElement(\"span\");\n requiresConnectionEmoji.textContent = \"šŸ”’\";\n requiresConnectionEmoji.setAttribute(\n \"aria-label\",\n \"requires a secure connection\"\n );\n requiresConnectionEmoji.setAttribute(\"title\", \"Test requires HTTPS\");\n testFileName = testFileName.replace(\".https\", \"\");\n emojiList.push(requiresConnectionEmoji);\n }\n\n const isManualTest = testFileName\n .split(\".\")\n .join(\"-\")\n .split(\"-\")\n .find(part => part === \"manual\");\n if (isManualTest) {\n const manualPerformEmoji = document.createElement(\"span\");\n manualPerformEmoji.textContent = \"šŸ’Ŗ\";\n manualPerformEmoji.setAttribute(\n \"aria-label\",\n \"the test must be run manually\"\n );\n manualPerformEmoji.setAttribute(\"title\", \"Manual test\");\n testFileName = testFileName.replace(\"-manual\", \"\");\n emojiList.push(manualPerformEmoji);\n }\n\n const testList = html`\n <li>\n <a href=\"${href}\">${testFileName}</a>\n ${emojiList}\n </li>\n `;\n return testList;\n}\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n if (!testables.length) {\n return;\n }\n if (!conf.testSuiteURI) {\n showError(l10n.missing_test_suite_uri, name);\n return;\n }\n\n for (const elem of testables) {\n const tests = elem.dataset.tests.split(/,/gm).map(url => url.trim());\n const testURLs = toTestURLs(tests, conf.testSuiteURI, elem);\n handleDuplicates(testURLs, elem);\n const details = toHTML(testURLs);\n elem.append(details);\n }\n}\n\n/**\n * @param {string[]} tests\n * @param {string} testSuiteURI\n * @param {HTMLElement} elem\n */\nfunction toTestURLs(tests, testSuiteURI, elem) {\n return tests\n .map(test => {\n try {\n return new URL(test, testSuiteURI).href;\n } catch {\n const msg = docLink`Invalid URL in ${\"[data-tests]\"} attribute: ${test}.`;\n showWarning(msg, name, { elements: [elem] });\n }\n })\n .filter(href => href);\n}\n\n/**\n * @param {string[]} testURLs\n * @param {HTMLElement} elem\n */\nfunction handleDuplicates(testURLs, elem) {\n const duplicates = testURLs.filter(\n (link, i, self) => self.indexOf(link) !== i\n );\n if (duplicates.length) {\n const msg = docLink`Duplicate tests found in the ${\"[data-tests]\"} attribute.`;\n const tests = codedJoinAnd(duplicates, { quotes: true });\n const hint = docLink`To fix, remove duplicates from ${\"[data-tests]\"}: ${tests}.`;\n showWarning(msg, name, { hint, elements: [elem] });\n }\n}\n\n/**\n * @param {string[]} testURLs\n */\nfunction toHTML(testURLs) {\n const uniqueList = [...new Set(testURLs)];\n const details = html`\n <details class=\"respec-tests-details removeOnSave\">\n <summary>tests: ${uniqueList.length}</summary>\n <ul>\n ${uniqueList.map(toListItem)}\n </ul>\n </details>\n `;\n return details;\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n var.respec-hl {\n filter: saturate(0.9) brightness(0.9)\n }\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within the algorithm or the encompassing section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\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","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n:root {\n --assertion-border: #aaa;\n --assertion-bg: #eee;\n --assertion-text: black;\n}\n\n.assert {\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n border-color: #aaa;\n border-color: var(--assertion-border);\n background: #eee;\n background: var(--assertion-bg);\n color: black;\n color: var(--assertion-text);\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n :root {\n --assertion-border: #444;\n --assertion-bg: var(--borderedblock-bg);\n --assertion-text: var(--text);\n }\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"Ā§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/speced/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n background: var(--indextable-hover-bg, #fff);\n color: black;\n color: var(--text, black);\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: 0 1em 3em -0.4em var(--tocsidebar-shadow, rgba(0, 0, 0, 0.3)),\n 0 0 1px 1px var(--tocsidebar-shadow, rgba(0, 0, 0, 0.05));\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n border-bottom-color: var(--indextable-hover-bg, #fff);\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n /* TODO: need slightly darker shade */\n border-bottom-color: var(--indextable-hover-bg, #a2a9b1);\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n color: var(--text, #000);\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n color: var(--text, #333);\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => {\n return html`<li>\n ${toLinkProps(entry).map(link => {\n return html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a\n >${\" \"}`;\n })}\n </li>`;\n };\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `Ā§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","export const name = \"core/dfn-contract\";\n\nexport function run() {\n addContractDefaults();\n addDefinitionPointers();\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n\n// - Sets data-defines on well-known definition content patterns\nfunction addDefinitionPointers() {\n // A dl with class hasdefinitions associated the dfn in each dt\n // the definition in the following sibling element\n /** @type NodeListOf<HTMLElement> */\n const describedDTs = document.querySelectorAll(\n \"dl.definitions dt:has(dfn[data-dfn-type])\"\n );\n for (const dt of describedDTs) {\n const dfnId = dt.querySelector(\"dfn[data-dfn-type]\").id;\n const dfnContent = /** @type {HTMLElement | null} */ (\n dt.nextElementSibling\n );\n if (dfnContent && !dfnContent.dataset.defines && dfnId) {\n dfnContent.dataset.defines = `#${dfnId}`;\n }\n }\n\n // an element with class \"definition\" is marked as defining the term\n // found in the element\n /** @type NodeListOf<HTMLElement> */\n const definitionContainers = document.querySelectorAll(\n \".definition:has(dfn[data-dfn-type])\"\n );\n for (const el of definitionContainers) {\n const dfn = el.querySelector(\"dfn[data-dfn-type]\");\n if (dfn.id && !el.dataset.defines) {\n el.dataset.defines = `#${dfn.id}`;\n }\n }\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ \\`<meta>\\` ꠇē­¾`,\n hint: `å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ \\`<head>\\` éƒØ分ā€”ā€” \\`<meta charset=\"utf-8\">\\` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂\",\n hint: \"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * Checks that there is a section that has at least privacy and/or\n * security and considerations.\n *\n * The rule is \"privacy\" or \"security\", and \"considerations\", in any order,\n * case-insensitive, multi-line check.\n *\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"privsec-section\";\nexport const name = \"core/linter-rules/privsec-section\";\n\nconst localizationStrings = {\n en: {\n msg: \"Document must have a 'Privacy and/or Security' Considerations section.\",\n hint:\n \"Add a privacy and/or security considerations section. \" +\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nfunction hasPriSecConsiderations(doc) {\n return Array.from(doc.querySelectorAll(\"h2, h3, h4, h5, h6\")).some(\n ({ textContent: text }) => {\n const saysPrivOrSec = /(privacy|security)/im.test(text);\n const saysConsiderations = /(considerations)/im.test(text);\n return (saysPrivOrSec && saysConsiderations) || saysPrivOrSec;\n }\n );\n}\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n if (conf.isRecTrack && !hasPriSecConsiderations(document)) {\n showWarning(l10n.msg, name, { hint: l10n.hint });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,\n hint: \"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","instanceOfAny","constructors","some","c","idbProxyableTypes","cursorAdvanceMethods","transactionDoneMap","WeakMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","replaceTraps","wrapFunction","func","IDBCursor","prototype","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","request","transformCachableValue","tx","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","cacheDonePromiseForTransaction","IDBDatabase","IDBObjectStore","IDBIndex","Proxy","IDBRequest","promise","success","result","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","transaction","store","index","shift","oldTraps","advanceMethodProps","methodMap","advanceResults","ittrProxiedCursorToOriginalProxy","cursorIteratorTraps","cachedFunc","iterate","cursor","openCursor","proxiedCursor","delete","isIteratorProp","Symbol","asyncIterator","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","catch","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","_getDefaults","breaks","extensions","gfm","hooks","pedantic","renderer","silent","tokenizer","walkTokens","_defaults","changeDefaults","newDefaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape$1","encode","unescapeTest","unescape","_","n","charAt","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","valSource","getRegex","cleanUrl","href","encodeURI","noopTest","exec","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","i","trim","length","pop","splice","push","rtrim","invert","l","suffLen","currChar","slice","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","_Tokenizer","rules","constructor","space","src","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","anyPunctuation","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","bull","isordered","ordered","start","loose","items","itemRegex","itemContents","endsWithBlankLine","endEarly","line","t","repeat","nextLine","indent","trimStart","search","blankLine","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","rawLine","ischecked","istask","task","checked","trimEnd","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","headers","aligns","rows","item","header","align","row","cell","lheading","paragraph","escape","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","indexOf","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","emStrongLDelim","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","emStrongRDelimAst","emStrongRDelimUnd","lastIndex","lastCharLength","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","bullet","_paragraph","_blockLabel","_tag","_comment","blockNormal","gfmTable","blockGfm","blockPedantic","_punctuation","_inlineComment","_inlineLabel","inlineNormal","blockSkip","reflinkSearch","inlinePedantic","inlineGfm","inlineBreaks","normal","_Lexer","inlineQueue","Object","create","lex","lexInline","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","call","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","charCodeAt","console","keepPrevChar","keys","lastIndexOf","startInline","_Renderer","infostring","quote","body","listitem","checkbox","tablerow","content","tablecell","flags","strong","em","cleanHref","out","image","_TextRenderer","_Parser","textRenderer","parse","parseInline","renderers","genericToken","ret","parser","headingToken","codeToken","tableToken","j","k","blockquoteToken","listToken","itemBody","unshift","htmlToken","paragraphToken","textToken","escapeToken","tagToken","linkToken","imageToken","strongToken","emToken","codespanToken","delToken","_Hooks","static","Set","preprocess","markdown","postprocess","processAllTokens","markedInstance","defaults","setOptions","parseMarkdown","Parser","Renderer","TextRenderer","Lexer","Tokenizer","Hooks","use","values","concat","childTokens","flat","pack","opts","ext","prevRenderer","extLevel","rendererProp","rendererFunc","tokenizerProp","tokenizerFunc","prevTokenizer","hooksProp","hooksFunc","prevHook","passThroughHooks","arg","packWalktokens","origOpt","warn","throwError","onError","toString","message","msg","marked","getDefaults","globalThis","global","getDefaultExportFromCjs","x","__esModule","hasOwnProperty","module","pluralize$1","exports","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","arguments","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","configurable","o","random","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","v","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ne","re","ie","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","sort","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","setTimeout","addedNodes","removedNodes","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","key","serialize","_pluralize","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","docLang","startsWith","nonNormativeSelector","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","getElementsByTagName","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","markAsOffending","toJSON","details","showError","pluginName","makePluginUtils","toMDCode","codedJoinOr","quotes","addQuotes","docLink","strings","reindent","endsWith","linkingText","lines","indents","leastIndent","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","toHTML","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodeURIComponent","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","utils","err","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$f","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","buttonId","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$o","style$1","l10n$m","github$1","dataInclude","dataTransform","inlines","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","conformance","saveHtml","searchSpecref","aboutRespec","seo","highlight","dataTests","listSorter","highlightVars$1","algorithms","anchorExpander","dfnPanel","dfnContract","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","newHash","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","geonovumDefaults","doJsonLd","license","logos","alt","height","width","isCCBY","licenseInfo","isBasic","isRegular","computeProps","css$d","noReSpecCSS","createStyle","css_name","resourceHints","createResourceHints","favicon","meta","delimiter","separator","toKeyValuePairs","createMetaViewport","styleFile","noToc","attachFixupScript","urls","frag","reduce","nextLink","linkCSS","additions","status_at_publication","nl","resolveGithubPromise","rejectGithubPromise","github","file_a_bug","participate","commit_history","ko","zh","ja","es","ghURL","tempURL","repoURL","org","repo","pathname","branch","issueBase","commitHistoryURL","newProps","edDraftURI","githubToken","githubUser","atRiskBase","otherLinks","pullBase","shortName","githubAPI","hostname","excludeGithubLinks","otherLink","normalizedGHObj","apiBase","fullName","issuesURL","pullsURL","newIssuesURL","normalizedConfig","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","base","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","Date","range","IDBKeyRange","lowerBound","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","addAll","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","clear","storeNames","stores","clearStorePromises","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","authors","etAl","publisher","date","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","contains","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","closestType","computeExport","export","titles","pluralizeDfn","dfnTexts","dfns","getPluralizer","terms","plurals","userDefinedPlurals","uniquePlurals","css$b","makeTitle","num","report","number","div","inAside","exampleTitle","css$9","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","note","handleIssues","ins","ghIssues","getIssueNumber","Number","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","insertAdjacentHTML","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","issueNumbers","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","every","decorateTableOfFigures","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","citePath","citeFrag","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","editors","editor","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","toISOString","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","processConformance","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","publishDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","search_specref","specrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","gitRevision","metaElem","firstParagraph","css$7","fetchBase","_documentCurrentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","missing_test_suite_uri","tests","toListItem","emojiList","testFile","testParts","testFileName","requiresConnectionEmoji","manualPerformEmoji","toTestURLs","testSuiteURI","handleDuplicates","testURLs","codedJoinAnd","uniqueList","testables","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$5","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","css$3","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","dfnsWithNoType","exportableDfns","addContractDefaults","describedDTs","dfnId","dfnContent","defines","definitionContainers","addDefinitionPointers","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"qHACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAA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C,OAAOQ,SAAS0K,KAAKkkB,WAAW,QACnC,OAGF,MAAMugC,EAAmB75C,OAAO85C,oBAAoB/zB,GAEjD1qB,QAAOqd,GAAQA,EAAI8H,SAAS,QAAUuF,EAAKrN,IAAiB,WAARA,IAEpDrd,QAAOqd,GACN,IAAIe,IAAIsM,EAAKrN,GAAMxuB,OAAOQ,SAAS0K,MAAMA,KAAKkkB,WAAW,aAG7D,GAAIugC,EAAiBzjD,OAAQ,CAC3B,MAAMmL,EAAOuZ,GAAQ++B,GAAkBnhC,GAAO2H,EAAO,GAAG,IAAI3H,SAC5D+C,GAAYhwB,GAAKyb,IAAKzd,GAAM,CAAEowB,KAAMpuB,GAAKouB,KAAOtY,GACjD,CACH","x_google_ignoreList":[4,5,6,8]} \ No newline at end of file +{"version":3,"file":"respec-geonovum.js","sources":["../src/core/expose-modules.js","../src/core/l10n.js","../node_modules/idb/build/index.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/utils.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/geonovum.js","../src/core/location-hash.js","../src/core/defaults.js","../src/geonovum/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/geonovum/style.js","../src/geonovum/l10n.js","../src/core/github.js","../src/core/sections.js","../src/core/data-include.js","../src/core/reindent.js","../src/core/data-transform.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/geonovum/conformance.js","../src/ui/save-html.js","../src/ui/search-specref.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/data-tests.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/dfn-contract.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/no-http-props.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\n// Explicitly default lang and dir on <html> if not set.\n// We assume English and ltr as default for international standards.\nif (!html?.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html?.lang ?? \"en\";\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst transactionDoneMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(this.request);\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nconst advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance'];\nconst methodMap = {};\nconst advanceResults = new WeakMap();\nconst ittrProxiedCursorToOriginalProxy = new WeakMap();\nconst cursorIteratorTraps = {\n get(target, prop) {\n if (!advanceMethodProps.includes(prop))\n return target[prop];\n let cachedFunc = methodMap[prop];\n if (!cachedFunc) {\n cachedFunc = methodMap[prop] = function (...args) {\n advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args));\n };\n }\n return cachedFunc;\n },\n};\nasync function* iterate(...args) {\n // tslint:disable-next-line:no-this-assignment\n let cursor = this;\n if (!(cursor instanceof IDBCursor)) {\n cursor = await cursor.openCursor(...args);\n }\n if (!cursor)\n return;\n cursor = cursor;\n const proxiedCursor = new Proxy(cursor, cursorIteratorTraps);\n ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor);\n // Map this double-proxy back to the original, so other cursor methods work.\n reverseTransformCache.set(proxiedCursor, unwrap(cursor));\n while (cursor) {\n yield proxiedCursor;\n // If one of the advancing methods was not called, call continue().\n cursor = await (advanceResults.get(proxiedCursor) || cursor.continue());\n advanceResults.delete(proxiedCursor);\n }\n}\nfunction isIteratorProp(target, prop) {\n return ((prop === Symbol.asyncIterator &&\n instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) ||\n (prop === 'iterate' && instanceOfAny(target, [IDBIndex, IDBObjectStore])));\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get(target, prop, receiver) {\n if (isIteratorProp(target, prop))\n return iterate;\n return oldTraps.get(target, prop, receiver);\n },\n has(target, prop) {\n return isIteratorProp(target, prop) || oldTraps.has(target, prop);\n },\n}));\n\nexport { deleteDB, openDB, unwrap, wrap };\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (Ćæ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v12.0.2 - a markdown parser\n * Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\n/**\n * Gets the original marked default options.\n */\nfunction _getDefaults() {\n return {\n async: false,\n breaks: false,\n extensions: null,\n gfm: true,\n hooks: null,\n pedantic: false,\n renderer: null,\n silent: false,\n tokenizer: null,\n walkTokens: null\n };\n}\nlet _defaults = _getDefaults();\nfunction changeDefaults(newDefaults) {\n _defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape$1(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n }\n else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n return html;\n}\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon')\n return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\nconst caret = /(^|[^\\[])\\^/g;\nfunction edit(regex, opt) {\n let source = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n let valSource = typeof val === 'string' ? val : val.source;\n valSource = valSource.replace(caret, '$1');\n source = source.replace(name, valSource);\n return obj;\n },\n getRegex: () => {\n return new RegExp(source, opt);\n }\n };\n return obj;\n}\nfunction cleanUrl(href) {\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n }\n catch (e) {\n return null;\n }\n return href;\n}\nconst noopTest = { exec: () => null };\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false;\n let curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\')\n escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n }\n else {\n // add space before unescaped |\n return ' |';\n }\n }), cells = row.split(/ \\|/);\n let i = 0;\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) {\n cells.shift();\n }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) {\n cells.pop();\n }\n if (count) {\n if (cells.length > count) {\n cells.splice(count);\n }\n else {\n while (cells.length < count)\n cells.push('');\n }\n }\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param str\n * @param c\n * @param invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n }\n else if (currChar !== c && invert) {\n suffLen++;\n }\n else {\n break;\n }\n }\n return str.slice(0, l - suffLen);\n}\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n let level = 0;\n for (let i = 0; i < str.length; i++) {\n if (str[i] === '\\\\') {\n i++;\n }\n else if (str[i] === b[0]) {\n level++;\n }\n else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape$1(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape$1(text)\n };\n}\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n if (matchIndentToCode === null) {\n return text;\n }\n const indentToCode = matchIndentToCode[1];\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n const [indentInNode] = matchIndentInNode;\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n return node;\n })\n .join('\\n');\n}\n/**\n * Tokenizer\n */\nclass _Tokenizer {\n options;\n rules; // set by the lexer\n lexer; // set by the lexer\n constructor(options) {\n this.options = options || _defaults;\n }\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, '$1') : cap[2],\n text\n };\n }\n }\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n }\n else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n // precede setext continuation with 4 spaces so it isn't a setext\n let text = cap[0].replace(/\\n {0,3}((?:=+|-+) *)(?=\\n|$)/g, '\\n $1');\n text = rtrim(text.replace(/^ *>[ \\t]?/gm, ''), '\\n');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n let raw = '';\n let itemContents = '';\n let endsWithBlankLine = false;\n // Check if current bullet point can start a new List Item\n while (src) {\n let endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n raw = cap[0];\n src = src.substring(raw.length);\n let line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n let nextLine = src.split('\\n', 1)[0];\n let indent = 0;\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimStart();\n }\n else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n let blankLine = false;\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n // Check if following lines should be included in List Item\n while (src) {\n const rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n }\n else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n itemContents += '\\n' + nextLine;\n }\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n }\n else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n let istask = null;\n let ischecked;\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents,\n tokens: []\n });\n list.raw += raw;\n }\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimEnd();\n (list.items[list.items.length - 1]).text = itemContents.trimEnd();\n list.raw = list.raw.trimEnd();\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (let i = 0; i < list.items.length; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n list.loose = hasMultipleLineBreaks;\n }\n }\n // Set all items to loose if list is loose\n if (list.loose) {\n for (let i = 0; i < list.items.length; i++) {\n list.items[i].loose = true;\n }\n }\n return list;\n }\n }\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n block: true,\n raw: cap[0],\n pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',\n text: cap[0]\n };\n return token;\n }\n }\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline.anyPunctuation, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (!cap) {\n return;\n }\n if (!/[:|]/.test(cap[2])) {\n // delimiter row must have a pipe (|) or colon (:) otherwise it is a setext heading\n return;\n }\n const headers = splitCells(cap[1]);\n const aligns = cap[2].replace(/^\\||\\| *$/g, '').split('|');\n const rows = cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : [];\n const item = {\n type: 'table',\n raw: cap[0],\n header: [],\n align: [],\n rows: []\n };\n if (headers.length !== aligns.length) {\n // header and align columns must be equal, rows can be different.\n return;\n }\n for (const align of aligns) {\n if (/^ *-+: *$/.test(align)) {\n item.align.push('right');\n }\n else if (/^ *:-+: *$/.test(align)) {\n item.align.push('center');\n }\n else if (/^ *:-+ *$/.test(align)) {\n item.align.push('left');\n }\n else {\n item.align.push(null);\n }\n }\n for (const header of headers) {\n item.header.push({\n text: header,\n tokens: this.lexer.inline(header)\n });\n }\n for (const row of rows) {\n item.rows.push(splitCells(row, item.header.length).map(cell => {\n return {\n text: cell,\n tokens: this.lexer.inline(cell)\n };\n }));\n }\n return item;\n }\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape$1(cap[1])\n };\n }\n }\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n }\n else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n }\n else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n return {\n type: 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n block: false,\n text: cap[0]\n };\n }\n }\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n }\n else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n if (link) {\n href = link[1];\n title = link[3];\n }\n }\n else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n }\n else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline.anyPunctuation, '$1') : href,\n title: title ? title.replace(this.rules.inline.anyPunctuation, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n const linkString = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n const link = links[linkString.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrongLDelim.exec(src);\n if (!match)\n return;\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u))\n return;\n const nextChar = match[1] || match[2] || '';\n if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {\n // unicode Regex counts emoji as 1 char; spread into array for proper count (used multiple times below)\n const lLength = [...match[0]].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;\n endReg.lastIndex = 0;\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n if (!rDelim)\n continue; // skip single * in __abc*abc__\n rLength = [...rDelim].length;\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n }\n else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n delimTotal -= rLength;\n if (delimTotal > 0)\n continue; // Haven't found enough closing delimiters\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n // char length can be >1 for unicode characters;\n const lastCharLength = [...match[0]][0].length;\n const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape$1(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n autolink(src) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[1]);\n href = 'mailto:' + text;\n }\n else {\n text = escape$1(cap[1]);\n href = text;\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n url(src) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[0]);\n href = 'mailto:' + text;\n }\n else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? '';\n } while (prevCapZero !== cap[0]);\n text = escape$1(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n }\n else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n inlineText(src) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = cap[0];\n }\n else {\n text = escape$1(cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst newline = /^(?: *(?:\\n|$))+/;\nconst blockCode = /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/;\nconst fences = /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/;\nconst hr = /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/;\nconst heading = /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/;\nconst bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nconst lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\\n(?!\\s*?\\n|bull |blockCode|fences|blockquote|heading|html))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/)\n .replace(/bull/g, bullet) // lists can interrupt\n .replace(/blockCode/g, / {4}/) // indented code blocks can interrupt\n .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt\n .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n .getRegex();\nconst _paragraph = /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/;\nconst blockText = /^[^\\n]+/;\nconst _blockLabel = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nconst def = edit(/^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/)\n .replace('label', _blockLabel)\n .replace('title', /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/)\n .getRegex();\nconst list = edit(/^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/)\n .replace(/bull/g, bullet)\n .getRegex();\nconst _tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title'\n + '|tr|track|ul';\nconst _comment = /<!--(?:-?>|[\\s\\S]*?(?:-->|$))/;\nconst html = edit('^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')', 'i')\n .replace('comment', _comment)\n .replace('tag', _tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst paragraph = edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\nconst blockquote = edit(/^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/)\n .replace('paragraph', paragraph)\n .getRegex();\n/**\n * Normal Block Grammar\n */\nconst blockNormal = {\n blockquote,\n code: blockCode,\n def,\n fences,\n heading,\n hr,\n html,\n lheading,\n list,\n newline,\n paragraph,\n table: noopTest,\n text: blockText\n};\n/**\n * GFM Block Grammar\n */\nconst gfmTable = edit('^ *([^\\\\n ].*)\\\\n' // Header\n + ' {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)') // Cells\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\nconst blockGfm = {\n ...blockNormal,\n table: gfmTable,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('table', gfmTable) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex()\n};\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\nconst blockPedantic = {\n ...blockNormal,\n html: edit('^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', _comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', lheading)\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .replace('|tag', '')\n .getRegex()\n};\n/**\n * Inline-Level Grammar\n */\nconst escape = /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/;\nconst inlineCode = /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/;\nconst br = /^( {2,}|\\\\)\\n(?!\\s*$)/;\nconst inlineText = /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/;\n// list of unicode punctuation marks, plus any missing characters from CommonMark spec\nconst _punctuation = '\\\\p{P}\\\\p{S}';\nconst punctuation = edit(/^((?![*_])[\\spunctuation])/, 'u')\n .replace(/punctuation/g, _punctuation).getRegex();\n// sequences em should skip over [title](link), `code`, <html>\nconst blockSkip = /\\[[^[\\]]*?\\]\\([^\\(\\)]*?\\)|`[^`]*?`|<[^<>]*?>/g;\nconst emStrongLDelim = edit(/^(?:\\*+(?:((?!\\*)[punct])|[^\\s*]))|^_+(?:((?!_)[punct])|([^\\s_]))/, 'u')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst emStrongRDelimAst = edit('^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)' // Skip orphan inside strong\n + '|[^*]+(?=[^*])' // Consume to delim\n + '|(?!\\\\*)[punct](\\\\*+)(?=[\\\\s]|$)' // (1) #*** can only be a Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?!\\\\*)(?=[punct\\\\s]|$)' // (2) a***#, a*** can only be a Right Delimiter\n + '|(?!\\\\*)[punct\\\\s](\\\\*+)(?=[^punct\\\\s])' // (3) #***a, ***a can only be Left Delimiter\n + '|[\\\\s](\\\\*+)(?!\\\\*)(?=[punct])' // (4) ***# can only be Left Delimiter\n + '|(?!\\\\*)[punct](\\\\*+)(?!\\\\*)(?=[punct])' // (5) #***# can be either Left or Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?=[^punct\\\\s])', 'gu') // (6) a***a can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\n// (6) Not allowed for _\nconst emStrongRDelimUnd = edit('^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)' // Skip orphan inside strong\n + '|[^_]+(?=[^_])' // Consume to delim\n + '|(?!_)[punct](_+)(?=[\\\\s]|$)' // (1) #___ can only be a Right Delimiter\n + '|[^punct\\\\s](_+)(?!_)(?=[punct\\\\s]|$)' // (2) a___#, a___ can only be a Right Delimiter\n + '|(?!_)[punct\\\\s](_+)(?=[^punct\\\\s])' // (3) #___a, ___a can only be Left Delimiter\n + '|[\\\\s](_+)(?!_)(?=[punct])' // (4) ___# can only be Left Delimiter\n + '|(?!_)[punct](_+)(?!_)(?=[punct])', 'gu') // (5) #___# can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst anyPunctuation = edit(/\\\\([punct])/, 'gu')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst autolink = edit(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/)\n .replace('scheme', /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/)\n .replace('email', /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/)\n .getRegex();\nconst _inlineComment = edit(_comment).replace('(?:-->|$)', '-->').getRegex();\nconst tag = edit('^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>') // CDATA section\n .replace('comment', _inlineComment)\n .replace('attribute', /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst _inlineLabel = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\nconst link = edit(/^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/)\n .replace('label', _inlineLabel)\n .replace('href', /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/)\n .replace('title', /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/)\n .getRegex();\nconst reflink = edit(/^!?\\[(label)\\]\\[(ref)\\]/)\n .replace('label', _inlineLabel)\n .replace('ref', _blockLabel)\n .getRegex();\nconst nolink = edit(/^!?\\[(ref)\\](?:\\[\\])?/)\n .replace('ref', _blockLabel)\n .getRegex();\nconst reflinkSearch = edit('reflink|nolink(?!\\\\()', 'g')\n .replace('reflink', reflink)\n .replace('nolink', nolink)\n .getRegex();\n/**\n * Normal Inline Grammar\n */\nconst inlineNormal = {\n _backpedal: noopTest, // only used for GFM url\n anyPunctuation,\n autolink,\n blockSkip,\n br,\n code: inlineCode,\n del: noopTest,\n emStrongLDelim,\n emStrongRDelimAst,\n emStrongRDelimUnd,\n escape,\n link,\n nolink,\n punctuation,\n reflink,\n reflinkSearch,\n tag,\n text: inlineText,\n url: noopTest\n};\n/**\n * Pedantic Inline Grammar\n */\nconst inlinePedantic = {\n ...inlineNormal,\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', _inlineLabel)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', _inlineLabel)\n .getRegex()\n};\n/**\n * GFM Inline Grammar\n */\nconst inlineGfm = {\n ...inlineNormal,\n escape: edit(escape).replace('])', '~|])').getRegex(),\n url: edit(/^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/, 'i')\n .replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/)\n .getRegex(),\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n};\n/**\n * GFM + Line Breaks Inline Grammar\n */\nconst inlineBreaks = {\n ...inlineGfm,\n br: edit(br).replace('{2,}', '*').getRegex(),\n text: edit(inlineGfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n/**\n * exports\n */\nconst block = {\n normal: blockNormal,\n gfm: blockGfm,\n pedantic: blockPedantic\n};\nconst inline = {\n normal: inlineNormal,\n gfm: inlineGfm,\n breaks: inlineBreaks,\n pedantic: inlinePedantic\n};\n\n/**\n * Block Lexer\n */\nclass _Lexer {\n tokens;\n options;\n state;\n tokenizer;\n inlineQueue;\n constructor(options) {\n // TokenList cannot be created in one go\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || _defaults;\n this.options.tokenizer = this.options.tokenizer || new _Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n }\n else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n }\n else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new _Lexer(options);\n return lexer.lex(src);\n }\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new _Lexer(options);\n return lexer.inlineTokens(src);\n }\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n this.blockTokens(src, this.tokens);\n for (let i = 0; i < this.inlineQueue.length; i++) {\n const next = this.inlineQueue[i];\n this.inlineTokens(next.src, next.tokens);\n }\n this.inlineQueue = [];\n return this.tokens;\n }\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n }\n else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n let token;\n let lastToken;\n let cutSrc;\n let lastParagraphClipped;\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unnecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n this.state.top = true;\n return tokens;\n }\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n // Mask out escaped characters\n while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);\n }\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // autolink\n if (token = this.tokenizer.autolink(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass _Renderer {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/^\\S*/)?.[0];\n code = code.replace(/\\n$/, '') + '\\n';\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n return '<pre><code class=\"language-'\n + escape$1(lang)\n + '\">'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n html(html, block) {\n return html;\n }\n heading(text, level, raw) {\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n hr() {\n return '<hr>\\n';\n }\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul';\n const startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n listitem(text, task, checked) {\n return `<li>${text}</li>\\n`;\n }\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\">';\n }\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n table(header, body) {\n if (body)\n body = `<tbody>${body}</tbody>`;\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n /**\n * span level renderer\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n em(text) {\n return `<em>${text}</em>`;\n }\n codespan(text) {\n return `<code>${text}</code>`;\n }\n br() {\n return '<br>';\n }\n del(text) {\n return `<del>${text}</del>`;\n }\n link(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n image(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += '>';\n return out;\n }\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass _TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n em(text) {\n return text;\n }\n codespan(text) {\n return text;\n }\n del(text) {\n return text;\n }\n html(text) {\n return text;\n }\n text(text) {\n return text;\n }\n link(href, title, text) {\n return '' + text;\n }\n image(href, title, text) {\n return '' + text;\n }\n br() {\n return '';\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass _Parser {\n options;\n renderer;\n textRenderer;\n constructor(options) {\n this.options = options || _defaults;\n this.options.renderer = this.options.renderer || new _Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new _TextRenderer();\n }\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new _Parser(options);\n return parser.parse(tokens);\n }\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new _Parser(options);\n return parser.parseInline(tokens);\n }\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const genericToken = token;\n const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(genericToken.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n const headingToken = token;\n out += this.renderer.heading(this.parseInline(headingToken.tokens), headingToken.depth, unescape(this.parseInline(headingToken.tokens, this.textRenderer)));\n continue;\n }\n case 'code': {\n const codeToken = token;\n out += this.renderer.code(codeToken.text, codeToken.lang, !!codeToken.escaped);\n continue;\n }\n case 'table': {\n const tableToken = token;\n let header = '';\n // header\n let cell = '';\n for (let j = 0; j < tableToken.header.length; j++) {\n cell += this.renderer.tablecell(this.parseInline(tableToken.header[j].tokens), { header: true, align: tableToken.align[j] });\n }\n header += this.renderer.tablerow(cell);\n let body = '';\n for (let j = 0; j < tableToken.rows.length; j++) {\n const row = tableToken.rows[j];\n cell = '';\n for (let k = 0; k < row.length; k++) {\n cell += this.renderer.tablecell(this.parseInline(row[k].tokens), { header: false, align: tableToken.align[k] });\n }\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n const blockquoteToken = token;\n const body = this.parse(blockquoteToken.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n const listToken = token;\n const ordered = listToken.ordered;\n const start = listToken.start;\n const loose = listToken.loose;\n let body = '';\n for (let j = 0; j < listToken.items.length; j++) {\n const item = listToken.items[j];\n const checked = item.checked;\n const task = item.task;\n let itemBody = '';\n if (item.task) {\n const checkbox = this.renderer.checkbox(!!checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n }\n else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox + ' '\n });\n }\n }\n else {\n itemBody += checkbox + ' ';\n }\n }\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, !!checked);\n }\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n const htmlToken = token;\n out += this.renderer.html(htmlToken.text, htmlToken.block);\n continue;\n }\n case 'paragraph': {\n const paragraphToken = token;\n out += this.renderer.paragraph(this.parseInline(paragraphToken.tokens));\n continue;\n }\n case 'text': {\n let textToken = token;\n let body = textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text;\n while (i + 1 < tokens.length && tokens[i + 1].type === 'text') {\n textToken = tokens[++i];\n body += '\\n' + (textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'escape': {\n const escapeToken = token;\n out += renderer.text(escapeToken.text);\n break;\n }\n case 'html': {\n const tagToken = token;\n out += renderer.html(tagToken.text);\n break;\n }\n case 'link': {\n const linkToken = token;\n out += renderer.link(linkToken.href, linkToken.title, this.parseInline(linkToken.tokens, renderer));\n break;\n }\n case 'image': {\n const imageToken = token;\n out += renderer.image(imageToken.href, imageToken.title, imageToken.text);\n break;\n }\n case 'strong': {\n const strongToken = token;\n out += renderer.strong(this.parseInline(strongToken.tokens, renderer));\n break;\n }\n case 'em': {\n const emToken = token;\n out += renderer.em(this.parseInline(emToken.tokens, renderer));\n break;\n }\n case 'codespan': {\n const codespanToken = token;\n out += renderer.codespan(codespanToken.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n const delToken = token;\n out += renderer.del(this.parseInline(delToken.tokens, renderer));\n break;\n }\n case 'text': {\n const textToken = token;\n out += renderer.text(textToken.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\nclass _Hooks {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess',\n 'processAllTokens'\n ]);\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n /**\n * Process all tokens before walk tokens\n */\n processAllTokens(tokens) {\n return tokens;\n }\n}\n\nclass Marked {\n defaults = _getDefaults();\n options = this.setOptions;\n parse = this.#parseMarkdown(_Lexer.lex, _Parser.parse);\n parseInline = this.#parseMarkdown(_Lexer.lexInline, _Parser.parseInline);\n Parser = _Parser;\n Renderer = _Renderer;\n TextRenderer = _TextRenderer;\n Lexer = _Lexer;\n Tokenizer = _Tokenizer;\n Hooks = _Hooks;\n constructor(...args) {\n this.use(...args);\n }\n /**\n * Run callback for every token\n */\n walkTokens(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(this, token));\n switch (token.type) {\n case 'table': {\n const tableToken = token;\n for (const cell of tableToken.header) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n for (const row of tableToken.rows) {\n for (const cell of row) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n const listToken = token;\n values = values.concat(this.walkTokens(listToken.items, callback));\n break;\n }\n default: {\n const genericToken = token;\n if (this.defaults.extensions?.childTokens?.[genericToken.type]) {\n this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {\n const tokens = genericToken[childTokens].flat(Infinity);\n values = values.concat(this.walkTokens(tokens, callback));\n });\n }\n else if (genericToken.tokens) {\n values = values.concat(this.walkTokens(genericToken.tokens, callback));\n }\n }\n }\n }\n return values;\n }\n use(...args) {\n const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n // set async to true if it was set to true before\n opts.async = this.defaults.async || opts.async || false;\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if ('renderer' in ext) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function (...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n }\n else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if ('tokenizer' in ext) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n const extLevel = extensions[ext.level];\n if (extLevel) {\n extLevel.unshift(ext.tokenizer);\n }\n else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n }\n else {\n extensions.startBlock = [ext.start];\n }\n }\n else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n }\n else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if ('childTokens' in ext && ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = this.defaults.renderer || new _Renderer(this.defaults);\n for (const prop in pack.renderer) {\n if (!(prop in renderer)) {\n throw new Error(`renderer '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const rendererProp = prop;\n const rendererFunc = pack.renderer[rendererProp];\n const prevRenderer = renderer[rendererProp];\n // Replace renderer with func to run extension, but fall back if false\n renderer[rendererProp] = (...args) => {\n let ret = rendererFunc.apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret || '';\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);\n for (const prop in pack.tokenizer) {\n if (!(prop in tokenizer)) {\n throw new Error(`tokenizer '${prop}' does not exist`);\n }\n if (['options', 'rules', 'lexer'].includes(prop)) {\n // ignore options, rules, and lexer properties\n continue;\n }\n const tokenizerProp = prop;\n const tokenizerFunc = pack.tokenizer[tokenizerProp];\n const prevTokenizer = tokenizer[tokenizerProp];\n // Replace tokenizer with func to run extension, but fall back if false\n // @ts-expect-error cannot type tokenizer function dynamically\n tokenizer[tokenizerProp] = (...args) => {\n let ret = tokenizerFunc.apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = this.defaults.hooks || new _Hooks();\n for (const prop in pack.hooks) {\n if (!(prop in hooks)) {\n throw new Error(`hook '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const hooksProp = prop;\n const hooksFunc = pack.hooks[hooksProp];\n const prevHook = hooks[hooksProp];\n if (_Hooks.passThroughHooks.has(prop)) {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (arg) => {\n if (this.defaults.async) {\n return Promise.resolve(hooksFunc.call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n const ret = hooksFunc.call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n }\n else {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (...args) => {\n let ret = hooksFunc.apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = this.defaults.walkTokens;\n const packWalktokens = pack.walkTokens;\n opts.walkTokens = function (token) {\n let values = [];\n values.push(packWalktokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n this.defaults = { ...this.defaults, ...opts };\n });\n return this;\n }\n setOptions(opt) {\n this.defaults = { ...this.defaults, ...opt };\n return this;\n }\n lexer(src, options) {\n return _Lexer.lex(src, options ?? this.defaults);\n }\n parser(tokens, options) {\n return _Parser.parse(tokens, options ?? this.defaults);\n }\n #parseMarkdown(lexer, parser) {\n return (src, options) => {\n const origOpt = { ...options };\n const opt = { ...this.defaults, ...origOpt };\n // Show warning if an extension set async to true but the parse was called with async: false\n if (this.defaults.async === true && origOpt.async === false) {\n if (!opt.silent) {\n console.warn('marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.');\n }\n opt.async = true;\n }\n const throwError = this.#onError(!!opt.silent, !!opt.async);\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens)\n .then(tokens => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n let tokens = lexer(src, opt);\n if (opt.hooks) {\n tokens = opt.hooks.processAllTokens(tokens);\n }\n if (opt.walkTokens) {\n this.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n }\n catch (e) {\n return throwError(e);\n }\n };\n }\n #onError(silent, async) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape$1(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n return msg;\n }\n if (async) {\n return Promise.reject(e);\n }\n throw e;\n };\n }\n}\n\nconst markedInstance = new Marked();\nfunction marked(src, opt) {\n return markedInstance.parse(src, opt);\n}\n/**\n * Sets the default options.\n *\n * @param options Hash of options\n */\nmarked.options =\n marked.setOptions = function (options) {\n markedInstance.setOptions(options);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n };\n/**\n * Gets the original marked default options.\n */\nmarked.getDefaults = _getDefaults;\nmarked.defaults = _defaults;\n/**\n * Use Extension\n */\nmarked.use = function (...args) {\n markedInstance.use(...args);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n};\n/**\n * Run callback for every token\n */\nmarked.walkTokens = function (tokens, callback) {\n return markedInstance.walkTokens(tokens, callback);\n};\n/**\n * Compiles markdown to HTML without enclosing `p` tag.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options\n * @return String of compiled HTML\n */\nmarked.parseInline = markedInstance.parseInline;\n/**\n * Expose\n */\nmarked.Parser = _Parser;\nmarked.parser = _Parser.parse;\nmarked.Renderer = _Renderer;\nmarked.TextRenderer = _TextRenderer;\nmarked.Lexer = _Lexer;\nmarked.lexer = _Lexer.lex;\nmarked.Tokenizer = _Tokenizer;\nmarked.Hooks = _Hooks;\nmarked.parse = marked;\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = _Parser.parse;\nconst lexer = _Lexer.lex;\n\nexport { _Hooks as Hooks, _Lexer as Lexer, Marked, _Parser as Parser, _Renderer as Renderer, _TextRenderer as TextRenderer, _Tokenizer as Tokenizer, _defaults as defaults, _getDefaults as getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n//# sourceMappingURL=marked.esm.js.map\n","function getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralize$2 = {exports: {}};\n\n/* global define */\nvar pluralize$1 = pluralize$2.exports;\n\nvar hasRequiredPluralize;\n\nfunction requirePluralize () {\n\tif (hasRequiredPluralize) return pluralize$2.exports;\n\thasRequiredPluralize = 1;\n\t(function (module, exports) {\n\t\t(function (root, pluralize) {\n\t\t /* istanbul ignore else */\n\t\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t\t // Node.\n\t\t module.exports = pluralize();\n\t\t } else {\n\t\t // Browser global.\n\t\t root.pluralize = pluralize();\n\t\t }\n\t\t})(pluralize$1, function () {\n\t\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t\t // while other rules can be optimized using an object for instant lookups.\n\t\t var pluralRules = [];\n\t\t var singularRules = [];\n\t\t var uncountables = {};\n\t\t var irregularPlurals = {};\n\t\t var irregularSingles = {};\n\n\t\t /**\n\t\t * Sanitize a pluralization rule to a usable regular expression.\n\t\t *\n\t\t * @param {(RegExp|string)} rule\n\t\t * @return {RegExp}\n\t\t */\n\t\t function sanitizeRule (rule) {\n\t\t if (typeof rule === 'string') {\n\t\t return new RegExp('^' + rule + '$', 'i');\n\t\t }\n\n\t\t return rule;\n\t\t }\n\n\t\t /**\n\t\t * Pass in a word token to produce a function that can replicate the case on\n\t\t * another word.\n\t\t *\n\t\t * @param {string} word\n\t\t * @param {string} token\n\t\t * @return {Function}\n\t\t */\n\t\t function restoreCase (word, token) {\n\t\t // Tokens are an exact match.\n\t\t if (word === token) return token;\n\n\t\t // Lower cased words. E.g. \"hello\".\n\t\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t\t // Upper cased words. E.g. \"WHISKY\".\n\t\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t\t // Title cased words. E.g. \"Title\".\n\t\t if (word[0] === word[0].toUpperCase()) {\n\t\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t\t }\n\n\t\t // Lower cased words. E.g. \"test\".\n\t\t return token.toLowerCase();\n\t\t }\n\n\t\t /**\n\t\t * Interpolate a regexp string.\n\t\t *\n\t\t * @param {string} str\n\t\t * @param {Array} args\n\t\t * @return {string}\n\t\t */\n\t\t function interpolate (str, args) {\n\t\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t\t return args[index] || '';\n\t\t });\n\t\t }\n\n\t\t /**\n\t\t * Replace a word using a rule.\n\t\t *\n\t\t * @param {string} word\n\t\t * @param {Array} rule\n\t\t * @return {string}\n\t\t */\n\t\t function replace (word, rule) {\n\t\t return word.replace(rule[0], function (match, index) {\n\t\t var result = interpolate(rule[1], arguments);\n\n\t\t if (match === '') {\n\t\t return restoreCase(word[index - 1], result);\n\t\t }\n\n\t\t return restoreCase(match, result);\n\t\t });\n\t\t }\n\n\t\t /**\n\t\t * Sanitize a word by passing in the word and sanitization rules.\n\t\t *\n\t\t * @param {string} token\n\t\t * @param {string} word\n\t\t * @param {Array} rules\n\t\t * @return {string}\n\t\t */\n\t\t function sanitizeWord (token, word, rules) {\n\t\t // Empty string or doesn't need fixing.\n\t\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t\t return word;\n\t\t }\n\n\t\t var len = rules.length;\n\n\t\t // Iterate over the sanitization rules and use the first one to match.\n\t\t while (len--) {\n\t\t var rule = rules[len];\n\n\t\t if (rule[0].test(word)) return replace(word, rule);\n\t\t }\n\n\t\t return word;\n\t\t }\n\n\t\t /**\n\t\t * Replace a word with the updated word.\n\t\t *\n\t\t * @param {Object} replaceMap\n\t\t * @param {Object} keepMap\n\t\t * @param {Array} rules\n\t\t * @return {Function}\n\t\t */\n\t\t function replaceWord (replaceMap, keepMap, rules) {\n\t\t return function (word) {\n\t\t // Get the correct token and case restoration functions.\n\t\t var token = word.toLowerCase();\n\n\t\t // Check against the keep object map.\n\t\t if (keepMap.hasOwnProperty(token)) {\n\t\t return restoreCase(word, token);\n\t\t }\n\n\t\t // Check against the replacement map for a direct word replacement.\n\t\t if (replaceMap.hasOwnProperty(token)) {\n\t\t return restoreCase(word, replaceMap[token]);\n\t\t }\n\n\t\t // Run all the rules against the word.\n\t\t return sanitizeWord(token, word, rules);\n\t\t };\n\t\t }\n\n\t\t /**\n\t\t * Check if a word is part of the map.\n\t\t */\n\t\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t\t return function (word) {\n\t\t var token = word.toLowerCase();\n\n\t\t if (keepMap.hasOwnProperty(token)) return true;\n\t\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t\t return sanitizeWord(token, token, rules) === token;\n\t\t };\n\t\t }\n\n\t\t /**\n\t\t * Pluralize or singularize a word based on the passed in count.\n\t\t *\n\t\t * @param {string} word The word to pluralize\n\t\t * @param {number} count How many of the word exist\n\t\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t\t * @return {string}\n\t\t */\n\t\t function pluralize (word, count, inclusive) {\n\t\t var pluralized = count === 1\n\t\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t\t return (inclusive ? count + ' ' : '') + pluralized;\n\t\t }\n\n\t\t /**\n\t\t * Pluralize a word.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.plural = replaceWord(\n\t\t irregularSingles, irregularPlurals, pluralRules\n\t\t );\n\n\t\t /**\n\t\t * Check if a word is plural.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.isPlural = checkWord(\n\t\t irregularSingles, irregularPlurals, pluralRules\n\t\t );\n\n\t\t /**\n\t\t * Singularize a word.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.singular = replaceWord(\n\t\t irregularPlurals, irregularSingles, singularRules\n\t\t );\n\n\t\t /**\n\t\t * Check if a word is singular.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.isSingular = checkWord(\n\t\t irregularPlurals, irregularSingles, singularRules\n\t\t );\n\n\t\t /**\n\t\t * Add a pluralization rule to the collection.\n\t\t *\n\t\t * @param {(string|RegExp)} rule\n\t\t * @param {string} replacement\n\t\t */\n\t\t pluralize.addPluralRule = function (rule, replacement) {\n\t\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t\t };\n\n\t\t /**\n\t\t * Add a singularization rule to the collection.\n\t\t *\n\t\t * @param {(string|RegExp)} rule\n\t\t * @param {string} replacement\n\t\t */\n\t\t pluralize.addSingularRule = function (rule, replacement) {\n\t\t singularRules.push([sanitizeRule(rule), replacement]);\n\t\t };\n\n\t\t /**\n\t\t * Add an uncountable word rule.\n\t\t *\n\t\t * @param {(string|RegExp)} word\n\t\t */\n\t\t pluralize.addUncountableRule = function (word) {\n\t\t if (typeof word === 'string') {\n\t\t uncountables[word.toLowerCase()] = true;\n\t\t return;\n\t\t }\n\n\t\t // Set singular and plural references for the word.\n\t\t pluralize.addPluralRule(word, '$0');\n\t\t pluralize.addSingularRule(word, '$0');\n\t\t };\n\n\t\t /**\n\t\t * Add an irregular word definition.\n\t\t *\n\t\t * @param {string} single\n\t\t * @param {string} plural\n\t\t */\n\t\t pluralize.addIrregularRule = function (single, plural) {\n\t\t plural = plural.toLowerCase();\n\t\t single = single.toLowerCase();\n\n\t\t irregularSingles[single] = plural;\n\t\t irregularPlurals[plural] = single;\n\t\t };\n\n\t\t /**\n\t\t * Irregular rules.\n\t\t */\n\t\t [\n\t\t // Pronouns.\n\t\t ['I', 'we'],\n\t\t ['me', 'us'],\n\t\t ['he', 'they'],\n\t\t ['she', 'they'],\n\t\t ['them', 'them'],\n\t\t ['myself', 'ourselves'],\n\t\t ['yourself', 'yourselves'],\n\t\t ['itself', 'themselves'],\n\t\t ['herself', 'themselves'],\n\t\t ['himself', 'themselves'],\n\t\t ['themself', 'themselves'],\n\t\t ['is', 'are'],\n\t\t ['was', 'were'],\n\t\t ['has', 'have'],\n\t\t ['this', 'these'],\n\t\t ['that', 'those'],\n\t\t // Words ending in with a consonant and `o`.\n\t\t ['echo', 'echoes'],\n\t\t ['dingo', 'dingoes'],\n\t\t ['volcano', 'volcanoes'],\n\t\t ['tornado', 'tornadoes'],\n\t\t ['torpedo', 'torpedoes'],\n\t\t // Ends with `us`.\n\t\t ['genus', 'genera'],\n\t\t ['viscus', 'viscera'],\n\t\t // Ends with `ma`.\n\t\t ['stigma', 'stigmata'],\n\t\t ['stoma', 'stomata'],\n\t\t ['dogma', 'dogmata'],\n\t\t ['lemma', 'lemmata'],\n\t\t ['schema', 'schemata'],\n\t\t ['anathema', 'anathemata'],\n\t\t // Other irregular rules.\n\t\t ['ox', 'oxen'],\n\t\t ['axe', 'axes'],\n\t\t ['die', 'dice'],\n\t\t ['yes', 'yeses'],\n\t\t ['foot', 'feet'],\n\t\t ['eave', 'eaves'],\n\t\t ['goose', 'geese'],\n\t\t ['tooth', 'teeth'],\n\t\t ['quiz', 'quizzes'],\n\t\t ['human', 'humans'],\n\t\t ['proof', 'proofs'],\n\t\t ['carve', 'carves'],\n\t\t ['valve', 'valves'],\n\t\t ['looey', 'looies'],\n\t\t ['thief', 'thieves'],\n\t\t ['groove', 'grooves'],\n\t\t ['pickaxe', 'pickaxes'],\n\t\t ['passerby', 'passersby']\n\t\t ].forEach(function (rule) {\n\t\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t\t });\n\n\t\t /**\n\t\t * Pluralization rules.\n\t\t */\n\t\t [\n\t\t [/s?$/i, 's'],\n\t\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t\t [/([^aeiou]ese)$/i, '$1'],\n\t\t [/(ax|test)is$/i, '$1es'],\n\t\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t\t [/(e[mn]u)s?$/i, '$1s'],\n\t\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t\t [/(her|at|gr)o$/i, '$1oes'],\n\t\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t\t [/sis$/i, 'ses'],\n\t\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t\t [/(child)(?:ren)?$/i, '$1ren'],\n\t\t [/eaux$/i, '$0'],\n\t\t [/m[ae]n$/i, 'men'],\n\t\t ['thou', 'you']\n\t\t ].forEach(function (rule) {\n\t\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t\t });\n\n\t\t /**\n\t\t * Singularization rules.\n\t\t */\n\t\t [\n\t\t [/s$/i, ''],\n\t\t [/(ss)$/i, '$1'],\n\t\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t\t [/ies$/i, 'y'],\n\t\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t\t [/(seraph|cherub)im$/i, '$1'],\n\t\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t\t [/(test)(?:is|es)$/i, '$1is'],\n\t\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t\t [/(matr|append)ices$/i, '$1ix'],\n\t\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t\t [/(child)ren$/i, '$1'],\n\t\t [/(eau)x?$/i, '$1'],\n\t\t [/men$/i, 'man']\n\t\t ].forEach(function (rule) {\n\t\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t\t });\n\n\t\t /**\n\t\t * Uncountable rules.\n\t\t */\n\t\t [\n\t\t // Singular words with no plurals.\n\t\t 'adulthood',\n\t\t 'advice',\n\t\t 'agenda',\n\t\t 'aid',\n\t\t 'aircraft',\n\t\t 'alcohol',\n\t\t 'ammo',\n\t\t 'analytics',\n\t\t 'anime',\n\t\t 'athletics',\n\t\t 'audio',\n\t\t 'bison',\n\t\t 'blood',\n\t\t 'bream',\n\t\t 'buffalo',\n\t\t 'butter',\n\t\t 'carp',\n\t\t 'cash',\n\t\t 'chassis',\n\t\t 'chess',\n\t\t 'clothing',\n\t\t 'cod',\n\t\t 'commerce',\n\t\t 'cooperation',\n\t\t 'corps',\n\t\t 'debris',\n\t\t 'diabetes',\n\t\t 'digestion',\n\t\t 'elk',\n\t\t 'energy',\n\t\t 'equipment',\n\t\t 'excretion',\n\t\t 'expertise',\n\t\t 'firmware',\n\t\t 'flounder',\n\t\t 'fun',\n\t\t 'gallows',\n\t\t 'garbage',\n\t\t 'graffiti',\n\t\t 'hardware',\n\t\t 'headquarters',\n\t\t 'health',\n\t\t 'herpes',\n\t\t 'highjinks',\n\t\t 'homework',\n\t\t 'housework',\n\t\t 'information',\n\t\t 'jeans',\n\t\t 'justice',\n\t\t 'kudos',\n\t\t 'labour',\n\t\t 'literature',\n\t\t 'machinery',\n\t\t 'mackerel',\n\t\t 'mail',\n\t\t 'media',\n\t\t 'mews',\n\t\t 'moose',\n\t\t 'music',\n\t\t 'mud',\n\t\t 'manga',\n\t\t 'news',\n\t\t 'only',\n\t\t 'personnel',\n\t\t 'pike',\n\t\t 'plankton',\n\t\t 'pliers',\n\t\t 'police',\n\t\t 'pollution',\n\t\t 'premises',\n\t\t 'rain',\n\t\t 'research',\n\t\t 'rice',\n\t\t 'salmon',\n\t\t 'scissors',\n\t\t 'series',\n\t\t 'sewage',\n\t\t 'shambles',\n\t\t 'shrimp',\n\t\t 'software',\n\t\t 'species',\n\t\t 'staff',\n\t\t 'swine',\n\t\t 'tennis',\n\t\t 'traffic',\n\t\t 'transportation',\n\t\t 'trout',\n\t\t 'tuna',\n\t\t 'wealth',\n\t\t 'welfare',\n\t\t 'whiting',\n\t\t 'wildebeest',\n\t\t 'wildlife',\n\t\t 'you',\n\t\t /pok[eĆ©]mon$/i,\n\t\t // Regexes.\n\t\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t\t /deer$/i, // \"deer\", \"reindeer\"\n\t\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t\t /measles$/i,\n\t\t /o[iu]s$/i, // \"carnivorous\"\n\t\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t\t /sheep$/i\n\t\t ].forEach(pluralize.addUncountableRule);\n\n\t\t return pluralize;\n\t\t}); \n\t} (pluralize$2));\n\treturn pluralize$2.exports;\n}\n\nvar pluralizeExports = requirePluralize();\nvar pluralize = /*@__PURE__*/getDefaultExportFromCjs(pluralizeExports);\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"šŸ‘»\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint, cause: e });\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up šŸ˜–\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message, { ...(options.cause && { cause: options.cause }) });\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return {\n message,\n name,\n plugin,\n hint,\n elements,\n title,\n details,\n stack,\n ...(this.cause instanceof Error && {\n cause: {\n name: this.cause.name,\n message: this.cause.message,\n stack: this.cause.stack,\n },\n }),\n };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n * @param {Error} [options.cause] The error that caused this one.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n * @param {Error} [options.cause] The error that caused this one.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Creates showError, showWarning utilities for use in custom pre-process and\n * post-process plugins.\n * @param {string} pluginName\n */\nexport function makePluginUtils(pluginName) {\n /** @typedef {Parameters<typeof showError>[2]} Options */\n return {\n /** @type {(message: string, options?: Options) => void} */\n showError: (msg, options) => showError(msg, pluginName, options),\n /** @type {(message: string, options?: Options) => void} */\n showWarning: (msg, options) => showWarning(msg, pluginName, options),\n };\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n\n/**\n * Takes a text string, trims it, splits it into lines,\n * finds the common indentation level, and then de-indents every line\n * by that common indentation level.\n *\n * @param {string} text - The text to be re-indented.\n * @returns {string} The re-indented text.\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\nimport { showError } from \"./utils.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n /** @param {CustomEvent} ev */\n const listener = async ev => {\n try {\n await cb(ev.detail);\n } catch (error) {\n const msg = `Error in handler for topic \"${topic}\": ${error.message}`;\n showError(msg, `sub:${topic}`, { cause: error });\n }\n };\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint, cause: err });\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint, cause: err });\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n background: var(--bg, #fff);\n color: rgb(120, 120, 120);\n color: var(--tocnav-normal-text, rgb(120, 120, 120));\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n box-shadow: 1px 1px 8px 0 var(--tocsidebar-shadow, rgba(100, 100, 100, 0.5));\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: var(--bg, #fff);\n color: var(--text, black);\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: var(--def-text, white);\n background: var(--def-bg, rgb(42, 90, 168));\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: var(--def-text, white);\n background: var(--defrow-border, rgb(42, 90, 168));\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: var(--tocnav-active-bg, #193766);\n color: var(--tocnav-active-text, black);\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"āš ļø\";\n}\n\n.respec-error-list > li::before {\n content: \"šŸ’„\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: var(--bg, #fff);\n color: var(--text, black);\n border: 5px solid #666;\n border-color: var(--tocsidebar-shadow, #666);\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n left: 0 !important;\n text-align: center;\n background: var(--tocsidebar-shadow, #ddd);\n color: var(--text, black);\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: var(--bg, white);\n color: var(--text, black);\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: var(--tocnav-hover-bg, #eee);\n color: var(--tocnav-hover-text, black);\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/markedjs/marked\n *\n */\n\nimport { getElementIndentation, reindent } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\n\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\n\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super\n .code(code, language, isEscaped)\n .replace(`class=\"language-`, `class=\"`);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw);\n }\n}\n\n/** @type {import('marked').MarkedOptions} */\nconst config = {\n gfm: true,\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport { reindent, xmlEscape } from \"./utils.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n āŒ\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}ā€¦\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${xmlEscape(err.message)}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/geonovum/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/geonovum/style.js\"),\n import(\"../src/geonovum/l10n.js\"),\n import(\"../src/core/github.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/geonovum/conformance.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/search-specref.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/data-tests.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/dfn-contract.js\"),\n /* Linter must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/core/linter-rules/privsec-section.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// As ReSpec injects a bunch of stuff async, the scroll position is not always\n// at the right place when we are done processing. The purpose of this module\n// is to reset window's location hash, which will cause the browser to scroll\n// the window to the correct point in the document when processing is done.\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!window.location.hash) {\n return;\n }\n\n // We have to use .then() here because otherwise we would get stuck\n // awaiting this plugin to finish.\n document.respec.ready.then(() => {\n const hash = decodeURIComponent(window.location.hash).slice(1);\n\n let newHash = hash;\n /** @type {HTMLElement|null} */\n const element = document.getElementById(newHash);\n\n // Check if hash contains any non-word character.\n const isLegacyFrag = /\\W/.test(newHash);\n\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/speced/respec/issues/1353\n if (!element && isLegacyFrag) {\n const id = newHash\n // Replace all non-word characters with a dash.\n .replace(/[\\W]+/gim, \"-\")\n // Remove any leading dashes.\n .replace(/^-+/, \"\")\n // Remove any trailing dashes.\n .replace(/-+$/, \"\");\n\n /** @type {HTMLElement|null} */\n const updatedElement = document.getElementById(id);\n if (updatedElement) {\n newHash = id;\n }\n }\n window.location.hash = `#${newHash}`;\n });\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for Geonovum documents\n */\nexport const name = \"geonovum/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst licenses = new Map([\n [\n \"cc0\",\n {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n ],\n [\n \"cc-by\",\n {\n name: \"Creative Commons Attribution 4.0 International Public License\",\n short: \"CC-BY\",\n url: \"https://creativecommons.org/licenses/by/4.0/legalcode\",\n },\n ],\n [\n \"cc-by-nd\",\n {\n name: \"Creative Commons Attribution-NoDerivatives 4.0 International Public License\",\n short: \"CC-BY-ND\",\n url: \"https://creativecommons.org/licenses/by-nd/4.0/legalcode.nl\",\n },\n ],\n]);\n\nconst geonovumDefaults = {\n lint: {\n \"privsec-section\": true,\n },\n doJsonLd: true,\n license: \"cc-by\",\n specStatus: \"GN-BASIS\",\n logos: [\n {\n src: \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg\",\n alt: \"Geonovum\",\n id: \"Geonovum\",\n height: 67,\n width: 132,\n url: \"https://www.geonovum.nl/\",\n },\n ],\n};\n\nfunction computeProps(conf) {\n return {\n isCCBY: conf.license === \"cc-by\",\n licenseInfo: licenses.get(conf.license),\n isBasic: conf.specStatus === \"GN-BASIS\",\n isRegular: conf.specStatus === \"GN-BASIS\",\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...geonovumDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...geonovumDefaults,\n ...conf,\n lint,\n });\n // computed properties\n Object.assign(conf, computeProps(conf));\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOF --- */\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"Ā§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// The purpose of this module is to insert the default ReSpec CSS into the document.\n// If you don't want to use the default ReSpec CSS, set the `noReSpecCSS` configuration\n// option to `true`. If you want to use your own styles, create a ReSpec profile that\n// includes your own styles and sets the `noReSpecCSS` configuration option to `true`.\n\n/**\n * Module Name.\n * @type {string}\n */\nexport const name = \"core/style\";\n\nimport css from \"../styles/respec.css.js\";\n\n// Opportunistically inserts the style to reduce some FOUC.\n/** @type {HTMLStyleElement} */\nconst styleElement = insertStyle();\n\n/**\n * Inserts the ReSpec CSS as a `style` element into the document's `head`.\n * @return {HTMLStyleElement} The `style` element that was inserted.\n */\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\n/**\n * Removes the ReSpec CSS if the `noReSpecCSS` configuration option is `true`.\n * @param {Conf} conf The document configuration object.\n */\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n// Module geonovum/style\n// Inserts a link to the appropriate Geonovum style for the specification's maturity level.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n\nimport {\n createResourceHint,\n linkCSS,\n showWarning,\n toKeyValuePairs,\n} from \"../core/utils.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"geonovum/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n script.addEventListener(\n \"load\",\n () => {\n if (window.location.hash) {\n window.location.href = window.location.hash;\n }\n },\n { once: true }\n );\n script.src = `https://www.w3.org/scripts/TR/${version}/fixup.js`;\n doc.body.appendChild(script);\n}\n\n/**\n * Make a best effort to attach meta viewport at the top of the head.\n * Other plugins might subsequently push it down, but at least we start\n * at the right place. When ReSpec exports the HTML, it again moves the\n * meta viewport to the top of the head - so to make sure it's the first\n * thing the browser sees. See js/ui/save-html.js.\n */\nfunction createMetaViewport() {\n const meta = document.createElement(\"meta\");\n meta.name = \"viewport\";\n const contentProps = {\n width: \"device-width\",\n \"initial-scale\": \"1\",\n \"shrink-to-fit\": \"no\",\n };\n meta.content = toKeyValuePairs(contentProps).replace(/\"/g, \"\");\n return meta;\n}\n\nfunction createStyle(css_name) {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = `https://tools.geostandaarden.nl/respec/style/${css_name}.css`;\n return link;\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C fixup.js\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2016/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preconnect\", // for Geonovum styles and scripts.\n href: \"https://tools.geostandaarden.nl/\",\n },\n {\n hint: \"preload\", // all Geonovum specs import base.css.\n href: \"https://tools.geostandaarden.nl/respec/style/base.css\",\n as: \"style\",\n },\n {\n hint: \"preload\", // all Geonovum specs show the logo.\n href: \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg\",\n as: \"image\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// add favicon for Geonovum\nconst favicon = document.createElement(\"link\");\nfavicon.rel = \"shortcut icon\";\nfavicon.type = \"image/x-icon\";\nfavicon.href =\n \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.ico\";\ndocument.head.prepend(favicon);\n\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(createMetaViewport());\n}\n\ndocument.head.prepend(elements);\n\n// export function run(conf, doc, cb) {\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"`respecConfig.specStatus` missing. Defaulting to 'GN-BASIS'.\";\n conf.specStatus = \"GN-BASIS\";\n showWarning(msg, name);\n }\n\n if (document.body.querySelector(\"figure.scalable\")) {\n // Apply leaflet style if class scalable is present\n document.head.appendChild(createStyle(\"leaflet\"));\n document.head.appendChild(createStyle(\"font-awesome\"));\n }\n\n let styleFile = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"GN-WV\":\n styleFile += \"GN-WV.css\";\n break;\n case \"GN-CV\":\n styleFile += \"GN-CV.css\";\n break;\n case \"GN-VV\":\n styleFile += \"GN-VV.css\";\n break;\n case \"GN-DEF\":\n styleFile += \"GN-DEF.css\";\n break;\n case \"GN-BASIS\":\n styleFile += \"GN-BASIS.css\";\n break;\n default:\n styleFile = \"base.css\";\n }\n\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://tools.geostandaarden.nl/respec/style/${styleFile}`;\n linkCSS(document, finalStyleURL);\n}\n","// @ts-check\n// Module geonovum/l10n\n// Looks at the lang attribute on the root element and uses it to manage the config.l10n object so\n// that other parts of the system can localise their text\nimport { html } from \"../core/import-maps.js\";\nimport { l10n } from \"../core/l10n.js\";\nexport const name = \"geonovum/l10n\";\nconst additions = {\n en: {\n status_at_publication: html`This section describes the status of this\n document at the time of its publication. Other documents may supersede\n this document. A list of current Geonovum publications and the latest\n revision of this document can be found via\n <a href=\"https://www.geonovum.nl/geo-standaarden/alle-standaarden\"\n >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a\n >(in Dutch).`,\n },\n nl: {\n status_at_publication: html`Deze paragraaf beschrijft de status van dit\n document ten tijde van publicatie. Het is mogelijk dat er actuelere\n versies van dit document bestaan. Een lijst van Geonovum publicaties en de\n laatste gepubliceerde versie van dit document zijn te vinden op\n <a href=\"https://www.geonovum.nl/geo-standaarden/alle-standaarden\"\n >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a\n >.`,\n },\n};\n\nObject.keys(additions).forEach(key => {\n if (!l10n[key]) l10n[key] = {};\n Object.assign(l10n[key], additions[key]);\n});\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/speced/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"ģ°øģ—¬\",\n },\n zh: {\n file_a_bug: \"反馈错čÆÆ\",\n participate: \"参äøŽļ¼š\",\n },\n ja: {\n commit_history: \"å¤‰ę›“å±„ę­“\",\n file_a_bug: \"問锌報告\",\n participate: \"å‚åŠ ę–¹ę³•ļ¼š\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${ghURL.href}).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n showError(msg, name, { elements: [el], cause: err });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","// @ts-check\n/**\n * @module core/reindent\n *\n * Normalizes indents across the pre elements in the document,\n * so that indentation inside <pre> won't affect the rendered result.\n */\nimport { reindent } from \"./utils.js\";\nexport const name = \"core/reindent\";\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/speced/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"ģ°øģ”°\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参ē…§ē”Øå‚č€ƒę–‡ēŒ®\",\n norm_references: \"č¦ēƄēš„å‚č€ƒę–‡ēŒ®\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n de: {\n info_references: \"WeiterfĆ¼hrende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"éžč§„čŒƒę€§å¼•ē”Ø\",\n norm_references: \"č§„čŒƒę€§å¼•ē”Ø\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n if (!output.endsWith(\".\")) output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMƜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NƖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDƜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKƖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;\"?<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn or a `a`, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn,a\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn|abstract-op\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n /** @param {string} str */\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"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`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"ģ˜ˆģ‹œ\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-color: var(--warning-border, #f11);\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n background: var(--warning-bg, #fbe9e9);\n color: black;\n color: var(--text, black);\n}\n\n.warning-title:before {\n content: \"āš \"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"ę³Ø\",\n editors_note: \"ē·Ø者ę³Ø\",\n feature_at_risk: \"(å¤‰ę›“ć®åÆčƒ½ę€§ć®ć‚ć‚‹ę©Ÿčƒ½) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 恮要ē“„\",\n no_issues_in_spec: \"ć“ć®ä»•ę§˜ć«ćÆęœŖč§£ę±ŗ恮 issues ćÆå«ć¾ć‚Œć¦ć„ć¾ć›ć‚“ļ¼Ž\",\n warning: \"č­¦å‘Š\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"CuestiĆ³n\",\n issue_summary: \"Resumen de la cuestiĆ³n\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificaciĆ³n.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthƤlt keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"ē¼–者ę³Ø\",\n feature_at_risk: \"ļ¼ˆęœ‰åÆčƒ½å˜åŠØēš„ē‰¹ę€§ļ¼‰Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue ꀻē»“\",\n no_issues_in_spec: \"ęœ¬č§„čŒƒäø­ęœŖ列å‡ŗ任何 issue怂\",\n note: \"ę³Ø\",\n warning: \"č­¦å‘Š\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"꜀č‰Æå®Ÿę–½ä¾‹ \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"ęœ€ä½³å®žč·µ \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"å›³ć®ćƒŖć‚¹ćƒˆ\",\n },\n ko: {\n fig: \"ź·øė¦¼ \",\n list_of_figures: \"ź·øė¦¼ ėŖ©ė”\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范äø­åŒ…含ēš„图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of the specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n *\n * @module core/data-cite\n */\n\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to the current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n * @type {string}\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * Gets the link properties for the given citation details.\n * @param {CiteDetails} citeDetails - The citation details.\n * @returns {Promise<LinkProps|null>} The link properties or null if not found.\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/speced/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n\n return { href, title };\n}\n\n/**\n * Links the given element with the provided link properties and citation details.\n * @param {HTMLElement} elem - The element to link.\n * @param {LinkProps} linkProps - The link properties.\n * @param {CiteDetails} citeDetails - The citation details.\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n anchor.dataset.cite = citeDetails.key;\n anchor.dataset.citePath = citeDetails.path;\n anchor.dataset.citeFrag = citeDetails.frag;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting a linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * Converts the given raw key to citation details.\n * @param {HTMLElement} elem - The element containing the citation details.\n * @returns {CiteDetails} The citation details.\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as a fragment\n return toCiteDetails(elem);\n }\n\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\n/**\n * Runs the data-cite processing on elements with the data-cite attribute.\n */\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetches and updates `biblio` with entries corresponding to the given elements.\n * @param {HTMLElement[]} elems - The elements requiring biblio entries.\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/**\n * Cleans up the data-cite attributes from the document.\n * @param {Document} doc - The document to cleanup.\n */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ć®é‡č¤‡å®šē¾©`;\n },\n duplicateTitle: \"恓恮ꖇę›øå†…ć§č¤‡ę•°å›žå®šē¾©ć•ć‚Œć¦ć„ć¾ć™ļ¼Ž\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthƤlt mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ēš„重复定义`;\n },\n duplicateTitle: \"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n for (const type of linkType.split(\"|\")) {\n if (dfnsByType.get(type)) {\n return dfnsByType.get(type);\n }\n }\n return dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name, { cause: error });\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大ēŗ²\",\n },\n ko: {\n toc: \"ėŖ©ģ°Ø\",\n },\n ja: {\n toc: \"ē›®ę¬”\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at Ā§1, we will keep Ā§1.1 but not Ā§1.1.1\n // Similarly, `data-max-toc=1` will keep Ā§1, but not Ā§1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"ģ“ ė¶€ė¶„ģ€ ė¹„ź·œė²”ģ ģž…ė‹ˆė‹¤.\",\n },\n ja: {\n informative: \"恓恮ēƀćÆä»•ę§˜ć«ćÆå«ć¾ć‚Œć¾ć›ć‚“ļ¼Ž\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module geonovum/conformance\n// Handle the conformance section properly.\n// based on W3C conformance, but because Geonovum has different requirements, have a separate module\nimport { html } from \"../core/import-maps.js\";\nexport const name = \"geonovum/conformance\";\n\n/**\n * @param {Element} conformance\n */\nfunction processConformance(conformance) {\n const content = html`\n <h2>Conformiteit</h2>\n <p>\n Naast onderdelen die als niet normatief gemarkeerd zijn, zijn ook alle\n diagrammen, voorbeelden, en noten in dit document niet normatief. Verder\n is alles in dit document normatief.\n </p>\n <p>Informatief en normatief.</p>\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run() {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance) {\n processConformance(conformance);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"äæå­˜ć™ć‚‹\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"åƼå‡ŗ\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"šŸ’¾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/search-specref\n// Search Specref database\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/specref/\";\n\nconst localizationStrings = {\n en: {\n search_specref: \"Search Specref\",\n },\n nl: {\n search_specref: \"Doorzoek Specref\",\n },\n ja: {\n search_specref: \"ä»•ę§˜ę¤œē“¢\",\n },\n de: {\n search_specref: \"Spezifikationen durchsuchen\",\n },\n zh: {\n search_specref: \"ꐜē“¢ Specref\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst button = ui.addCommand(\n l10n.search_specref,\n show,\n \"Ctrl+Shift+Alt+space\",\n \"šŸ”Ž\"\n);\n\nfunction show() {\n const onLoad = e => e.target.classList.add(\"ready\");\n /** @type {HTMLElement} */\n const specrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=${onLoad}></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.search_specref, specrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关äŗŽ\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"ć“ć‚Œć«ć¤ć„ć¦\",\n },\n de: {\n about_respec: \"Ɯber\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ā„¹ļø\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/speced/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/speced/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\nimport { html } from \"../core/import-maps.js\";\n\nexport const name = \"core/seo\";\n\nexport function run(conf) {\n if (conf.gitRevision) {\n // This allows to set a git revision of the source used to produce the\n // generated content. Typically, this would be set when generating the\n // static HTML via a build process.\n // 'revision' is the name recommended in https://wiki.whatwg.org/wiki/MetaExtensions\n const metaElem = html`<meta\n name=\"revision\"\n content=\"${conf.gitRevision}\"\n />`;\n document.head.appendChild(metaElem);\n }\n\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","/*\nOne Light for ReSpec, with better color contrast\nAdapted from Atom One Light by Daniel Gamage (https://github.com/highlightjs/highlight.js/blob/c0b6ddbaaf7/src/styles/atom-one-light.css>\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n --base: #fafafa;\n --mono-1: #383a42;\n --mono-2: #686b77;\n --mono-3: #717277;\n --hue-1: #0b76c5;\n --hue-2: #336ae3;\n --hue-3: #a626a4;\n --hue-4: #42803c;\n --hue-5: #ca4706;\n --hue-5-2: #c91243;\n --hue-6: #986801;\n --hue-6-2: #9a6a01;\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n .hljs {\n --base: #282c34;\n --mono-1: #abb2bf;\n --mono-2: #818896;\n --mono-3: #5c6370;\n --hue-1: #56b6c2;\n --hue-2: #61aeee;\n --hue-3: #c678dd;\n --hue-4: #98c379;\n --hue-5: #e06c75;\n --hue-5-2: #be5046;\n --hue-6: #d19a66;\n --hue-6-2: #e6c07b;\n }\n}\n\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n color: var(--mono-1, #383a42);\n background: #fafafa;\n background: var(--base, #fafafa);\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n color: var(--mono-3, #717277);\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n color: var(--hue-3, #a626a4);\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n color: var(--hue-5, #ca4706);\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n color: var(--hue-1, #0b76c5);\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n color: var(--hue-4, #42803c);\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n color: var(--hue-6-2, #9a6a01);\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n color: var(--hue-6, #986801);\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n color: var(--hue-2, #336ae3);\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\n/**\n * Module core/data-tests\n *\n * Allows specs to link to test files in a test suite, by adding `details` of where\n * particular tests for a testable assertion can be found.\n *\n * `data-tests` takes a space separated list of URLs, e.g. data-test=\"foo.html bar.html\".\n *\n * Docs: https://respec.org/doc/#data-tests\n */\nimport {\n codedJoinAnd,\n docLink,\n getIntlData,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst localizationStrings = {\n en: {\n missing_test_suite_uri: docLink`Found tests in your spec, but missing ${\"[testSuiteURI]\"} in your ReSpec config.`,\n tests: \"tests\",\n test: \"test\",\n },\n ja: {\n missing_test_suite_uri: docLink`ć“ć®ä»•ę§˜å†…ć«ćƒ†ć‚¹ćƒˆć®é …ē›®ć‚’ę¤œå‡ŗć—ć¾ć—ćŸćŒļ¼ŒReSpec 恮čØ­å®šć« ${\"[testSuiteURI]\"} ćŒč¦‹ć¤ć‹ć‚Šć¾ć›ć‚“ļ¼Ž`,\n tests: \"ćƒ†ć‚¹ćƒˆ\",\n test: \"ćƒ†ć‚¹ćƒˆ\",\n },\n de: {\n missing_test_suite_uri: docLink`Die Spezifikation enthƤlt Tests, aber in der ReSpec-Konfiguration ist keine ${\"[testSuiteURI]\"} angegeben.`,\n tests: \"Tests\",\n test: \"Test\",\n },\n zh: {\n missing_test_suite_uri: docLink`ęœ¬č§„čŒƒäø­åŒ…å«ęµ‹čƕļ¼Œä½†åœØ ReSpec 配ē½®äø­ē¼ŗ少 ${\"[testSuiteURI]\"}怂`,\n tests: \"굋čƕ\",\n test: \"굋čƕ\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport const name = \"core/data-tests\";\n\nfunction toListItem(href) {\n const emojiList = [];\n const [testFile] = new URL(href).pathname.split(\"/\").reverse();\n const testParts = testFile.split(\".\");\n let [testFileName] = testParts;\n\n const isSecureTest = testParts.find(part => part === \"https\");\n if (isSecureTest) {\n const requiresConnectionEmoji = document.createElement(\"span\");\n requiresConnectionEmoji.textContent = \"šŸ”’\";\n requiresConnectionEmoji.setAttribute(\n \"aria-label\",\n \"requires a secure connection\"\n );\n requiresConnectionEmoji.setAttribute(\"title\", \"Test requires HTTPS\");\n testFileName = testFileName.replace(\".https\", \"\");\n emojiList.push(requiresConnectionEmoji);\n }\n\n const isManualTest = testFileName\n .split(\".\")\n .join(\"-\")\n .split(\"-\")\n .find(part => part === \"manual\");\n if (isManualTest) {\n const manualPerformEmoji = document.createElement(\"span\");\n manualPerformEmoji.textContent = \"šŸ’Ŗ\";\n manualPerformEmoji.setAttribute(\n \"aria-label\",\n \"the test must be run manually\"\n );\n manualPerformEmoji.setAttribute(\"title\", \"Manual test\");\n testFileName = testFileName.replace(\"-manual\", \"\");\n emojiList.push(manualPerformEmoji);\n }\n\n const testList = html`\n <li>\n <a href=\"${href}\">${testFileName}</a>\n ${emojiList}\n </li>\n `;\n return testList;\n}\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n if (!testables.length) {\n return;\n }\n if (!conf.testSuiteURI) {\n showError(l10n.missing_test_suite_uri, name);\n return;\n }\n\n for (const elem of testables) {\n const tests = elem.dataset.tests.split(/,/gm).map(url => url.trim());\n const testURLs = toTestURLs(tests, conf.testSuiteURI, elem);\n handleDuplicates(testURLs, elem);\n const details = toHTML(testURLs);\n elem.append(details);\n }\n}\n\n/**\n * @param {string[]} tests\n * @param {string} testSuiteURI\n * @param {HTMLElement} elem\n */\nfunction toTestURLs(tests, testSuiteURI, elem) {\n return tests\n .map(test => {\n try {\n return new URL(test, testSuiteURI).href;\n } catch {\n const msg = docLink`Invalid URL in ${\"[data-tests]\"} attribute: ${test}.`;\n showWarning(msg, name, { elements: [elem] });\n }\n })\n .filter(href => href);\n}\n\n/**\n * @param {string[]} testURLs\n * @param {HTMLElement} elem\n */\nfunction handleDuplicates(testURLs, elem) {\n const duplicates = testURLs.filter(\n (link, i, self) => self.indexOf(link) !== i\n );\n if (duplicates.length) {\n const msg = docLink`Duplicate tests found in the ${\"[data-tests]\"} attribute.`;\n const tests = codedJoinAnd(duplicates, { quotes: true });\n const hint = docLink`To fix, remove duplicates from ${\"[data-tests]\"}: ${tests}.`;\n showWarning(msg, name, { hint, elements: [elem] });\n }\n}\n\n/**\n * @param {string[]} testURLs\n */\nfunction toHTML(testURLs) {\n const uniqueList = [...new Set(testURLs)];\n const details = html`\n <details class=\"respec-tests-details removeOnSave\">\n <summary>tests: ${uniqueList.length}</summary>\n <ul>\n ${uniqueList.map(toListItem)}\n </ul>\n </details>\n `;\n return details;\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n var.respec-hl {\n filter: saturate(0.9) brightness(0.9)\n }\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within the algorithm or the encompassing section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\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","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n:root {\n --assertion-border: #aaa;\n --assertion-bg: #eee;\n --assertion-text: black;\n}\n\n.assert {\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n border-color: #aaa;\n border-color: var(--assertion-border);\n background: #eee;\n background: var(--assertion-bg);\n color: black;\n color: var(--assertion-text);\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n :root {\n --assertion-border: #444;\n --assertion-bg: var(--borderedblock-bg);\n --assertion-text: var(--text);\n }\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"Ā§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/speced/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n background: var(--indextable-hover-bg, #fff);\n color: black;\n color: var(--text, black);\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: 0 1em 3em -0.4em var(--tocsidebar-shadow, rgba(0, 0, 0, 0.3)),\n 0 0 1px 1px var(--tocsidebar-shadow, rgba(0, 0, 0, 0.05));\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n border-bottom-color: var(--indextable-hover-bg, #fff);\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n /* TODO: need slightly darker shade */\n border-bottom-color: var(--indextable-hover-bg, #a2a9b1);\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n color: var(--text, #000);\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n color: var(--text, #333);\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => {\n return html`<li>\n ${toLinkProps(entry).map(link => {\n return html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a\n >${\" \"}`;\n })}\n </li>`;\n };\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `Ā§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","export const name = \"core/dfn-contract\";\n\nexport function run() {\n addContractDefaults();\n addDefinitionPointers();\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n\n// - Sets data-defines on well-known definition content patterns\nfunction addDefinitionPointers() {\n // A dl with class hasdefinitions associated the dfn in each dt\n // the definition in the following sibling element\n /** @type NodeListOf<HTMLElement> */\n const describedDTs = document.querySelectorAll(\n \"dl.definitions dt:has(dfn[data-dfn-type])\"\n );\n for (const dt of describedDTs) {\n const dfnId = dt.querySelector(\"dfn[data-dfn-type]\").id;\n const dfnContent = /** @type {HTMLElement | null} */ (\n dt.nextElementSibling\n );\n if (dfnContent && !dfnContent.dataset.defines && dfnId) {\n dfnContent.dataset.defines = `#${dfnId}`;\n }\n }\n\n // an element with class \"definition\" is marked as defining the term\n // found in the element\n /** @type NodeListOf<HTMLElement> */\n const definitionContainers = document.querySelectorAll(\n \".definition:has(dfn[data-dfn-type])\"\n );\n for (const el of definitionContainers) {\n const dfn = el.querySelector(\"dfn[data-dfn-type]\");\n if (dfn.id && !el.dataset.defines) {\n el.dataset.defines = `#${dfn.id}`;\n }\n }\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ \\`<meta>\\` ꠇē­¾`,\n hint: `å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ \\`<head>\\` éƒØ分ā€”ā€” \\`<meta charset=\"utf-8\">\\` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂\",\n hint: \"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * Checks that there is a section that has at least privacy and/or\n * security and considerations.\n *\n * The rule is \"privacy\" or \"security\", and \"considerations\", in any order,\n * case-insensitive, multi-line check.\n *\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"privsec-section\";\nexport const name = \"core/linter-rules/privsec-section\";\n\nconst localizationStrings = {\n en: {\n msg: \"Document must have a 'Privacy and/or Security' Considerations section.\",\n hint:\n \"Add a privacy and/or security considerations section. \" +\n \"See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/).\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nfunction hasPriSecConsiderations(doc) {\n return Array.from(doc.querySelectorAll(\"h2, h3, h4, h5, h6\")).some(\n ({ textContent: text }) => {\n const saysPrivOrSec = /(privacy|security)/im.test(text);\n const saysConsiderations = /(considerations)/im.test(text);\n return (saysPrivOrSec && saysConsiderations) || saysPrivOrSec;\n }\n );\n}\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n if (conf.isRecTrack && !hasPriSecConsiderations(document)) {\n showWarning(l10n.msg, name, { hint: l10n.hint });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,\n hint: \"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","instanceOfAny","constructors","some","c","idbProxyableTypes","cursorAdvanceMethods","transactionDoneMap","WeakMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","replaceTraps","wrapFunction","func","IDBCursor","prototype","advance","continue","continuePrimaryKey","includes","args","apply","unwrap","this","request","transformCachableValue","tx","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","addEventListener","cacheDonePromiseForTransaction","IDBDatabase","IDBObjectStore","IDBIndex","Proxy","IDBRequest","promise","success","result","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","transaction","store","index","shift","oldTraps","advanceMethodProps","methodMap","advanceResults","ittrProxiedCursorToOriginalProxy","cursorIteratorTraps","cachedFunc","iterate","cursor","openCursor","proxiedCursor","delete","isIteratorProp","Symbol","asyncIterator","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","catch","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","_getDefaults","breaks","extensions","gfm","hooks","pedantic","renderer","silent","tokenizer","walkTokens","_defaults","changeDefaults","newDefaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape$1","encode","unescapeTest","unescape","_","n","charAt","String","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","valSource","getRegex","cleanUrl","href","encodeURI","e","noopTest","exec","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","i","trim","length","pop","splice","push","rtrim","invert","l","suffLen","currChar","slice","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","_Tokenizer","options","rules","constructor","space","src","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","anyPunctuation","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","bull","isordered","ordered","start","loose","items","itemRegex","itemContents","endsWithBlankLine","endEarly","line","t","repeat","nextLine","indent","trimStart","search","blankLine","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","rawLine","ischecked","istask","task","checked","trimEnd","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","headers","aligns","rows","item","header","align","row","cell","lheading","paragraph","escape","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","indexOf","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","emStrongLDelim","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","emStrongRDelimAst","emStrongRDelimUnd","lastIndex","lastCharLength","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","bullet","_paragraph","_blockLabel","_tag","_comment","blockNormal","gfmTable","blockGfm","blockPedantic","_punctuation","_inlineComment","_inlineLabel","inlineNormal","blockSkip","reflinkSearch","inlinePedantic","inlineGfm","inlineBreaks","normal","_Lexer","inlineQueue","Object","create","lex","lexInline","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","call","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","charCodeAt","console","keepPrevChar","keys","lastIndexOf","startInline","_Renderer","infostring","quote","body","listitem","checkbox","tablerow","content","tablecell","flags","strong","em","cleanHref","out","image","_TextRenderer","_Parser","textRenderer","parse","parseInline","renderers","genericToken","ret","parser","headingToken","codeToken","tableToken","j","k","blockquoteToken","listToken","itemBody","unshift","htmlToken","paragraphToken","textToken","escapeToken","tagToken","linkToken","imageToken","strongToken","emToken","codespanToken","delToken","_Hooks","static","Set","preprocess","markdown","postprocess","processAllTokens","markedInstance","defaults","setOptions","parseMarkdown","Parser","Renderer","TextRenderer","Lexer","Tokenizer","Hooks","use","values","concat","childTokens","flat","pack","opts","ext","prevRenderer","extLevel","rendererProp","rendererFunc","tokenizerProp","tokenizerFunc","prevTokenizer","hooksProp","hooksFunc","prevHook","passThroughHooks","arg","packWalktokens","origOpt","warn","throwError","onError","toString","message","msg","marked","getDefaultExportFromCjs","x","__esModule","hasOwnProperty","marked$1","getDefaults","hasRequiredPluralize","pluralize$2","exports","module","pluralizeExports","root","pluralize","pluralize$1","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","arguments","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","configurable","o","random","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","v","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","detail","CustomEvent","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ne","re","ie","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","sort","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","setTimeout","addedNodes","removedNodes","dispatchEvent","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","key","serialize","_pluralize","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","lang$1","docLang","startsWith","nonNormativeSelector","createResourceHint","URL","baseURI","linkElem","rel","hint","origin","corsMode","location","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","cause","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","getElementsByTagName","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parent","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","markAsOffending","toJSON","stack","details","showError","pluginName","pub","makePluginUtils","toMDCode","codedJoinOr","quotes","addQuotes","docLink","strings","reindent","endsWith","linkingText","lines","indents","leastIndent","subscriptions","EventTarget","topic","self","JSON","stringify","postMessage","sub","cb","once","ev","removeList","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","toHTML","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodeURIComponent","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","utils","err","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$f","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","buttonId","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","locationHash","l10n$o","style$1","l10n$m","github$1","dataInclude","dataTransform","inlines","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","conformance","saveHtml","searchSpecref","aboutRespec","seo","highlight","dataTests","listSorter","highlightVars$1","algorithms","anchorExpander","dfnPanel","dfnContract","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","newHash","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","geonovumDefaults","doJsonLd","license","logos","alt","height","width","isCCBY","licenseInfo","isBasic","isRegular","computeProps","css$d","noReSpecCSS","createStyle","css_name","resourceHints","createResourceHints","favicon","meta","delimiter","separator","toKeyValuePairs","createMetaViewport","styleFile","noToc","attachFixupScript","urls","frag","reduce","nextLink","linkCSS","additions","status_at_publication","nl","resolveGithubPromise","rejectGithubPromise","github","file_a_bug","participate","commit_history","ko","zh","ja","es","ghURL","tempURL","repoURL","org","repo","pathname","branch","issueBase","commitHistoryURL","newProps","edDraftURI","githubToken","githubUser","atRiskBase","otherLinks","pullBase","shortName","githubAPI","hostname","excludeGithubLinks","otherLink","normalizedGHObj","apiBase","fullName","issuesURL","pullsURL","newIssuesURL","normalizedConfig","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","base","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","Date","range","IDBKeyRange","lowerBound","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","addAll","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","clear","storeNames","stores","clearStorePromises","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","authors","etAl","publisher","date","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","contains","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","closestType","computeExport","export","titles","pluralizeDfn","dfnTexts","dfns","getPluralizer","terms","plurals","userDefinedPlurals","uniquePlurals","css$b","makeTitle","num","report","number","div","inAside","exampleTitle","css$9","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","note","handleIssues","ins","ghIssues","getIssueNumber","Number","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","insertAdjacentHTML","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","issueNumbers","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","every","decorateTableOfFigures","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","citePath","citeFrag","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","editors","editor","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","toISOString","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","processConformance","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","publishDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","search_specref","specrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","gitRevision","metaElem","firstParagraph","css$7","fetchBase","_documentCurrentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","missing_test_suite_uri","tests","toListItem","emojiList","testFile","testParts","testFileName","requiresConnectionEmoji","manualPerformEmoji","toTestURLs","testSuiteURI","handleDuplicates","testURLs","codedJoinAnd","uniqueList","testables","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$5","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","css$3","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","dfnsWithNoType","exportableDfns","addContractDefaults","describedDTs","dfnId","dfnContent","defines","definitionContainers","addDefinitionPointers","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"qHACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IAClD,EACDV,EAAQG,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,0BAA2B,OAC5B,CAAC,+BAAgC,QACjC,CAAC,sBAAuB,QACxB,CAAC,oBAAqB,UACtB,CAAC,eAAgB,MACjB,CAAC,YAAa,MACd,CAAC,QAAS,QACVvH,SAAQ,SAAUuH,GAClB,OAAOR,EAAU4B,gBAAgBpB,EAAK,GAAIA,EAAK,GACrD,IAKI,CAEE,YACA,SACA,SACA,MACA,WACA,UACA,OACA,YACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,SACA,WACA,YACA,MACA,SACA,YACA,YACA,YACA,WACA,WACA,MACA,UACA,UACA,WACA,WACA,eACA,SACA,SACA,YACA,WACA,YACA,cACA,QACA,UACA,QACA,SACA,aACA,YACA,WACA,OACA,QACA,OACA,QACA,QACA,MACA,QACA,OACA,OACA,YACA,OACA,WACA,SACA,SACA,YACA,WACA,OACA,WACA,OACA,SACA,WACA,SACA,SACA,WACA,SACA,WACA,UACA,QACA,QACA,SACA,UACA,iBACA,QACA,OACA,SACA,UACA,UACA,aACA,WACA,MACA,eAEA,gBACA,SACA,SACA,YACA,WACA,QACA,WACAvH,QAAQ+G,EAAU6B,oBAEb7B,CACX,KAlfkCL,GAAYC,SAwf1CI,GAAyBZ,GAAwBU,ICxgBfkC,GAAU,SAASC,GAAgB,IAAIhQ,EAAE,CAAE,EAAC,IAAIA,EAAEnO,QAAQA,OAAO,CAAC,MAAMsJ,GAAG6E,EAAEnO,QAAQ,SAASmO,EAAE7E,GAAG,IAAIjB,EAAEiB,EAAE8U,eAAeC,EAAE/U,EAAEmS,eAAetR,EAAEmU,EAAEld,UAAU,OAAO+I,EAAEpF,OAAO,SAASuE,GAAG,OAAO1H,KAAKb,IAAIuI,WAAWA,EAAE1H,KAAKwG,EAAE,EAAE+B,EAAE/J,IAAI,SAASkJ,GAAG,OAAO1H,KAAKb,IAAIuI,GAAGA,EAAE1H,KAAKwG,QAAG,CAAM,EAAE+B,EAAEpJ,IAAI,S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,iBAAiB,uBAAuBxf,MAC5D,EAAGulB,YAAa7Z,MACd,MAAM8jD,EAAgB,uBAAuB3oD,KAAK6E,GAC5C+jD,EAAqB,qBAAqB5oD,KAAK6E,GACrD,OAAQ8jD,GAAiBC,GAAuBD,CAAa,MAW/Dj/B,GAAY5wB,GAAK8b,IAAKtc,GAAM,CAAEsvB,KAAM9uB,GAAK8uB,MAE7C,ICnCA,MACatvB,GAAO,kCAYdQ,GAAOmwB,GAVe,CAC1BjwB,GAAI,CACF4b,IAAK8Z,EAAO,oCAAoC,oBAChD9G,KAAM,0DAERsX,GAAI,CACFtqB,IAAK8Z,EAAO,GAAG,kCACf9G,KAAM,0EAKH,SAAaoN,GAClB,IAAKA,EAAKkH,OAhBK,iBAiBb,OAKF,IAAKhQ,OAAOnE,SAASnlB,KAAKykB,WAAW,QACnC,OAGF,MAAMwhC,EAAmBn7C,OAAOo7C,oBAAoB9zB,GAEjDjsB,QAAOyd,GAAQA,EAAIqI,SAAS,QAAUmG,EAAKxO,IAAiB,WAARA,IAEpDzd,QAAOyd,GACN,IAAIgB,IAAIwN,EAAKxO,GAAM0F,OAAOnE,SAASnlB,MAAMA,KAAKykB,WAAW,aAG7D,GAAIwhC,EAAiBhlD,OAAQ,CAC3B,MAAMoL,EAAO8Z,GAAQ8/B,GAAkBriC,GAAOkI,EAAO,GAAG,IAAIlI,SAC5DkD,GAAY5wB,GAAK8b,IAAKtc,GAAM,CAAEsvB,KAAM9uB,GAAK8uB,KAAO3Y,GACpD,CACA","x_google_ignoreList":[2,3,4,6]} \ No newline at end of file diff --git a/builds/respec-highlight.js b/builds/respec-highlight.js index c9c754cf37..d892cd922d 100644 --- a/builds/respec-highlight.js +++ b/builds/respec-highlight.js @@ -1 +1 @@ -var hljs=function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((t=>{const i=e[t],r=typeof i;"object"!==r&&"function"!==r||Object.isFrozen(i)||n(i)})),e}class t{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}const a=e=>!!e.scope;class o{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!a(e))return;const n=((e,{prefix:n})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const t=e.split(".");return[`${n}${t.shift()}`,...t.map(((e,n)=>`${e}${"_".repeat(n+1)}`))].join(" ")}return`${n}${e}`})(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){a(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const s=(e={})=>{const n={children:[]};return Object.assign(n,e),n};class l{constructor(){this.rootNode=s(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=s({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{l._collapse(e)})))}}class c extends l{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){const t=e.root;n&&(t.scope=`language:${n}`),this.add(t)}toHTML(){return new o(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(e){return e?"string"==typeof e?e:e.source:null}function g(e){return b("(?=",e,")")}function u(e){return b("(?:",e,")*")}function h(e){return b("(?:",e,")?")}function b(...e){return e.map((e=>d(e))).join("")}function f(...e){const n=function(e){const n=e[e.length-1];return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}(e);return"("+(n.capture?"":"?:")+e.map((e=>d(e))).join("|")+")"}function p(e){return new RegExp(e.toString()+"|").exec("").length-1}const m=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function y(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t;let i=d(e),r="";for(;i.length>0;){const e=m.exec(i);if(!e){r+=i;break}r+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+String(Number(e[1])+n):(r+=e[0],"("===e[0]&&t++)}return r})).map((e=>`(${e})`)).join(n)}const E="[a-zA-Z]\\w*",w="[a-zA-Z_]\\w*",k="\\b\\d+(\\.\\d+)?",x="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",_="\\b(0b[01]+)",v={begin:"\\\\[\\s\\S]",relevance:0},N={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[v]},O={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[v]},A=function(e,n,t={}){const i=r({scope:"comment",begin:e,end:n,contains:[]},t);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const a=f("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:b(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},S=A("//","$"),M=A("/\\*","\\*/"),T=A("#","$"),R={scope:"number",begin:k,relevance:0},I={scope:"number",begin:x,relevance:0},C={scope:"number",begin:_,relevance:0},L={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[v,{begin:/\[/,end:/\]/,relevance:0,contains:[v]}]},j={scope:"title",begin:E,relevance:0},B={scope:"title",begin:w,relevance:0},D={begin:"\\.\\s*"+w,relevance:0};var z=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:v,BINARY_NUMBER_MODE:C,BINARY_NUMBER_RE:_,COMMENT:A,C_BLOCK_COMMENT_MODE:M,C_LINE_COMMENT_MODE:S,C_NUMBER_MODE:I,C_NUMBER_RE:x,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:T,IDENT_RE:E,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:D,NUMBER_MODE:R,NUMBER_RE:k,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:O,REGEXP_MODE:L,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=b(n,/.*\b/,e.binary,/\b.*/)),r({scope:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},TITLE_MODE:j,UNDERSCORE_IDENT_RE:w,UNDERSCORE_TITLE_MODE:B});function P(e,n){"."===e.input[e.index-1]&&n.ignoreMatch()}function $(e,n){void 0!==e.className&&(e.scope=e.className,delete e.className)}function U(e,n){n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=P,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function H(e,n){Array.isArray(e.illegal)&&(e.illegal=f(...e.illegal))}function Z(e,n){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function G(e,n){void 0===e.relevance&&(e.relevance=1)}const F=(e,n)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},e);Object.keys(e).forEach((n=>{delete e[n]})),e.keywords=t.keywords,e.begin=b(t.beforeMatch,g(t.begin)),e.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},e.relevance=0,delete t.beforeMatch},W=["of","and","for","in","not","or","if","then","parent","list","value"],K="keyword";function X(e,n,t=K){const i=Object.create(null);return"string"==typeof e?r(t,e.split(" ")):Array.isArray(e)?r(t,e):Object.keys(e).forEach((function(t){Object.assign(i,X(e[t],n,t))})),i;function r(e,t){n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((function(n){const t=n.split("|");i[t[0]]=[e,q(t[0],t[1])]}))}}function q(e,n){return n?Number(n):function(e){return W.includes(e.toLowerCase())}(e)?0:1}const Q={},V=e=>{console.error(e)},J=(e,...n)=>{console.log(`WARN: ${e}`,...n)},Y=(e,n)=>{Q[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),Q[`${e}/${n}`]=!0)},ee=new Error;function ne(e,n,{key:t}){let i=0;const r=e[t],a={},o={};for(let e=1;e<=n.length;e++)o[e+i]=r[e],a[e+i]=!0,i+=p(n[e-1]);e[t]=o,e[t]._emit=a,e[t]._multi=!0}function te(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw V("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ee;if("object"!=typeof e.beginScope||null===e.beginScope)throw V("beginScope must be object"),ee;ne(e,e.begin,{key:"beginScope"}),e.begin=y(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw V("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ee;if("object"!=typeof e.endScope||null===e.endScope)throw V("endScope must be object"),ee;ne(e,e.end,{key:"endScope"}),e.end=y(e.end,{joinWith:""})}}(e)}function ie(e){function n(n,t){return new RegExp(d(n),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=n(y(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),i=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,i)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))),n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)}return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&this.considerAll()),t}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=r(e.classNameAliases||{}),function t(a,o){const s=a;if(a.isCompiled)return s;[$,Z,te,F].forEach((e=>e(a,o))),e.compilerExtensions.forEach((e=>e(a,o))),a.__beforeBegin=null,[U,H,G].forEach((e=>e(a,o))),a.isCompiled=!0;let l=null;return"object"==typeof a.keywords&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),l=a.keywords.$pattern,delete a.keywords.$pattern),l=l||/\w+/,a.keywords&&(a.keywords=X(a.keywords,e.case_insensitive)),s.keywordPatternRe=n(l,!0),o&&(a.begin||(a.begin=/\B|\b/),s.beginRe=n(s.begin),a.end||a.endsWithParent||(a.end=/\B|\b/),a.end&&(s.endRe=n(s.end)),s.terminatorEnd=d(s.end)||"",a.endsWithParent&&o.terminatorEnd&&(s.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(s.illegalRe=n(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(n){return r(e,{variants:null},n)})));if(e.cachedVariants)return e.cachedVariants;if(re(e))return r(e,{starts:e.starts?r(e.starts):null});if(Object.isFrozen(e))return r(e);return e}("self"===e?a:e)}))),a.contains.forEach((function(e){t(e,s)})),a.starts&&t(a.starts,o),s.matcher=function(e){const n=new i;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(s),s}(e)}function re(e){return!!e&&(e.endsWithParent||re(e.starts))}class ae extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const oe=i,se=r,le=Symbol("nomatch"),ce=function(e){const i=Object.create(null),r=Object.create(null),a=[];let o=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",l={disableAutodetect:!0,name:"Plain text",contains:[]};let d={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:c};function p(e){return d.noHighlightRe.test(e)}function m(e,n,t){let i="",r="";"object"==typeof n?(i=e,t=n.ignoreIllegals,r=n.language):(Y("10.7.0","highlight(lang, code, ...args) has been deprecated."),Y("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,i=n),void 0===t&&(t=!0);const a={code:i,language:r};O("before:highlight",a);const o=a.result?a.result:y(a.language,a.code,t);return o.code=a.code,O("after:highlight",o),o}function y(e,n,r,a){const l=Object.create(null);function c(){if(!O.keywords)return void S.addText(M);let e=0;O.keywordPatternRe.lastIndex=0;let n=O.keywordPatternRe.exec(M),t="";for(;n;){t+=M.substring(e,n.index);const r=x.case_insensitive?n[0].toLowerCase():n[0],a=(i=r,O.keywords[i]);if(a){const[e,i]=a;if(S.addText(t),t="",l[r]=(l[r]||0)+1,l[r]<=7&&(T+=i),e.startsWith("_"))t+=n[0];else{const t=x.classNameAliases[e]||e;u(n[0],t)}}else t+=n[0];e=O.keywordPatternRe.lastIndex,n=O.keywordPatternRe.exec(M)}var i;t+=M.substring(e),S.addText(t)}function g(){null!=O.subLanguage?function(){if(""===M)return;let e=null;if("string"==typeof O.subLanguage){if(!i[O.subLanguage])return void S.addText(M);e=y(O.subLanguage,M,!0,A[O.subLanguage]),A[O.subLanguage]=e._top}else e=E(M,O.subLanguage.length?O.subLanguage:null);O.relevance>0&&(T+=e.relevance),S.__addSublanguage(e._emitter,e.language)}():c(),M=""}function u(e,n){""!==e&&(S.startScope(n),S.addText(e),S.endScope())}function h(e,n){let t=1;const i=n.length-1;for(;t<=i;){if(!e._emit[t]){t++;continue}const i=x.classNameAliases[e[t]]||e[t],r=n[t];i?u(r,i):(M=r,c(),M=""),t++}}function b(e,n){return e.scope&&"string"==typeof e.scope&&S.openNode(x.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(u(M,x.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),M=""):e.beginScope._multi&&(h(e.beginScope,n),M="")),O=Object.create(e,{parent:{value:O}}),O}function f(e,n,i){let r=function(e,n){const t=e&&e.exec(n);return t&&0===t.index}(e.endRe,i);if(r){if(e["on:end"]){const i=new t(e);e["on:end"](n,i),i.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return f(e.parent,n,i)}function p(e){return 0===O.matcher.regexIndex?(M+=e[0],1):(C=!0,0)}function m(e){const t=e[0],i=n.substring(e.index),r=f(O,e,i);if(!r)return le;const a=O;O.endScope&&O.endScope._wrap?(g(),u(t,O.endScope._wrap)):O.endScope&&O.endScope._multi?(g(),h(O.endScope,e)):a.skip?M+=t:(a.returnEnd||a.excludeEnd||(M+=t),g(),a.excludeEnd&&(M=t));do{O.scope&&S.closeNode(),O.skip||O.subLanguage||(T+=O.relevance),O=O.parent}while(O!==r.parent);return r.starts&&b(r.starts,e),a.returnEnd?0:t.length}let w={};function k(i,a){const s=a&&a[0];if(M+=i,null==s)return g(),0;if("begin"===w.type&&"end"===a.type&&w.index===a.index&&""===s){if(M+=n.slice(a.index,a.index+1),!o){const n=new Error(`0 width match regex (${e})`);throw n.languageName=e,n.badRule=w.rule,n}return 1}if(w=a,"begin"===a.type)return function(e){const n=e[0],i=e.rule,r=new t(i),a=[i.__beforeBegin,i["on:begin"]];for(const t of a)if(t&&(t(e,r),r.isMatchIgnored))return p(n);return i.skip?M+=n:(i.excludeBegin&&(M+=n),g(),i.returnBegin||i.excludeBegin||(M=n)),b(i,e),i.returnBegin?0:n.length}(a);if("illegal"===a.type&&!r){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(O.scope||"<unnamed>")+'"');throw e.mode=O,e}if("end"===a.type){const e=m(a);if(e!==le)return e}if("illegal"===a.type&&""===s)return 1;if(I>1e5&&I>3*a.index){throw new Error("potential infinite loop, way more iterations than matches")}return M+=s,s.length}const x=_(e);if(!x)throw V(s.replace("{}",e)),new Error('Unknown language: "'+e+'"');const v=ie(x);let N="",O=a||v;const A={},S=new d.__emitter(d);!function(){const e=[];for(let n=O;n!==x;n=n.parent)n.scope&&e.unshift(n.scope);e.forEach((e=>S.openNode(e)))}();let M="",T=0,R=0,I=0,C=!1;try{if(x.__emitTokens)x.__emitTokens(n,S);else{for(O.matcher.considerAll();;){I++,C?C=!1:O.matcher.considerAll(),O.matcher.lastIndex=R;const e=O.matcher.exec(n);if(!e)break;const t=k(n.substring(R,e.index),e);R=e.index+t}k(n.substring(R))}return S.finalize(),N=S.toHTML(),{language:e,value:N,relevance:T,illegal:!1,_emitter:S,_top:O}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:oe(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:R,context:n.slice(R-100,R+100),mode:t.mode,resultSoFar:N},_emitter:S};if(o)return{language:e,value:oe(n),illegal:!1,relevance:0,errorRaised:t,_emitter:S,_top:O};throw t}}function E(e,n){n=n||d.languages||Object.keys(i);const t=function(e){const n={value:oe(e),illegal:!1,relevance:0,_top:l,_emitter:new d.__emitter(d)};return n._emitter.addText(e),n}(e),r=n.filter(_).filter(N).map((n=>y(n,e,!1)));r.unshift(t);const a=r.sort(((e,n)=>{if(e.relevance!==n.relevance)return n.relevance-e.relevance;if(e.language&&n.language){if(_(e.language).supersetOf===n.language)return 1;if(_(n.language).supersetOf===e.language)return-1}return 0})),[o,s]=a,c=o;return c.secondBest=s,c}function w(e){let n=null;const t=function(e){let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=d.languageDetectRe.exec(n);if(t){const n=_(t[1]);return n||(J(s.replace("{}",t[1])),J("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"}return n.split(/\s+/).find((e=>p(e)||_(e)))}(e);if(p(t))return;if(O("before:highlightElement",{el:e,language:t}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(d.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),d.throwUnescapedHTML)){throw new ae("One of your code blocks includes unescaped HTML.",e.innerHTML)}n=e;const i=n.textContent,a=t?m(i,{language:t,ignoreIllegals:!0}):E(i);e.innerHTML=a.value,e.dataset.highlighted="yes",function(e,n,t){const i=n&&r[n]||t;e.classList.add("hljs"),e.classList.add(`language-${i}`)}(e,t,a.language),e.result={language:a.language,re:a.relevance,relevance:a.relevance},a.secondBest&&(e.secondBest={language:a.secondBest.language,relevance:a.secondBest.relevance}),O("after:highlightElement",{el:e,result:a,text:i})}let k=!1;function x(){if("loading"===document.readyState)return void(k=!0);document.querySelectorAll(d.cssSelector).forEach(w)}function _(e){return e=(e||"").toLowerCase(),i[e]||i[r[e]]}function v(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{r[e.toLowerCase()]=n}))}function N(e){const n=_(e);return n&&!n.disableAutodetect}function O(e,n){const t=e;a.forEach((function(e){e[t]&&e[t](n)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){k&&x()}),!1),Object.assign(e,{highlight:m,highlightAuto:E,highlightAll:x,highlightElement:w,highlightBlock:function(e){return Y("10.7.0","highlightBlock will be removed entirely in v12.0"),Y("10.7.0","Please use highlightElement now."),w(e)},configure:function(e){d=se(d,e)},initHighlighting:()=>{x(),Y("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){x(),Y("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,t){let r=null;try{r=t(e)}catch(e){if(V("Language definition for '{}' could not be registered.".replace("{}",n)),!o)throw e;V(e),r=l}r.name||(r.name=n),i[n]=r,r.rawDefinition=t.bind(null,e),r.aliases&&v(r.aliases,{languageName:n})},unregisterLanguage:function(e){delete i[e];for(const n of Object.keys(r))r[n]===e&&delete r[n]},listLanguages:function(){return Object.keys(i)},getLanguage:_,registerAliases:v,autoDetection:N,inherit:se,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{e["before:highlightBlock"](Object.assign({block:n.el},n))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{e["after:highlightBlock"](Object.assign({block:n.el},n))})}(e),a.push(e)},removePlugin:function(e){const n=a.indexOf(e);-1!==n&&a.splice(n,1)}}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString="11.10.0",e.regex={concat:b,lookahead:g,either:f,optional:h,anyNumberOfTimes:u};for(const e in z)"object"==typeof z[e]&&n(z[e]);return Object.assign(e,z),e},de=ce({});de.newInstance=()=>ce({});var ge=de;de.HighlightJS=de,de.default=de;var ue=e(ge);const he=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],be=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),fe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),pe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),me=["accent-color","align-content","align-items","align-self","alignment-baseline","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-end-end-radius","border-end-start-radius","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","cx","cy","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","empty-cells","enable-background","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","flood-color","flood-opacity","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","kerning","justify-content","justify-items","justify-self","left","letter-spacing","lighting-color","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","marker","marker-end","marker-mid","marker-start","mask","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","scale","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","speak","speak-as","src","tab-size","table-layout","text-anchor","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-offset","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","vector-effect","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index"].sort().reverse();const ye="[A-Za-z$_][0-9A-Za-z$_]*",Ee=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],we=["true","false","null","undefined","NaN","Infinity"],ke=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],xe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_e=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ve=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ne=[].concat(_e,ke,xe);return ue.configure({tabReplace:" ",languages:["abnf","css","http","javascript","json","xml"]}),ue.registerLanguage("abnf",(function(e){const n=e.regex,t=e.COMMENT(/;/,/$/);return{name:"Augmented Backus-Naur Form",illegal:/[!@#$^&',?+~`|:]/,keywords:["ALPHA","BIT","CHAR","CR","CRLF","CTL","DIGIT","DQUOTE","HEXDIG","HTAB","LF","LWSP","OCTET","SP","VCHAR","WSP"],contains:[{scope:"operator",match:/=\/?/},{scope:"attribute",match:n.concat(/^[a-zA-Z][a-zA-Z0-9-]*/,/(?=\s*=)/)},t,{scope:"symbol",match:/%b[0-1]+(-[0-1]+|(\.[0-1]+)+)?/},{scope:"symbol",match:/%d[0-9]+(-[0-9]+|(\.[0-9]+)+)?/},{scope:"symbol",match:/%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+)?/},{scope:"symbol",match:/%[si](?=".*")/},e.QUOTE_STRING_MODE,e.NUMBER_MODE]}})),ue.registerLanguage("css",(function(e){const n=e.regex,t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),i=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+fe.join("|")+")"},{begin:":(:)?("+pe.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+me.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...i,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...i,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:be.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...i,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+he.join("|")+")\\b"}]}})),ue.registerLanguage("http",(function(e){const n="HTTP/([32]|1\\.[01])",t={className:"attribute",begin:e.regex.concat("^",/[A-Za-z][A-Za-z0-9-]*/,"(?=\\:\\s)"),starts:{contains:[{className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]}},i=[t,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+n+" \\d{3})",end:/$/,contains:[{className:"meta",begin:n},{className:"number",begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},{begin:"(?=^[A-Z]+ (.*?) "+n+"$)",end:/$/,contains:[{className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:n},{className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},e.inherit(t,{relevance:0})]}})),ue.registerLanguage("javascript",(function(e){const n=e.regex,t=ye,i="<>",r="</>",a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{const t=e[0].length+e.index,i=e.input[t];if("<"===i||","===i)return void n.ignoreMatch();let r;">"===i&&(((e,{after:n})=>{const t="</"+e[0].slice(1);return-1!==e.input.indexOf(t,n)})(e,{after:t})||n.ignoreMatch());const a=e.input.substring(t);((r=a.match(/^\s*=/))||(r=a.match(/^\s+extends\s+/))&&0===r.index)&&n.ignoreMatch()}},o={$pattern:ye,keyword:Ee,literal:we,built_in:Ne,"variable.language":ve},s="[0-9](_?[0-9])*",l=`\\.(${s})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${l})|\\.)?|(${l}))[eE][+-]?(${s})\\b`},{begin:`\\b(${c})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},u={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},f={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,g]},p={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:t+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},m=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,h,b,f,{match:/\$\d+/},d];g.contains=m.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(m)});const y=[].concat(p,g.contains),E=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(y)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:E},k={variants:[{match:[/class/,/\s+/,t,/\s+/,/extends/,/\s+/,n.concat(t,"(",n.concat(/\./,t),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,t],scope:{1:"keyword",3:"title.class"}}]},x={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...ke,...xe]}},_={variants:[{match:[/function/,/\s+/,t,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},v={match:n.concat(/\b/,(N=[..._e,"super","import"].map((e=>`${e}\\s*\\(`)),n.concat("(?!",N.join("|"),")")),t,n.lookahead(/\s*\(/)),className:"title.function",relevance:0};var N;const O={begin:n.concat(/\./,n.lookahead(n.concat(t,/(?![0-9A-Za-z$_(])/))),end:t,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},A={match:[/get|set/,/\s+/,t,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,t,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,h,b,f,p,{match:/\$\d+/},d,x,{className:"attr",begin:t+n.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[p,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i,end:r},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:t,className:"title.function"})]},{match:/\.\.\./,relevance:0},O,{match:"\\$"+t,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},v,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},k,A,{match:/\$[(.]/}]}})),ue.registerLanguage("json",(function(e){const n=["true","false","null"],t={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:n},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,t,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}})),ue.registerLanguage("xml",(function(e){const n=e.regex,t=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},r={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(r,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),s=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[r,s,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[r,a,s,o]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[s]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(/</,n.lookahead(n.concat(t,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:l}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}})),ue}(); +var hljs=function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,t;function i(){if(t)return n;function e(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach((t=>{const i=n[t],r=typeof i;"object"!==r&&"function"!==r||Object.isFrozen(i)||e(i)})),n}t=1;class i{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}const o=e=>!!e.scope;class s{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=r(e)}openNode(e){if(!o(e))return;const n=((e,{prefix:n})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const t=e.split(".");return[`${n}${t.shift()}`,...t.map(((e,n)=>`${e}${"_".repeat(n+1)}`))].join(" ")}return`${n}${e}`})(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){o(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const l=(e={})=>{const n={children:[]};return Object.assign(n,e),n};class c{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=l({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{c._collapse(e)})))}}class d extends c{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){const t=e.root;n&&(t.scope=`language:${n}`),this.add(t)}toHTML(){return new s(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(e){return e?"string"==typeof e?e:e.source:null}function u(e){return f("(?=",e,")")}function h(e){return f("(?:",e,")*")}function b(e){return f("(?:",e,")?")}function f(...e){return e.map((e=>g(e))).join("")}function p(...e){const n=function(e){const n=e[e.length-1];return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}(e);return"("+(n.capture?"":"?:")+e.map((e=>g(e))).join("|")+")"}function m(e){return new RegExp(e.toString()+"|").exec("").length-1}const y=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function E(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t;let i=g(e),r="";for(;i.length>0;){const e=y.exec(i);if(!e){r+=i;break}r+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+String(Number(e[1])+n):(r+=e[0],"("===e[0]&&t++)}return r})).map((e=>`(${e})`)).join(n)}const w="[a-zA-Z]\\w*",k="[a-zA-Z_]\\w*",x="\\b\\d+(\\.\\d+)?",_="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",v="\\b(0b[01]+)",N={begin:"\\\\[\\s\\S]",relevance:0},O={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[N]},A={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[N]},S=function(e,n,t={}){const i=a({scope:"comment",begin:e,end:n,contains:[]},t);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=p("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:f(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},M=S("//","$"),T=S("/\\*","\\*/"),R=S("#","$"),I={scope:"number",begin:x,relevance:0},C={scope:"number",begin:_,relevance:0},L={scope:"number",begin:v,relevance:0},j={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[N,{begin:/\[/,end:/\]/,relevance:0,contains:[N]}]},B={scope:"title",begin:w,relevance:0},D={scope:"title",begin:k,relevance:0},z={begin:"\\.\\s*"+k,relevance:0};var P=Object.freeze({__proto__:null,APOS_STRING_MODE:O,BACKSLASH_ESCAPE:N,BINARY_NUMBER_MODE:L,BINARY_NUMBER_RE:v,COMMENT:S,C_BLOCK_COMMENT_MODE:T,C_LINE_COMMENT_MODE:M,C_NUMBER_MODE:C,C_NUMBER_RE:_,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:R,IDENT_RE:w,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:z,NUMBER_MODE:I,NUMBER_RE:x,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:A,REGEXP_MODE:j,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=f(n,/.*\b/,e.binary,/\b.*/)),a({scope:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},TITLE_MODE:B,UNDERSCORE_IDENT_RE:k,UNDERSCORE_TITLE_MODE:D});function $(e,n){"."===e.input[e.index-1]&&n.ignoreMatch()}function U(e,n){void 0!==e.className&&(e.scope=e.className,delete e.className)}function H(e,n){n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=$,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function Z(e,n){Array.isArray(e.illegal)&&(e.illegal=p(...e.illegal))}function G(e,n){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function F(e,n){void 0===e.relevance&&(e.relevance=1)}const W=(e,n)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},e);Object.keys(e).forEach((n=>{delete e[n]})),e.keywords=t.keywords,e.begin=f(t.beforeMatch,u(t.begin)),e.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},e.relevance=0,delete t.beforeMatch},K=["of","and","for","in","not","or","if","then","parent","list","value"],X="keyword";function q(e,n,t=X){const i=Object.create(null);return"string"==typeof e?r(t,e.split(" ")):Array.isArray(e)?r(t,e):Object.keys(e).forEach((function(t){Object.assign(i,q(e[t],n,t))})),i;function r(e,t){n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((function(n){const t=n.split("|");i[t[0]]=[e,Q(t[0],t[1])]}))}}function Q(e,n){return n?Number(n):function(e){return K.includes(e.toLowerCase())}(e)?0:1}const V={},J=e=>{console.error(e)},Y=(e,...n)=>{console.log(`WARN: ${e}`,...n)},ee=(e,n)=>{V[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),V[`${e}/${n}`]=!0)},ne=new Error;function te(e,n,{key:t}){let i=0;const r=e[t],a={},o={};for(let e=1;e<=n.length;e++)o[e+i]=r[e],a[e+i]=!0,i+=m(n[e-1]);e[t]=o,e[t]._emit=a,e[t]._multi=!0}function ie(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw J("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ne;if("object"!=typeof e.beginScope||null===e.beginScope)throw J("beginScope must be object"),ne;te(e,e.begin,{key:"beginScope"}),e.begin=E(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw J("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ne;if("object"!=typeof e.endScope||null===e.endScope)throw J("endScope must be object"),ne;te(e,e.end,{key:"endScope"}),e.end=E(e.end,{joinWith:""})}}(e)}function re(e){function n(n,t){return new RegExp(g(n),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=m(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=n(E(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),i=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,i)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))),n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)}return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&this.considerAll()),t}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),function t(r,o){const s=r;if(r.isCompiled)return s;[U,G,ie,W].forEach((e=>e(r,o))),e.compilerExtensions.forEach((e=>e(r,o))),r.__beforeBegin=null,[H,Z,F].forEach((e=>e(r,o))),r.isCompiled=!0;let l=null;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords),l=r.keywords.$pattern,delete r.keywords.$pattern),l=l||/\w+/,r.keywords&&(r.keywords=q(r.keywords,e.case_insensitive)),s.keywordPatternRe=n(l,!0),o&&(r.begin||(r.begin=/\B|\b/),s.beginRe=n(s.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(s.endRe=n(s.end)),s.terminatorEnd=g(s.end)||"",r.endsWithParent&&o.terminatorEnd&&(s.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)),r.illegal&&(s.illegalRe=n(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(n){return a(e,{variants:null},n)})));if(e.cachedVariants)return e.cachedVariants;if(ae(e))return a(e,{starts:e.starts?a(e.starts):null});if(Object.isFrozen(e))return a(e);return e}("self"===e?r:e)}))),r.contains.forEach((function(e){t(e,s)})),r.starts&&t(r.starts,o),s.matcher=function(e){const n=new i;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(s),s}(e)}function ae(e){return!!e&&(e.endsWithParent||ae(e.starts))}class oe extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const se=r,le=a,ce=Symbol("nomatch"),de=function(n){const t=Object.create(null),r=Object.create(null),a=[];let o=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",l={disableAutodetect:!0,name:"Plain text",contains:[]};let c={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:d};function g(e){return c.noHighlightRe.test(e)}function m(e,n,t){let i="",r="";"object"==typeof n?(i=e,t=n.ignoreIllegals,r=n.language):(ee("10.7.0","highlight(lang, code, ...args) has been deprecated."),ee("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,i=n),void 0===t&&(t=!0);const a={code:i,language:r};O("before:highlight",a);const o=a.result?a.result:y(a.language,a.code,t);return o.code=a.code,O("after:highlight",o),o}function y(e,n,r,a){const l=Object.create(null);function d(){if(!O.keywords)return void S.addText(M);let e=0;O.keywordPatternRe.lastIndex=0;let n=O.keywordPatternRe.exec(M),t="";for(;n;){t+=M.substring(e,n.index);const r=x.case_insensitive?n[0].toLowerCase():n[0],a=(i=r,O.keywords[i]);if(a){const[e,i]=a;if(S.addText(t),t="",l[r]=(l[r]||0)+1,l[r]<=7&&(T+=i),e.startsWith("_"))t+=n[0];else{const t=x.classNameAliases[e]||e;u(n[0],t)}}else t+=n[0];e=O.keywordPatternRe.lastIndex,n=O.keywordPatternRe.exec(M)}var i;t+=M.substring(e),S.addText(t)}function g(){null!=O.subLanguage?function(){if(""===M)return;let e=null;if("string"==typeof O.subLanguage){if(!t[O.subLanguage])return void S.addText(M);e=y(O.subLanguage,M,!0,A[O.subLanguage]),A[O.subLanguage]=e._top}else e=E(M,O.subLanguage.length?O.subLanguage:null);O.relevance>0&&(T+=e.relevance),S.__addSublanguage(e._emitter,e.language)}():d(),M=""}function u(e,n){""!==e&&(S.startScope(n),S.addText(e),S.endScope())}function h(e,n){let t=1;const i=n.length-1;for(;t<=i;){if(!e._emit[t]){t++;continue}const i=x.classNameAliases[e[t]]||e[t],r=n[t];i?u(r,i):(M=r,d(),M=""),t++}}function b(e,n){return e.scope&&"string"==typeof e.scope&&S.openNode(x.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(u(M,x.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),M=""):e.beginScope._multi&&(h(e.beginScope,n),M="")),O=Object.create(e,{parent:{value:O}}),O}function f(e,n,t){let r=function(e,n){const t=e&&e.exec(n);return t&&0===t.index}(e.endRe,t);if(r){if(e["on:end"]){const t=new i(e);e["on:end"](n,t),t.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return f(e.parent,n,t)}function p(e){return 0===O.matcher.regexIndex?(M+=e[0],1):(C=!0,0)}function m(e){const t=e[0],i=n.substring(e.index),r=f(O,e,i);if(!r)return ce;const a=O;O.endScope&&O.endScope._wrap?(g(),u(t,O.endScope._wrap)):O.endScope&&O.endScope._multi?(g(),h(O.endScope,e)):a.skip?M+=t:(a.returnEnd||a.excludeEnd||(M+=t),g(),a.excludeEnd&&(M=t));do{O.scope&&S.closeNode(),O.skip||O.subLanguage||(T+=O.relevance),O=O.parent}while(O!==r.parent);return r.starts&&b(r.starts,e),a.returnEnd?0:t.length}let w={};function k(t,a){const s=a&&a[0];if(M+=t,null==s)return g(),0;if("begin"===w.type&&"end"===a.type&&w.index===a.index&&""===s){if(M+=n.slice(a.index,a.index+1),!o){const n=new Error(`0 width match regex (${e})`);throw n.languageName=e,n.badRule=w.rule,n}return 1}if(w=a,"begin"===a.type)return function(e){const n=e[0],t=e.rule,r=new i(t),a=[t.__beforeBegin,t["on:begin"]];for(const t of a)if(t&&(t(e,r),r.isMatchIgnored))return p(n);return t.skip?M+=n:(t.excludeBegin&&(M+=n),g(),t.returnBegin||t.excludeBegin||(M=n)),b(t,e),t.returnBegin?0:n.length}(a);if("illegal"===a.type&&!r){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(O.scope||"<unnamed>")+'"');throw e.mode=O,e}if("end"===a.type){const e=m(a);if(e!==ce)return e}if("illegal"===a.type&&""===s)return 1;if(I>1e5&&I>3*a.index){throw new Error("potential infinite loop, way more iterations than matches")}return M+=s,s.length}const x=_(e);if(!x)throw J(s.replace("{}",e)),new Error('Unknown language: "'+e+'"');const v=re(x);let N="",O=a||v;const A={},S=new c.__emitter(c);!function(){const e=[];for(let n=O;n!==x;n=n.parent)n.scope&&e.unshift(n.scope);e.forEach((e=>S.openNode(e)))}();let M="",T=0,R=0,I=0,C=!1;try{if(x.__emitTokens)x.__emitTokens(n,S);else{for(O.matcher.considerAll();;){I++,C?C=!1:O.matcher.considerAll(),O.matcher.lastIndex=R;const e=O.matcher.exec(n);if(!e)break;const t=k(n.substring(R,e.index),e);R=e.index+t}k(n.substring(R))}return S.finalize(),N=S.toHTML(),{language:e,value:N,relevance:T,illegal:!1,_emitter:S,_top:O}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:se(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:R,context:n.slice(R-100,R+100),mode:t.mode,resultSoFar:N},_emitter:S};if(o)return{language:e,value:se(n),illegal:!1,relevance:0,errorRaised:t,_emitter:S,_top:O};throw t}}function E(e,n){n=n||c.languages||Object.keys(t);const i=function(e){const n={value:se(e),illegal:!1,relevance:0,_top:l,_emitter:new c.__emitter(c)};return n._emitter.addText(e),n}(e),r=n.filter(_).filter(N).map((n=>y(n,e,!1)));r.unshift(i);const a=r.sort(((e,n)=>{if(e.relevance!==n.relevance)return n.relevance-e.relevance;if(e.language&&n.language){if(_(e.language).supersetOf===n.language)return 1;if(_(n.language).supersetOf===e.language)return-1}return 0})),[o,s]=a,d=o;return d.secondBest=s,d}function w(e){let n=null;const t=function(e){let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=c.languageDetectRe.exec(n);if(t){const n=_(t[1]);return n||(Y(s.replace("{}",t[1])),Y("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"}return n.split(/\s+/).find((e=>g(e)||_(e)))}(e);if(g(t))return;if(O("before:highlightElement",{el:e,language:t}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(c.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),c.throwUnescapedHTML)){throw new oe("One of your code blocks includes unescaped HTML.",e.innerHTML)}n=e;const i=n.textContent,a=t?m(i,{language:t,ignoreIllegals:!0}):E(i);e.innerHTML=a.value,e.dataset.highlighted="yes",function(e,n,t){const i=n&&r[n]||t;e.classList.add("hljs"),e.classList.add(`language-${i}`)}(e,t,a.language),e.result={language:a.language,re:a.relevance,relevance:a.relevance},a.secondBest&&(e.secondBest={language:a.secondBest.language,relevance:a.secondBest.relevance}),O("after:highlightElement",{el:e,result:a,text:i})}let k=!1;function x(){if("loading"===document.readyState)return void(k=!0);document.querySelectorAll(c.cssSelector).forEach(w)}function _(e){return e=(e||"").toLowerCase(),t[e]||t[r[e]]}function v(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{r[e.toLowerCase()]=n}))}function N(e){const n=_(e);return n&&!n.disableAutodetect}function O(e,n){const t=e;a.forEach((function(e){e[t]&&e[t](n)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){k&&x()}),!1),Object.assign(n,{highlight:m,highlightAuto:E,highlightAll:x,highlightElement:w,highlightBlock:function(e){return ee("10.7.0","highlightBlock will be removed entirely in v12.0"),ee("10.7.0","Please use highlightElement now."),w(e)},configure:function(e){c=le(c,e)},initHighlighting:()=>{x(),ee("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){x(),ee("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(e,i){let r=null;try{r=i(n)}catch(n){if(J("Language definition for '{}' could not be registered.".replace("{}",e)),!o)throw n;J(n),r=l}r.name||(r.name=e),t[e]=r,r.rawDefinition=i.bind(null,n),r.aliases&&v(r.aliases,{languageName:e})},unregisterLanguage:function(e){delete t[e];for(const n of Object.keys(r))r[n]===e&&delete r[n]},listLanguages:function(){return Object.keys(t)},getLanguage:_,registerAliases:v,autoDetection:N,inherit:le,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{e["before:highlightBlock"](Object.assign({block:n.el},n))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{e["after:highlightBlock"](Object.assign({block:n.el},n))})}(e),a.push(e)},removePlugin:function(e){const n=a.indexOf(e);-1!==n&&a.splice(n,1)}}),n.debugMode=function(){o=!1},n.safeMode=function(){o=!0},n.versionString="11.10.0",n.regex={concat:f,lookahead:u,either:p,optional:b,anyNumberOfTimes:h};for(const n in P)"object"==typeof P[n]&&e(P[n]);return Object.assign(n,P),n},ge=de({});return ge.newInstance=()=>de({}),n=ge,ge.HighlightJS=ge,ge.default=ge,n}var r=e(i());const a=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],o=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),s=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),l=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),c=["accent-color","align-content","align-items","align-self","alignment-baseline","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-end-end-radius","border-end-start-radius","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","cx","cy","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","empty-cells","enable-background","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","flood-color","flood-opacity","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","kerning","justify-content","justify-items","justify-self","left","letter-spacing","lighting-color","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","marker","marker-end","marker-mid","marker-start","mask","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","scale","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","speak","speak-as","src","tab-size","table-layout","text-anchor","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-offset","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","vector-effect","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index"].sort().reverse();const d="[A-Za-z$_][0-9A-Za-z$_]*",g=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],u=["true","false","null","undefined","NaN","Infinity"],h=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],b=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],f=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],p=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],m=[].concat(f,h,b);return r.configure({tabReplace:" ",languages:["abnf","css","http","javascript","json","xml"]}),r.registerLanguage("abnf",(function(e){const n=e.regex,t=e.COMMENT(/;/,/$/);return{name:"Augmented Backus-Naur Form",illegal:/[!@#$^&',?+~`|:]/,keywords:["ALPHA","BIT","CHAR","CR","CRLF","CTL","DIGIT","DQUOTE","HEXDIG","HTAB","LF","LWSP","OCTET","SP","VCHAR","WSP"],contains:[{scope:"operator",match:/=\/?/},{scope:"attribute",match:n.concat(/^[a-zA-Z][a-zA-Z0-9-]*/,/(?=\s*=)/)},t,{scope:"symbol",match:/%b[0-1]+(-[0-1]+|(\.[0-1]+)+)?/},{scope:"symbol",match:/%d[0-9]+(-[0-9]+|(\.[0-9]+)+)?/},{scope:"symbol",match:/%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+)?/},{scope:"symbol",match:/%[si](?=".*")/},e.QUOTE_STRING_MODE,e.NUMBER_MODE]}})),r.registerLanguage("css",(function(e){const n=e.regex,t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),i=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+s.join("|")+")"},{begin:":(:)?("+l.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+c.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...i,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...i,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:o.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...i,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+a.join("|")+")\\b"}]}})),r.registerLanguage("http",(function(e){const n="HTTP/([32]|1\\.[01])",t={className:"attribute",begin:e.regex.concat("^",/[A-Za-z][A-Za-z0-9-]*/,"(?=\\:\\s)"),starts:{contains:[{className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]}},i=[t,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+n+" \\d{3})",end:/$/,contains:[{className:"meta",begin:n},{className:"number",begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},{begin:"(?=^[A-Z]+ (.*?) "+n+"$)",end:/$/,contains:[{className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:n},{className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},e.inherit(t,{relevance:0})]}})),r.registerLanguage("javascript",(function(e){const n=e.regex,t=d,i="<>",r="</>",a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{const t=e[0].length+e.index,i=e.input[t];if("<"===i||","===i)return void n.ignoreMatch();let r;">"===i&&(((e,{after:n})=>{const t="</"+e[0].slice(1);return-1!==e.input.indexOf(t,n)})(e,{after:t})||n.ignoreMatch());const a=e.input.substring(t);((r=a.match(/^\s*=/))||(r=a.match(/^\s+extends\s+/))&&0===r.index)&&n.ignoreMatch()}},o={$pattern:d,keyword:g,literal:u,built_in:m,"variable.language":p},s="[0-9](_?[0-9])*",l=`\\.(${s})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${c})((${l})|\\.)?|(${l}))[eE][+-]?(${s})\\b`},{begin:`\\b(${c})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},E={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,E],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,E],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,E],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,E]},v={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:t+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},N=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,w,k,x,_,{match:/\$\d+/},y];E.contains=N.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(N)});const O=[].concat(v,E.contains),A=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(O)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:A},M={variants:[{match:[/class/,/\s+/,t,/\s+/,/extends/,/\s+/,n.concat(t,"(",n.concat(/\./,t),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,t],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...h,...b]}},R={variants:[{match:[/function/,/\s+/,t,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},I={match:n.concat(/\b/,(C=[...f,"super","import"].map((e=>`${e}\\s*\\(`)),n.concat("(?!",C.join("|"),")")),t,n.lookahead(/\s*\(/)),className:"title.function",relevance:0};var C;const L={begin:n.concat(/\./,n.lookahead(n.concat(t,/(?![0-9A-Za-z$_(])/))),end:t,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},j={match:[/get|set/,/\s+/,t,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},B="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",D={match:[/const|var|let/,/\s+/,t,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(B)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,w,k,x,_,v,{match:/\$\d+/},y,T,{className:"attr",begin:t+n.lookahead(":"),relevance:0},D,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[v,e.REGEXP_MODE,{className:"function",begin:B,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i,end:r},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},R,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:t,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+t,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},I,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},M,j,{match:/\$[(.]/}]}})),r.registerLanguage("json",(function(e){const n=["true","false","null"],t={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:n},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,t,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}})),r.registerLanguage("xml",(function(e){const n=e.regex,t=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},r={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(r,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),s=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[r,s,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[r,a,s,o]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[s]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(/</,n.lookahead(n.concat(t,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:l}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}})),r}(); diff --git a/builds/respec-w3c.js b/builds/respec-w3c.js index 2ee853c5ed..d3ce6f3fa0 100644 --- a/builds/respec-w3c.js +++ b/builds/respec-w3c.js @@ -1,6 +1,6 @@ -window.respecVersion="35.1.2",function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=!!window.require;if(!t){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function n(e,n){t||(window.require.modules[e]=n)}const r=new EventTarget;function s(e,t){if(r.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const n=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function o(e,t,n={once:!1}){r.addEventListener(e,(e=>t(e.detail)),n)}n("core/pubsubhub",{sub:o});const i=["githubToken","githubUser"];const a=document.documentElement;a?.hasAttribute("lang")||(a.lang="en",a.hasAttribute("dir")||(a.dir="ltr"));const c={},l=a?.lang??"en";var u=Object.freeze({__proto__:null,l10n:c,lang:l,name:"core/l10n",run:function(e){e.l10n=c[l]||c.en}});const d=(e,t)=>t.some((t=>e instanceof t));let p,f;const h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return $(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function y(e){b=e(b)}function w(e){return(f||(f=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(k(this),t),$(this.request)}:function(...t){return $(e.apply(k(this),t))}}function v(e){return"function"==typeof e?w(e):(e instanceof IDBTransaction&&function(e){if(h.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",o),e.removeEventListener("abort",o)},s=()=>{t(),r()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",s),e.addEventListener("error",o),e.addEventListener("abort",o)}));h.set(e,t)}(e),d(e,p||(p=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,b):e)}function $(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",s),e.removeEventListener("error",o)},s=()=>{t($(e.result)),r()},o=()=>{n(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",o)}));return g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=v(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const k=e=>g.get(e);const x=["get","getKey","getAll","getAllKeys","count"],_=["put","add","delete","clear"],S=new Map;function C(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(S.get(t))return S.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=_.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!s&&!x.includes(n))return;const o=async function(e,...t){const o=this.transaction(e,s?"readwrite":"readonly");let i=o.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),s&&o.done]))[0]};return S.set(t,o),o}y((e=>({...e,get:(t,n,r)=>C(t,n)||e.get(t,n,r),has:(t,n)=>!!C(t,n)||e.has(t,n)})));const R=["continue","continuePrimaryKey","advance"],E={},A=new WeakMap,T=new WeakMap,L={get(e,t){if(!R.includes(t))return e[t];let n=E[t];return n||(n=E[t]=function(...e){A.set(this,T.get(this)[t](...e))}),n}};async function*P(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,L);for(T.set(n,t),g.set(n,k(t));t;)yield n,t=await(A.get(n)||t.continue()),A.delete(n)}function I(e,t){return t===Symbol.asyncIterator&&d(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&d(e,[IDBIndex,IDBObjectStore])}y((e=>({...e,get:(t,n,r)=>I(t,n)?P:e.get(t,n,r),has:(t,n)=>I(t,n)||e.has(t,n)})));var D=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),$(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=$(i);return r&&i.addEventListener("upgradeneeded",(e=>{r($(i.result),e.oldVersion,e.newVersion,$(i.transaction),e)})),n&&i.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{o&&e.addEventListener("close",(()=>o())),s&&e.addEventListener("versionchange",(e=>s(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:k,wrap:$});function N(e,t,n,r,s,{level:o="error",autofix:i,ruleName:a}={}){function c(n){return n>0?e.slice(t,t+n):e.slice(Math.max(t+n,0),t)}function l(n,{precedes:r}={}){const s=n.map((e=>e.trivia+e.value)).join(""),o=e[t];return"eof"===o.type?s:r?s+o.trivia:s.slice(o.trivia.length)}const u="eof"!==e[t].type?e[t].line:e.length>1?e[t-1].line:1,d=function(e){const t=e.split("\n");return t[t.length-1]}(l(c(-5),{precedes:!0})),p=c(5),f=l(p),h=d+f.split("\n")[0]+"\n"+(" ".repeat(d.length)+"^"),m="Syntax"===s?"since":"inside",g=`${s} error at line ${u}${e.name?` in ${e.name}`:""}${n&&n.name?`, ${m} \`${n.partial?"partial ":""}${function(e){const t=[e];for(;e&&e.parent;){const{parent:n}=e;t.unshift(n),e=n}return t.map((e=>function(e,t){let n=e;return t&&(n+=` ${t}`),n}(e.type,e.name))).join(" -> ")}(n)}\``:""}:\n${h}`;return{message:`${g} ${r}`,bareMessage:r,context:g,line:u,sourceName:e.name,level:o,ruleName:a,autofix:i,input:f,tokens:p}}function j(e,t,n,r){return N(e,t,n,r,"Syntax")}function O(e,t,n,r,s={}){return s.ruleName=n,N(t.source,e.index,t,r,"Validation",s)}class M{constructor({source:e,tokens:t}){Object.defineProperties(this,{source:{value:e},tokens:{value:t,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){const e={type:void 0,name:void 0,inheritance:void 0};let t=this;for(;t!==Object.prototype;){const n=Object.getOwnPropertyDescriptors(t);for(const[t,r]of Object.entries(n))(r.enumerable||r.get)&&(e[t]=this[t]);t=Object.getPrototypeOf(t)}return e}}function q(e,t,{useNullableInner:n}={}){if(!e.union){const r=t.unique.get(e.idlType);if(!r)return;if("typedef"===r.type){const{typedefIncludesDictionary:n}=t.cache;if(n.has(r))return n.get(r);t.cache.typedefIncludesDictionary.set(r,void 0);const s=q(r.idlType,t);if(t.cache.typedefIncludesDictionary.set(r,s),s)return{reference:e,dictionary:s.dictionary}}if("dictionary"===r.type&&(n||!e.nullable))return{reference:e,dictionary:r}}for(const n of e.subtype){const e=q(n,t);if(e)return n.union?e:{reference:n,dictionary:e.dictionary}}}function z(e,t){if(t.cache.dictionaryIncludesRequiredField.has(e))return t.cache.dictionaryIncludesRequiredField.get(e);t.cache.dictionaryIncludesRequiredField.set(e,void 0);let n=e.members.some((e=>e.required));if(!n&&e.inheritance){const r=t.unique.get(e.inheritance);r?z(r,t)&&(n=!0):n=!0}return t.cache.dictionaryIncludesRequiredField.set(e,n),n}class U extends Array{constructor({source:e,tokens:t}){super(),Object.defineProperties(this,{source:{value:e},tokens:{value:t},parent:{value:null,writable:!0}})}}class W extends M{static parser(e,t){return()=>{const n=e.consumeKind(t);if(n)return new W({source:e.source,tokens:{value:n}})}}get value(){return ie(this.tokens.value.value)}write(e){return e.ts.wrap([e.token(this.tokens.value),e.token(this.tokens.separator)])}}class F extends W{static parse(e){const t=e.consumeKind("eof");if(t)return new F({source:e.source,tokens:{value:t}})}get type(){return"eof"}}function B(e,t){return ae(e,{parser:W.parser(e,t),listName:t+" list"})}const H=["identifier","decimal","integer","string"],G=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((e=>[e,`Legacy${e}`])),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function V(e){for(const t of H){const n=B(e,t);if(n.length)return n}e.error("Expected identifiers, strings, decimals, or integers but none found")}class Y extends M{static parse(e){const t={assign:e.consume("=")},n=ye(new Y({source:e.source,tokens:t}));if(n.list=[],t.assign){if(t.asterisk=e.consume("*"),t.asterisk)return n.this;t.secondaryName=e.consumeKind(...H)}return t.open=e.consume("("),t.open?(n.list=n.rhsIsList?V(e):de(e),t.close=e.consume(")")||e.error("Unexpected token in extended attribute argument list")):t.assign&&!t.secondaryName&&e.error("No right hand side to extended attribute assignment"),n.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(e){const{rhsType:t}=this;return e.ts.wrap([e.token(this.tokens.assign),e.token(this.tokens.asterisk),e.reference_token(this.tokens.secondaryName,this.parent),e.token(this.tokens.open),...this.list.map((n=>"identifier-list"===t?e.identifier(n,this.parent):n.write(e))),e.token(this.tokens.close)])}}class K extends M{static parse(e){const t=e.consumeKind("identifier");if(t)return new K({source:e.source,tokens:{name:t},params:Y.parse(e)})}constructor({source:e,tokens:t,params:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"params",{value:n})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){const{rhsType:e,tokens:t,list:n}=this.params;if(!e)return null;return{type:e,value:this.params.rhsIsList?n:this.params.tokens.secondaryName?ie(t.secondaryName.value):null}}get arguments(){const{rhsIsList:e,list:t}=this.params;return!t||e?[]:t}*validate(e){const{name:t}=this;if("LegacyNoInterfaceObject"===t){const e="`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.";yield O(this.tokens.name,this,"no-nointerfaceobject",e,{level:"warning"})}else if(G.has(t)){const e=`\`[${t}]\` extended attribute is a legacy feature that is now renamed to \`[${G.get(t)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield O(this.tokens.name,this,"renamed-legacy",e,{level:"warning",autofix:(n=this,()=>{const{name:e}=n;n.tokens.name.value=G.get(e),"TreatNullAs"===e&&(n.params.tokens={})})})}var n;for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.wrap([e.ts.trivia(this.tokens.name.trivia),e.ts.extendedAttribute(e.ts.wrap([e.ts.extendedAttributeReference(this.name),this.params.write(e)])),e.token(this.tokens.separator)])}}class Z extends U{static parse(e){const t={};t.open=e.consume("[");const n=new Z({source:e.source,tokens:t});return t.open?(n.push(...ae(e,{parser:K.parse,listName:"extended attribute"})),t.close=e.consume("]")||e.error("Expected a closing token for the extended attribute list"),n.length||(e.unconsume(t.close.index),e.error("An extended attribute list must not be empty")),e.probe("[")&&e.error("Illegal double extended attribute lists, consider merging them"),n):n}*validate(e){for(const t of this)yield*t.validate(e)}write(e){return this.length?e.ts.wrap([e.token(this.tokens.open),...this.map((t=>t.write(e))),e.token(this.tokens.close)]):""}}function J(e,t){const n=e.consume("?");n&&(t.tokens.nullable=n),e.probe("?")&&e.error("Can't nullable more than once")}function Q(e,t){let n=function(e,t){const n=e.consume("FrozenArray","ObservableArray","Promise","sequence","record");if(!n)return;const r=ye(new X({source:e.source,tokens:{base:n}}));switch(r.tokens.open=e.consume("<")||e.error(`No opening bracket after ${n.value}`),n.value){case"Promise":{e.probe("[")&&e.error("Promise type cannot have extended attribute");const n=fe(e,t)||e.error("Missing Promise subtype");r.subtype.push(n);break}case"sequence":case"FrozenArray":case"ObservableArray":{const s=pe(e,t)||e.error(`Missing ${n.value} subtype`);r.subtype.push(s);break}case"record":{e.probe("[")&&e.error("Record key cannot have extended attribute");const n=e.consume(...$e)||e.error(`Record key must be one of: ${$e.join(", ")}`),s=new X({source:e.source,tokens:{base:n}});s.tokens.separator=e.consume(",")||e.error("Missing comma after record key type"),s.type=t;const o=pe(e,t)||e.error("Error parsing generic type record");r.subtype.push(s,o);break}}return r.idlType||e.error(`Error parsing generic type ${n.value}`),r.tokens.close=e.consume(">")||e.error(`Missing closing bracket after ${n.value}`),r.this}(e,t)||ue(e);if(!n){const t=e.consumeKind("identifier")||e.consume(...$e,...ve);if(!t)return;n=new X({source:e.source,tokens:{base:t}}),e.probe("<")&&e.error(`Unsupported generic type ${t.value}`)}return"Promise"===n.generic&&e.probe("?")&&e.error("Promise type cannot be nullable"),n.type=t||null,J(e,n),n.nullable&&"any"===n.idlType&&e.error("Type `any` cannot be made nullable"),n}class X extends M{static parse(e,t){return Q(e,t)||function(e,t){const n={};if(n.open=e.consume("("),!n.open)return;const r=ye(new X({source:e.source,tokens:n}));for(r.type=t||null;;){const n=pe(e,t)||e.error("No type after open parenthesis or 'or' in union type");"any"===n.idlType&&e.error("Type `any` cannot be included in a union type"),"Promise"===n.generic&&e.error("Type `Promise` cannot be included in a union type"),r.subtype.push(n);const s=e.consume("or");if(!s)break;n.tokens.separator=s}return r.idlType.length<2&&e.error("At least two types are expected in a union type but found less"),n.close=e.consume(")")||e.error("Unterminated union type"),J(e,r),r.this}(e,t)}constructor({source:e,tokens:t}){super({source:e,tokens:t}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new Z({source:e,tokens:{}})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return ie([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter((e=>e)).map((e=>e.value)).join(" "))}*validate(e){if(yield*this.extAttrs.validate(e),"BufferSource"===this.idlType)for(const e of[this.extAttrs,this.parent?.extAttrs])for(const t of e){if("AllowShared"!==t.name)continue;const n="`[AllowShared] BufferSource` is now replaced with AllowSharedBufferSource.";yield O(this.tokens.base,this,"migrate-allowshared",n,{autofix:ee(this,t,e)})}if("void"===this.idlType){const e="`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.";yield O(this.tokens.base,this,"replace-void",e,{autofix:(t=this,()=>{t.tokens.base.value="undefined"})})}var t;const n=!this.union&&e.unique.get(this.idlType),r=this.union?this:n&&"typedef"===n.type?n.idlType:void 0;if(r&&this.nullable){const{reference:t}=q(r,e)||{};if(t){const e=(this.union?t:this).tokens.base,n="Nullable union cannot include a dictionary type.";yield O(e,this,"no-nullable-union-dict",n)}}else for(const t of this.subtype)yield*t.validate(e)}write(e){return e.ts.wrap([this.extAttrs.write(e),(()=>{if(this.union||this.generic)return e.ts.wrap([e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),...this.subtype.map((t=>t.write(e))),e.token(this.tokens.close)]);const t=this.tokens.prefix||this.tokens.base,n=this.tokens.prefix?[this.tokens.prefix.value,e.ts.trivia(this.tokens.base.trivia)]:[],r=e.reference(e.ts.wrap([...n,this.tokens.base.value,e.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return e.ts.wrap([e.ts.trivia(t.trivia),r])})(),e.token(this.tokens.nullable),e.token(this.tokens.separator)])}}function ee(e,t,n){return()=>{const r=n.indexOf(t);n.splice(r,1),!n.length&&e.tokens.base.trivia.match(/^\s$/)&&(e.tokens.base.trivia=""),e.tokens.base.value="AllowSharedBufferSource"}}class te extends M{static parse(e){const t=e.consume("=");if(!t)return null;const n=ce(e)||e.consumeKind("string")||e.consume("null","[","{")||e.error("No value for default"),r=[n];if("["===n.value){const t=e.consume("]")||e.error("Default sequence value must be empty");r.push(t)}else if("{"===n.value){const t=e.consume("}")||e.error("Default dictionary value must be empty");r.push(t)}return new te({source:e.source,tokens:{assign:t},expression:r})}constructor({source:e,tokens:t,expression:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"expression",{value:n})}get type(){return le(this.expression[0]).type}get value(){return le(this.expression[0]).value}get negative(){return le(this.expression[0]).negative}write(e){return e.ts.wrap([e.token(this.tokens.assign),...this.expression.map((t=>e.token(t)))])}}class ne extends M{static parse(e){const t=e.position,n={},r=ye(new ne({source:e.source,tokens:n}));return r.extAttrs=Z.parse(e),n.optional=e.consume("optional"),r.idlType=pe(e,"argument-type"),r.idlType?(n.optional||(n.variadic=e.consume("...")),n.name=e.consumeKind("identifier")||e.consume(...ke),n.name?(r.default=n.optional?te.parse(e):null,r.this):e.unconsume(t)):e.unconsume(t)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return ie(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e);const t=q(this.idlType,e,{useNullableInner:!0});if(t)if(this.idlType.nullable){const e="Dictionary arguments cannot be nullable.";yield O(this.tokens.name,this,"no-nullable-dict-arg",e)}else if(this.optional){if(!this.default){const e="Optional dictionary arguments must have a default value of `{}`.";yield O(this.tokens.name,this,"dict-arg-default",e,{autofix:re(this)})}}else if(this.parent&&!z(t.dictionary,e)&&function(e){const t=e.parent.arguments||e.parent.list,n=t.indexOf(e),r=t.slice(n+1).some((e=>!e.optional));return!r}(this)){const e="Dictionary argument must be optional if it has no required fields";yield O(this.tokens.name,this,"dict-arg-optional",e,{autofix:(n=this,()=>{const e=be(n.idlType);n.tokens.optional={...e,type:"optional",value:"optional"},e.trivia=" ",re(n)()})})}var n}write(e){return e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.optional),e.ts.type(this.idlType.write(e)),e.token(this.tokens.variadic),e.name_token(this.tokens.name,{data:this}),this.default?this.default.write(e):"",e.token(this.tokens.separator)])}}function re(e){return()=>{e.default=te.parse(new Ce(" = {}"))}}class se extends M{static parse(e,{special:t,regular:n}={}){const r={special:t},s=ye(new se({source:e.source,tokens:r}));return t&&"stringifier"===t.value&&(r.termination=e.consume(";"),r.termination)?(s.arguments=[],s):(t||n||(r.special=e.consume("getter","setter","deleter")),s.idlType=fe(e)||e.error("Missing return type"),r.name=e.consumeKind("identifier")||e.consume("includes"),r.open=e.consume("(")||e.error("Invalid operation"),s.arguments=de(e),r.close=e.consume(")")||e.error("Unterminated operation"),r.termination=e.consume(";")||e.error("Unterminated operation, expected `;`"),s.this)}get type(){return"operation"}get name(){const{name:e}=this.tokens;return e?ie(e.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(e){if(yield*this.extAttrs.validate(e),!this.name&&["","static"].includes(this.special)){const e="Regular or static operations must have both a return type and an identifier.";yield O(this.tokens.open,this,"incomplete-op",e)}this.idlType&&(yield*this.idlType.validate(e));for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this,n=this.idlType?[e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map((t=>t.write(e)))),e.token(this.tokens.close)]:[];return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),this.tokens.name?e.token(this.tokens.special):e.token(this.tokens.special,e.ts.nameless,{data:this,parent:t}),...n,e.token(this.tokens.termination)]),{data:this,parent:t})}}class oe extends M{static parse(e,{special:t,noInherit:n=!1,readonly:r=!1}={}){const s=e.position,o={special:t},i=ye(new oe({source:e.source,tokens:o}));if(t||n||(o.special=e.consume("inherit")),"inherit"===i.special&&e.probe("readonly")&&e.error("Inherited attributes cannot be read-only"),o.readonly=e.consume("readonly"),r&&!o.readonly&&e.probe("attribute")&&e.error("Attributes must be readonly in this context"),o.base=e.consume("attribute"),o.base)return i.idlType=pe(e,"attribute-type")||e.error("Attribute lacks a type"),o.name=e.consumeKind("identifier")||e.consume("async","required")||e.error("Attribute lacks a name"),o.termination=e.consume(";")||e.error("Unterminated attribute, expected `;`"),i.this;e.unconsume(s)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return ie(this.tokens.name.value)}*validate(e){if(yield*this.extAttrs.validate(e),yield*this.idlType.validate(e),["sequence","record"].includes(this.idlType.generic)){const e=`Attributes cannot accept ${this.idlType.generic} types.`;yield O(this.tokens.name,this,"attr-invalid-type",e)}{const{reference:t}=q(this.idlType,e)||{};if(t){const e=(this.idlType.union?t:this.idlType).tokens.base,n="Attributes cannot accept dictionary types.";yield O(e,this,"attr-invalid-type",n)}}if(this.readonly&&function(e,t){if(e.union)return!1;if(e.extAttrs.some((e=>"EnforceRange"===e.name)))return!0;const n=t.unique.get(e.idlType);return"typedef"===n?.type&&n.idlType.extAttrs.some((e=>"EnforceRange"===e.name))}(this.idlType,e)){const e=this.idlType.tokens.base,t="Readonly attributes cannot accept [EnforceRange] extended attribute.";yield O(e,this,"attr-invalid-type",t)}}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.special),e.token(this.tokens.readonly),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.termination)]),{data:this,parent:t})}}function ie(e){return e.startsWith("_")?e.slice(1):e}function ae(e,{parser:t,allowDangler:n,listName:r="list"}){const s=t(e);if(!s)return[];s.tokens.separator=e.consume(",");const o=[s];for(;s.tokens.separator;){const s=t(e);if(!s){n||e.error(`Trailing comma in ${r}`);break}if(s.tokens.separator=e.consume(","),o.push(s),!s.tokens.separator)break}return o}function ce(e){return e.consumeKind("decimal","integer")||e.consume("true","false","Infinity","-Infinity","NaN")}function le({type:e,value:t}){switch(e){case"decimal":case"integer":return{type:"number",value:t};case"string":return{type:"string",value:t.slice(1,-1)}}switch(t){case"true":case"false":return{type:"boolean",value:"true"===t};case"Infinity":case"-Infinity":return{type:"Infinity",negative:t.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:t}}}function ue(e){const{source:t}=e,n=function(){const n=e.consume("unsigned"),r=e.consume("short","long");if(r){const s=e.consume("long");return new X({source:t,tokens:{prefix:n,base:r,postfix:s}})}n&&e.error("Failed to parse integer type")}()||function(){const n=e.consume("unrestricted"),r=e.consume("float","double");if(r)return new X({source:t,tokens:{prefix:n,base:r}});n&&e.error("Failed to parse float type")}();if(n)return n;const r=e.consume("bigint","boolean","byte","octet","undefined");return r?new X({source:t,tokens:{base:r}}):void 0}function de(e){return ae(e,{parser:ne.parse,listName:"arguments list"})}function pe(e,t){const n=Z.parse(e),r=X.parse(e,t);return r&&(ye(r).extAttrs=n),r}function fe(e,t){const n=X.parse(e,t||"return-type");if(n)return n;const r=e.consume("void");if(r){const t=new X({source:e.source,tokens:{base:r}});return t.type="return-type",t}}function he(e){const t=e.consume("stringifier");if(!t)return;return oe.parse(e,{special:t})||se.parse(e,{special:t})||e.error("Unterminated stringifier")}function me(e){const t=e.split("\n");if(t.length){const e=t[t.length-1].match(/^\s+/);if(e)return e[0]}return""}function ge(e){return()=>{if(e.extAttrs.length){const t=new Ce("Exposed=Window,"),n=K.parse(t);n.tokens.separator=t.consume(",");const r=e.extAttrs[0];/^\s/.test(r.tokens.name.trivia)||(r.tokens.name.trivia=` ${r.tokens.name.trivia}`),e.extAttrs.unshift(n)}else{ye(e).extAttrs=Z.parse(new Ce("[Exposed=Window]"));const t=e.tokens.base.trivia;e.extAttrs.tokens.open.trivia=t,e.tokens.base.trivia=`\n${me(t)}`}}}function be(e){if(e.extAttrs.length)return e.extAttrs.tokens.open;if("operation"===e.type&&!e.special)return be(e.idlType);return Object.values(e.tokens).sort(((e,t)=>e.index-t.index))[0]}function ye(e,t){if(t||(t=e),!e)return e;return new Proxy(e,{get(e,t){const n=e[t];return Array.isArray(n)&&"source"!==t?ye(n,e):n},set(e,n,r){if(e[n]=r,!r)return!0;if(Array.isArray(r))for(const e of r)void 0!==e.parent&&(e.parent=t);else void 0!==r.parent&&(r.parent=t);return!0}})}const we={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},ve=["ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float32Array","Float64Array","any","object","symbol"],$e=["ByteString","DOMString","USVString"],ke=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],xe=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(ke,$e,ve),_e=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],Se=["_constructor","toString","_toString"];class Ce{constructor(e){this.source=function(e){const t=[];let n=0,r="",s=1,o=0;for(;n<e.length;){const a=e.charAt(n);let c=-1;if(/[\t\n\r ]/.test(a)?c=i("whitespace",{noFlushTrivia:!0}):"/"===a&&(c=i("comment",{noFlushTrivia:!0})),-1!==c){const e=t.pop().value;s+=(e.match(/\n/g)||[]).length,r+=e,o-=1}else if(/[-0-9.A-Z_a-z]/.test(a)){if(c=i("decimal"),-1===c&&(c=i("integer")),-1===c){c=i("identifier");const e=t.length-1,n=t[e];if(-1!==c){if(Se.includes(n.value)){const r=`${ie(n.value)} is a reserved identifier and must not be used.`;throw new Re(j(t,e,null,r))}xe.includes(n.value)&&(n.type="inline")}}}else'"'===a&&(c=i("string"));for(const i of _e)if(e.startsWith(i,n)){t.push({type:"inline",value:i,trivia:r,line:s,index:o}),r="",n+=i.length,c=n;break}if(-1===c&&(c=i("other")),-1===c)throw new Error("Token stream not progressing");n=c,o+=1}return t.push({type:"eof",value:"",trivia:r,line:s,index:o}),t;function i(i,{noFlushTrivia:a}={}){const c=we[i];c.lastIndex=n;const l=c.exec(e);return l?(t.push({type:i,value:l[0],trivia:r,line:s,index:o}),a||(r=""),c.lastIndex):-1}}(e),this.position=0}error(e){throw new Re(j(this.source,this.position,this.current,e))}probeKind(e){return this.source.length>this.position&&this.source[this.position].type===e}probe(e){return this.probeKind("inline")&&this.source[this.position].value===e}consumeKind(...e){for(const t of e){if(!this.probeKind(t))continue;const e=this.source[this.position];return this.position++,e}}consume(...e){if(!this.probeKind("inline"))return;const t=this.source[this.position];for(const n of e)if(t.value===n)return this.position++,t}consumeIdentifier(e){if(this.probeKind("identifier")&&this.source[this.position].value===e)return this.consumeKind("identifier")}unconsume(e){this.position=e}}class Re extends Error{constructor({message:e,bareMessage:t,context:n,line:r,sourceName:s,input:o,tokens:i}){super(e),this.name="WebIDLParseError",this.bareMessage=t,this.context=n,this.line=r,this.sourceName=s,this.input=o,this.tokens=i}}class Ee extends W{static parse(e){const t=e.consumeKind("string");if(t)return new Ee({source:e.source,tokens:{value:t}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(e){const{parent:t}=this;return e.ts.wrap([e.ts.trivia(this.tokens.value.trivia),e.ts.definition(e.ts.wrap(['"',e.ts.name(this.value,{data:this,parent:t}),'"']),{data:this,parent:t}),e.token(this.tokens.separator)])}}class Ae extends M{static parse(e){const t={};if(t.base=e.consume("enum"),!t.base)return;t.name=e.consumeKind("identifier")||e.error("No name for enum");const n=ye(new Ae({source:e.source,tokens:t}));return e.current=n.this,t.open=e.consume("{")||e.error("Bodyless enum"),n.values=ae(e,{parser:Ee.parse,allowDangler:!0,listName:"enumeration"}),e.probeKind("string")&&e.error("No comma between enum values"),t.close=e.consume("}")||e.error("Unexpected value in enum"),n.values.length||e.error("No value in enum"),t.termination=e.consume(";")||e.error("No semicolon after enum"),n.this}get type(){return"enum"}get name(){return ie(this.tokens.name.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.open),e.ts.wrap(this.values.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Te extends M{static parse(e){const t=e.consumeKind("identifier");if(!t)return;const n={target:t};if(n.includes=e.consume("includes"),n.includes)return n.mixin=e.consumeKind("identifier")||e.error("Incomplete includes statement"),n.termination=e.consume(";")||e.error("No terminating ; for includes statement"),new Te({source:e.source,tokens:n});e.unconsume(t.index)}get type(){return"includes"}get target(){return ie(this.tokens.target.value)}get includes(){return ie(this.tokens.mixin.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.reference_token(this.tokens.target,this),e.token(this.tokens.includes),e.reference_token(this.tokens.mixin,this),e.token(this.tokens.termination)]),{data:this})}}class Le extends M{static parse(e){const t={},n=ye(new Le({source:e.source,tokens:t}));if(t.base=e.consume("typedef"),t.base)return n.idlType=pe(e,"typedef-type")||e.error("Typedef lacks a type"),t.name=e.consumeKind("identifier")||e.error("Typedef lacks a name"),e.current=n.this,t.termination=e.consume(";")||e.error("Unterminated typedef, expected `;`"),n.this}get type(){return"typedef"}get name(){return ie(this.tokens.name.value)}*validate(e){yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.termination)]),{data:this})}}class Pe extends M{static parse(e,t){const n={base:t},r=ye(new Pe({source:e.source,tokens:n}));return n.name=e.consumeKind("identifier")||e.error("Callback lacks a name"),e.current=r.this,n.assign=e.consume("=")||e.error("Callback lacks an assignment"),r.idlType=fe(e)||e.error("Callback lacks a return type"),n.open=e.consume("(")||e.error("Callback lacks parentheses for arguments"),r.arguments=de(e),n.close=e.consume(")")||e.error("Unterminated callback"),n.termination=e.consume(";")||e.error("Unterminated callback, expected `;`"),r.this}get type(){return"callback"}get name(){return ie(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.assign),e.ts.type(this.idlType.write(e)),e.token(this.tokens.open),...this.arguments.map((t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Ie extends M{static parse(e,t,{inheritable:n,allowedMembers:r}){const{tokens:s,type:o}=t;for(s.name=e.consumeKind("identifier")||e.error(`Missing name in ${o}`),e.current=t,t=ye(t),n&&Object.assign(s,function(e){const t=e.consume(":");return t?{colon:t,inheritance:e.consumeKind("identifier")||e.error("Inheritance lacks a type")}:{}}(e)),s.open=e.consume("{")||e.error(`Bodyless ${o}`),t.members=[];;){if(s.close=e.consume("}"),s.close)return s.termination=e.consume(";")||e.error(`Missing semicolon after ${o}`),t.this;const n=Z.parse(e);let i;for(const[t,...n]of r)if(i=ye(t(e,...n)),i)break;i||e.error("Unknown member"),i.extAttrs=n,t.members.push(i.this)}}get partial(){return!!this.tokens.partial}get name(){return ie(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?ie(this.tokens.inheritance.value):null}*validate(e){for(const t of this.members)t.validate&&(yield*t.validate(e))}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.callback),e.token(this.tokens.partial),e.token(this.tokens.base),e.token(this.tokens.mixin),e.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?e.ts.wrap([e.token(this.tokens.colon),e.ts.trivia(this.tokens.inheritance.trivia),e.ts.inheritance(e.reference(this.tokens.inheritance.value,{context:this}))]):"")(),e.token(this.tokens.open),e.ts.wrap(this.members.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class De extends M{static parse(e){const t={};if(t.base=e.consume("const"),!t.base)return;let n=ue(e);if(!n){const t=e.consumeKind("identifier")||e.error("Const lacks a type");n=new X({source:e.source,tokens:{base:t}})}e.probe("?")&&e.error("Unexpected nullable constant type"),n.type="const-type",t.name=e.consumeKind("identifier")||e.error("Const lacks a name"),t.assign=e.consume("=")||e.error("Const lacks value assignment"),t.value=ce(e)||e.error("Const lacks a value"),t.termination=e.consume(";")||e.error("Unterminated const, expected `;`");const r=new De({source:e.source,tokens:t});return ye(r).idlType=n,r}get type(){return"const"}get name(){return ie(this.tokens.name.value)}get value(){return le(this.tokens.value)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.assign),e.token(this.tokens.value),e.token(this.tokens.termination)]),{data:this,parent:t})}}class Ne extends M{static parse(e){const t=e.position,n=ye(new Ne({source:e.source,tokens:{}})),{tokens:r}=n;if(r.readonly=e.consume("readonly"),r.readonly||(r.async=e.consume("async")),r.base=r.readonly?e.consume("maplike","setlike"):r.async?e.consume("iterable"):e.consume("iterable","maplike","setlike"),!r.base)return void e.unconsume(t);const{type:s}=n,o="maplike"===s,i=o||"iterable"===s,a=n.async&&"iterable"===s;r.open=e.consume("<")||e.error(`Missing less-than sign \`<\` in ${s} declaration`);const c=pe(e)||e.error(`Missing a type argument in ${s} declaration`);return n.idlType=[c],n.arguments=[],i&&(c.tokens.separator=e.consume(","),c.tokens.separator?n.idlType.push(pe(e)):o&&e.error(`Missing second type argument in ${s} declaration`)),r.close=e.consume(">")||e.error(`Missing greater-than sign \`>\` in ${s} declaration`),e.probe("(")&&(a?(r.argsOpen=e.consume("("),n.arguments.push(...de(e)),r.argsClose=e.consume(")")||e.error("Unterminated async iterable argument list")):e.error("Arguments are only allowed for `async iterable`")),r.termination=e.consume(";")||e.error(`Missing semicolon after ${s} declaration`),n.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(e){for(const t of this.idlType)yield*t.validate(e);for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.readonly),e.token(this.tokens.async),e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),e.ts.wrap(this.idlType.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.argsOpen),e.ts.wrap(this.arguments.map((t=>t.write(e)))),e.token(this.tokens.argsClose),e.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class je extends M{static parse(e){const t=e.consume("constructor");if(!t)return;const n={base:t};n.open=e.consume("(")||e.error("No argument list in constructor");const r=de(e);n.close=e.consume(")")||e.error("Unterminated constructor"),n.termination=e.consume(";")||e.error("No semicolon after constructor");const s=new je({source:e.source,tokens:n});return ye(s).arguments=r,s}get type(){return"constructor"}*validate(e){for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base,e.ts.nameless,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this,parent:t})}}function Oe(e){const t=e.consume("static");if(!t)return;return oe.parse(e,{special:t})||se.parse(e,{special:t})||e.error("No body in static member")}class Me extends Ie{static parse(e,t,{extMembers:n=[],partial:r=null}={}){const s={partial:r,base:t};return Ie.parse(e,new Me({source:e.source,tokens:s}),{inheritable:!r,allowedMembers:[...n,[De.parse],[je.parse],[Oe],[he],[Ne.parse],[oe.parse],[se.parse]]})}get type(){return"interface"}*validate(e){if(yield*this.extAttrs.validate(e),!this.partial&&this.extAttrs.every((e=>"Exposed"!==e.name))){const e="Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield O(this.tokens.name,this,"require-exposed",e,{autofix:ge(this)})}const t=this.extAttrs.filter((e=>"Constructor"===e.name));for(const e of t){const t="Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.";yield O(e.tokens.name,this,"constructor-member",t,{autofix:qe(this,e)})}if(this.extAttrs.some((e=>"Global"===e.name))){const e=this.extAttrs.filter((e=>"LegacyFactoryFunction"===e.name));for(const t of e){const e="Interfaces marked as `[Global]` cannot have factory functions.";yield O(t.tokens.name,this,"no-constructible-global",e)}const t=this.members.filter((e=>"constructor"===e.type));for(const e of t){const t="Interfaces marked as `[Global]` cannot have constructors.";yield O(e.tokens.base,this,"no-constructible-global",t)}}yield*super.validate(e),this.partial||(yield*function*(e,t){const n=function(e){const t=i(e);return{statics:new Set(t.filter((e=>"static"===e.special)).map((e=>e.name))),nonstatics:new Set(t.filter((e=>"static"!==e.special)).map((e=>e.name)))}}(t),r=e.partials.get(t.name)||[],s=e.mixinMap.get(t.name)||[];for(const e of[...r,...s]){const r=i(e),s=r.filter((e=>"static"===e.special)),a=r.filter((e=>"static"!==e.special));yield*o(s,n.statics,e,t),yield*o(a,n.nonstatics,e,t),s.forEach((e=>n.statics.add(e.name))),a.forEach((e=>n.nonstatics.add(e.name)))}function*o(e,t,n,r){for(const s of e){const{name:e}=s;if(e&&t.has(e)){const t=`The ${"static"===s.special?"static ":""}operation "${e}" has already been defined for the base interface "${r.name}" either in itself or in a mixin`;yield O(s.tokens.name,n,"no-cross-overload",t)}}}function i(e){return e.members.filter((({type:e})=>"operation"===e))}}(e,this))}}function qe(e,t){return e=ye(e),()=>{const n=me(e.extAttrs.tokens.open.trivia),r=e.members.length?me(be(e.members[0]).trivia):function(e){const t=me(e),n=t.includes("\t")?"\t":" ";return t+n}(n),s=je.parse(new Ce(`\n${r}constructor();`));s.extAttrs=new Z({source:e.source,tokens:{}}),ye(s).arguments=t.arguments;const o=function(e,t){const n=e.slice().reverse().findIndex(t);return-1===n?n:e.length-n-1}(e.members,(e=>"constructor"===e.type));e.members.splice(o+1,0,s);const{close:i}=e.tokens;i.trivia.includes("\n")||(i.trivia+=`\n${n}`);const{extAttrs:a}=e,c=a.indexOf(t),l=a.splice(c,1);a.length?a.length===c?a[c-1].tokens.separator=void 0:a[c].tokens.name.trivia.trim()||(a[c].tokens.name.trivia=l[0].tokens.name.trivia):a.tokens.open=a.tokens.close=void 0}}class ze extends Ie{static parse(e,t,{extMembers:n=[],partial:r}={}){const s={partial:r,base:t};if(s.mixin=e.consume("mixin"),s.mixin)return Ie.parse(e,new ze({source:e.source,tokens:s}),{allowedMembers:[...n,[De.parse],[he],[oe.parse,{noInherit:!0}],[se.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class Ue extends M{static parse(e){const t={},n=ye(new Ue({source:e.source,tokens:t}));return n.extAttrs=Z.parse(e),t.required=e.consume("required"),n.idlType=pe(e,"dictionary-type")||e.error("Dictionary member lacks a type"),t.name=e.consumeKind("identifier")||e.error("Dictionary member lacks a name"),n.default=te.parse(e),t.required&&n.default&&e.error("Required member must not have a default"),t.termination=e.consume(";")||e.error("Unterminated dictionary member, expected `;`"),n.this}get type(){return"field"}get name(){return ie(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(e){yield*this.idlType.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.required),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),this.default?this.default.write(e):"",e.token(this.tokens.termination)]),{data:this,parent:t})}}class We extends Ie{static parse(e,{extMembers:t=[],partial:n}={}){const r={partial:n};if(r.base=e.consume("dictionary"),r.base)return Ie.parse(e,new We({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[...t,[Ue.parse]]})}get type(){return"dictionary"}}class Fe extends Ie{static parse(e,{extMembers:t=[],partial:n}={}){const r={partial:n};if(r.base=e.consume("namespace"),r.base)return Ie.parse(e,new Fe({source:e.source,tokens:r}),{allowedMembers:[...t,[oe.parse,{noInherit:!0,readonly:!0}],[De.parse],[se.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(e){if(!this.partial&&this.extAttrs.every((e=>"Exposed"!==e.name))){const e="Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield O(this.tokens.name,this,"require-exposed",e,{autofix:ge(this)})}yield*super.validate(e)}}class Be extends Ie{static parse(e,t,{extMembers:n=[]}={}){const r={callback:t};if(r.base=e.consume("interface"),r.base)return Ie.parse(e,new Be({source:e.source,tokens:r}),{allowedMembers:[...n,[De.parse],[se.parse,{regular:!0}]]})}get type(){return"callback interface"}}function He(e,t){const n=e.source;function r(t){e.error(t)}function s(...t){return e.consume(...t)}function o(n){const o=s("interface");if(o)return ze.parse(e,o,{...n,...t?.extensions?.mixin})||Me.parse(e,o,{...n,...t?.extensions?.interface})||r("Interface has no proper body")}function i(){if(t.productions)for(const n of t.productions){const t=n(e);if(t)return t}return function(){const n=s("callback");if(n)return e.probe("interface")?Be.parse(e,n,{...t?.extensions?.callbackInterface}):Pe.parse(e,n)}()||o()||function(){const n=s("partial");if(n)return We.parse(e,{partial:n,...t?.extensions?.dictionary})||o({partial:n})||Fe.parse(e,{partial:n,...t?.extensions?.namespace})||r("Partial doesn't apply to anything")}()||We.parse(e,t?.extensions?.dictionary)||Ae.parse(e)||Le.parse(e)||Te.parse(e)||Fe.parse(e,t?.extensions?.namespace)}const a=function(){if(!n.length)return[];const s=[];for(;;){const t=Z.parse(e),n=i();if(!n){t.length&&r("Stray extended attributes");break}ye(n).extAttrs=t,s.push(n)}const o=F.parse(e);return t.concrete&&s.push(o),s}();return e.position<n.length&&r("Unrecognised tokens"),a}function Ge(e){return e}const Ve={wrap:e=>e.join(""),trivia:Ge,name:Ge,reference:Ge,type:Ge,generic:Ge,nameless:Ge,inheritance:Ge,definition:Ge,extendedAttribute:Ge,extendedAttributeReference:Ge};class Ye{constructor(e){this.ts=Object.assign({},Ve,e)}reference(e,{unescaped:t,context:n}){return t||(t=e.startsWith("_")?e.slice(1):e),this.ts.reference(e,t,n)}token(e,t=Ge,...n){if(!e)return"";const r=t(e.value,...n);return this.ts.wrap([this.ts.trivia(e.trivia),r])}reference_token(e,t){return this.token(e,this.reference.bind(this),{context:t})}name_token(e,t){return this.token(e,this.ts.name,t)}identifier(e,t){return this.ts.wrap([this.reference_token(e.tokens.value,t),this.token(e.tokens.separator)])}}function Ke(e,t){const n=new Map,r=e.filter((e=>"includes"===e.type));for(const e of r){const r=t.get(e.includes);if(!r)continue;const s=n.get(e.target);s?s.push(r):n.set(e.target,[r])}return n}function*Ze(e){const t=function(e){const t=new Map,n=new Set,r=new Map;for(const s of e)if(s.partial){const e=r.get(s.name);e?e.push(s):r.set(s.name,[s])}else s.name&&(t.has(s.name)?n.add(s):t.set(s.name,s));return{all:e,unique:t,partials:r,duplicates:n,mixinMap:Ke(e,t),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(e);for(const e of t.all)e.validate&&(yield*e.validate(t));yield*function*({unique:e,duplicates:t}){for(const n of t){const{name:t}=n,r=`The name "${t}" of type "${e.get(t).type}" was already seen`;yield O(n.tokens.name,n,"no-duplicate",r)}}(t)}var Je=Object.freeze({__proto__:null,WebIDLParseError:Re,parse:function(e,t={}){const n=new Ce(e);return void 0!==t.sourceName&&(n.source.name=t.sourceName),He(n,t)},validate:function(e){return[...Ze((t=e,t.flat?t.flat():[].concat(...t)))];var t},write:function(e,{templates:t=Ve}={}){t=Object.assign({},Ve,t);const n=new Ye(t);return t.wrap(e.map((e=>e.write(n))))}});const Qe=/^[!#$%&'*+-.^`|~\w]+$/,Xe=/[\u000A\u000D\u0009\u0020]/u,et=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function tt(e,t,n){(t&&""!==t&&!e.has(t)&&et.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function nt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let rt={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function st(e){rt=e}const ot=/[&<>"']/,it=new RegExp(ot.source,"g"),at=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ct=new RegExp(at.source,"g"),lt={"&":"&","<":"<",">":">",'"':""","'":"'"},ut=e=>lt[e];function dt(e,t){if(t){if(ot.test(e))return e.replace(it,ut)}else if(at.test(e))return e.replace(ct,ut);return e}const pt=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function ft(e){return e.replace(pt,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const ht=/(^|[^\[])\^/g;function mt(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(ht,"$1"),n=n.replace(e,s),r},getRegex:()=>new RegExp(n,t)};return r}function gt(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const bt={exec:()=>null};function yt(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function wt(e,t,n){const r=e.length;if(0===r)return"";let s=0;for(;s<r;){const o=e.charAt(r-s-1);if(o!==t||n){if(o===t||!n)break;s++}else s++}return e.slice(0,r-s)}function vt(e,t,n,r){const s=t.href,o=t.title?dt(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:s,title:o,text:i,tokens:r.inlineTokens(i)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:s,title:o,text:dt(i)}}class $t{options;rules;lexer;constructor(e){this.options=e||rt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:wt(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=wt(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");e=wt(e.replace(/^ *>[ \t]?/gm,""),"\n");const n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const o=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let i="",a="",c=!1;for(;e;){let n=!1;if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;i=t[0],e=e.substring(i.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),l=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=r.slice(u),u+=t[1].length);let d=!1;if(!r&&/^ *$/.test(l)&&(i+=l+"\n",e=e.substring(l.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const c=e.split("\n",1)[0];if(l=c,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),s.test(l))break;if(o.test(l))break;if(t.test(l))break;if(n.test(e))break;if(l.search(/[^ ]/)>=u||!l.trim())a+="\n"+l.slice(u);else{if(d)break;if(r.search(/[^ ]/)>=4)break;if(s.test(r))break;if(o.test(r))break;if(n.test(r))break;a+="\n"+l}d||l.trim()||(d=!0),i+=c+"\n",e=e.substring(c.length+1),r=l.slice(u)}}s.loose||(c?s.loose=!0:/\n *\n *$/.test(i)&&(c=!0));let p,f=null;this.options.gfm&&(f=/^\[[ xX]\] /.exec(a),f&&(p="[ ] "!==f[0],a=a.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:i,task:!!f,checked:p,loose:!1,text:a,tokens:[]}),s.raw+=i}s.items[s.items.length-1].raw=i.trimEnd(),s.items[s.items.length-1].text=a.trimEnd(),s.raw=s.raw.trimEnd();for(let e=0;e<s.items.length;e++)if(this.lexer.state.top=!1,s.items[e].tokens=this.lexer.blockTokens(s.items[e].text,[]),!s.loose){const t=s.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));s.loose=n}if(s.loose)for(let e=0;e<s.items.length;e++)s.items[e].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=yt(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?o.align.push("right"):/^ *:-+: *$/.test(e)?o.align.push("center"):/^ *:-+ *$/.test(e)?o.align.push("left"):o.align.push(null);for(const e of n)o.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of s)o.rows.push(yt(e,o.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:dt(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=wt(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),vt(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return vt(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let s,o,i=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(o=[...s].length,r[3]||r[4]){i+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){a+=o;continue}if(i-=o,i>0)continue;o=Math.min(o,o+i+a);const t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+o);if(Math.min(n,o)%2){const e=c.slice(1,-1);return{type:"em",raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}const l=c.slice(2,-2);return{type:"strong",raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=dt(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=dt(t[1]),n="mailto:"+e):(e=dt(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=dt(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=dt(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:dt(t[0]),{type:"text",raw:t[0],text:e}}}}const kt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,xt=/(?:[*+-]|\d{1,9}[.)])/,_t=mt(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,xt).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),St=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ct=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Rt=mt(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Ct).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Et=mt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,xt).getRegex(),At="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Tt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Lt=mt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Tt).replace("tag",At).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Pt=mt(St).replace("hr",kt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",At).getRegex(),It={blockquote:mt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Pt).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:Rt,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:kt,html:Lt,lheading:_t,list:Et,newline:/^(?: *(?:\n|$))+/,paragraph:Pt,table:bt,text:/^[^\n]+/},Dt=mt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",kt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",At).getRegex(),Nt={...It,table:Dt,paragraph:mt(St).replace("hr",kt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Dt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",At).getRegex()},jt={...It,html:mt("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Tt).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:bt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:mt(St).replace("hr",kt).replace("heading"," *#{1,6} *[^\n]").replace("lheading",_t).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ot=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Mt=/^( {2,}|\\)\n(?!\s*$)/,qt="\\p{P}\\p{S}",zt=mt(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,qt).getRegex(),Ut=mt(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,qt).getRegex(),Wt=mt("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,qt).getRegex(),Ft=mt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,qt).getRegex(),Bt=mt(/\\([punct])/,"gu").replace(/punct/g,qt).getRegex(),Ht=mt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Gt=mt(Tt).replace("(?:--\x3e|$)","--\x3e").getRegex(),Vt=mt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Gt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Yt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Kt=mt(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Yt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Zt=mt(/^!?\[(label)\]\[(ref)\]/).replace("label",Yt).replace("ref",Ct).getRegex(),Jt=mt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ct).getRegex(),Qt={_backpedal:bt,anyPunctuation:Bt,autolink:Ht,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:Mt,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:bt,emStrongLDelim:Ut,emStrongRDelimAst:Wt,emStrongRDelimUnd:Ft,escape:Ot,link:Kt,nolink:Jt,punctuation:zt,reflink:Zt,reflinkSearch:mt("reflink|nolink(?!\\()","g").replace("reflink",Zt).replace("nolink",Jt).getRegex(),tag:Vt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:bt},Xt={...Qt,link:mt(/^!?\[(label)\]\((.*?)\)/).replace("label",Yt).getRegex(),reflink:mt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Yt).getRegex()},en={...Qt,escape:mt(Ot).replace("])","~|])").getRegex(),url:mt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},tn={...en,br:mt(Mt).replace("{2,}","*").getRegex(),text:mt(en.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},nn={normal:It,gfm:Nt,pedantic:jt},rn={normal:Qt,gfm:en,breaks:tn,pedantic:Xt};class sn{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||rt,this.options.tokenizer=this.options.tokenizer||new $t,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:nn.normal,inline:rn.normal};this.options.pedantic?(t.block=nn.pedantic,t.inline=rn.pedantic):this.options.gfm&&(t.block=nn.gfm,this.options.breaks?t.inline=rn.breaks:t.inline=rn.gfm),this.tokenizer.rules=t}static get rules(){return{block:nn,inline:rn}}static lex(e,t){return new sn(t).lex(e)}static lexInline(e,t){return new sn(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){let n,r,s,o;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s)))r=t[t.length-1],o&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),o=s.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,s,o,i,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(c));)c=c.slice(0,o.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class on{options;constructor(e){this.options=e||rt}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+dt(r)+'">'+(n?e:dt(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:dt(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const r=gt(e);if(null===r)return n;let s='<a href="'+(e=r)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>",s}image(e,t,n){const r=gt(e);if(null===r)return n;let s=`<img src="${e=r}" alt="${n}"`;return t&&(s+=` title="${t}"`),s+=">",s}text(e){return e}}class an{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class cn{options;renderer;textRenderer;constructor(e){this.options=e||rt,this.options.renderer=this.options.renderer||new on,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new an}static parse(e,t){return new cn(t).parse(e)}static parseInline(e,t){return new cn(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const s=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const e=s,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(s.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=s;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,ft(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=s;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=s;let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let o="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];r="";for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});o+=this.renderer.tablerow(r)}n+=this.renderer.table(t,o);continue}case"blockquote":{const e=s,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=s,t=e.ordered,r=e.start,o=e.loose;let i="";for(let t=0;t<e.items.length;t++){const n=e.items[t],r=n.checked,s=n.task;let a="";if(n.task){const e=this.renderer.checkbox(!!r);o?n.tokens.length>0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(n.tokens,o),i+=this.renderer.listitem(a,s,!!r)}n+=this.renderer.list(i,t,r);continue}case"html":{const e=s;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=s;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let o=s,i=o.tokens?this.parseInline(o.tokens):o.text;for(;r+1<e.length&&"text"===e[r+1].type;)o=e[++r],i+="\n"+(o.tokens?this.parseInline(o.tokens):o.text);n+=t?this.renderer.paragraph(i):i;continue}default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const s=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){n+=e||"";continue}}switch(s.type){case"escape":{const e=s;n+=t.text(e.text);break}case"html":{const e=s;n+=t.html(e.text);break}case"link":{const e=s;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=s;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=s;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=s;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=s;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=s;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=s;n+=t.text(e.text);break}default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class ln{options;constructor(e){this.options=e||rt}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}const un=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(sn.lex,cn.parse);parseInline=this.#e(sn.lexInline,cn.parseInline);Parser=cn;Renderer=on;TextRenderer=an;Lexer=sn;Tokenizer=$t;Hooks=ln;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{const s=e[r].flat(1/0);n=n.concat(this.walkTokens(s,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new on(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const r=n,s=e.renderer[r],o=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=o.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new $t(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,s=e.tokenizer[r],o=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new ln;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,s=e.hooks[r],o=t[r];ln.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(s.call(t,e)).then((e=>o.call(t,e)));const n=s.call(t,e);return o.call(t,n)}:t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return sn.lex(e,t??this.defaults)}parser(e,t){return cn.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const s={...r},o={...this.defaults,...s};!0===this.defaults.async&&!1===s.async&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const i=this.#t(!!o.silent,!!o.async);if(null==n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then((t=>e(t,o))).then((e=>o.hooks?o.hooks.processAllTokens(e):e)).then((e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then((()=>e)):e)).then((e=>t(e,o))).then((e=>o.hooks?o.hooks.postprocess(e):e)).catch(i);try{o.hooks&&(n=o.hooks.preprocess(n));let r=e(n,o);o.hooks&&(r=o.hooks.processAllTokens(r)),o.walkTokens&&this.walkTokens(r,o.walkTokens);let s=t(r,o);return o.hooks&&(s=o.hooks.postprocess(s)),s}catch(e){return i(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+dt(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function dn(e,t){return un.parse(e,t)}dn.options=dn.setOptions=function(e){return un.setOptions(e),dn.defaults=un.defaults,st(dn.defaults),dn},dn.getDefaults=nt,dn.defaults=rt,dn.use=function(...e){return un.use(...e),dn.defaults=un.defaults,st(dn.defaults),dn},dn.walkTokens=function(e,t){return un.walkTokens(e,t)},dn.parseInline=un.parseInline,dn.Parser=cn,dn.parser=cn.parse,dn.Renderer=on,dn.TextRenderer=an,dn.Lexer=sn,dn.lexer=sn.lex,dn.Tokenizer=$t,dn.Hooks=ln,dn.parse=dn,dn.options,dn.setOptions,dn.use,dn.walkTokens,dn.parseInline,cn.parse,sn.lex;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function pn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fn,hn={exports:{}};fn=hn,function(e,t){fn.exports=t()}(0,(function(){var e=[],t=[],n={},r={},s={};function o(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(t[0],(function(n,r){var s,o,a=(s=t[1],o=arguments,s.replace(/\$(\d{1,2})/g,(function(e,t){return o[t]||""})));return i(""===n?e[r-1]:n,a)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var s=r.length;s--;){var o=r[s];if(o[0].test(t))return a(t,o)}return t}function l(e,t,n){return function(r){var s=r.toLowerCase();return t.hasOwnProperty(s)?i(r,s):e.hasOwnProperty(s)?i(r,e[s]):c(s,r,n)}}function u(e,t,n,r){return function(r){var s=r.toLowerCase();return!!t.hasOwnProperty(s)||!e.hasOwnProperty(s)&&c(s,s,n)===s}}function d(e,t,n){return(n?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=l(s,r,e),d.isPlural=u(s,r,e),d.singular=l(r,s,t),d.isSingular=u(r,s,t),d.addPluralRule=function(t,n){e.push([o(t),n])},d.addSingularRule=function(e,n){t.push([o(e),n])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},d.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),s[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return d.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return d.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return d.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eĆ©]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d}));var mn=pn(hn.exports),gn=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,s=o.prototype;return s.delete=function(e){return this.has(e)&&delete e[this._]},s.get=function(e){return this.has(e)?e[this._]:void 0},s.has=function(e){return r.call(e,this._)},s.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},o;function o(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(i,this)}function i(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=s.prototype;function s(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=s}(Math.random(),Object.defineProperty)}function s(e,t,n,r,s,o){for(var i=("selectedIndex"in t),a=i;r<s;){var c,l=e(n[r],1);t.insertBefore(l,o),i&&a&&l.selected&&(a=!a,c=t.selectedIndex,t.selectedIndex=c<0?r:d.call(t.querySelectorAll("option"),l)),r++}}function o(e,t){return e==t}function i(e){return e}function a(e,t,n,r,s,o,i){var a=o-s;if(a<1)return-1;for(;a<=n-t;){for(var c=t,l=s;c<n&&l<o&&i(e[c],r[l]);)c++,l++;if(l===o)return t;t=c+1}return-1}function c(e,t,n,r,s){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:s}function l(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,s=t;r<s;){var o=(r+s)/2>>>0;n<e[o]?s=o:r=1+o}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||o,d=r.node||i,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,y=0;g<m&&y<b&&u(t[g],n[y]);)g++,y++;for(;g<m&&y<b&&u(t[m-1],n[b-1]);)m--,b--;var w=g===m,v=y===b;if(w&&v)return n;if(w&&y<b)return s(d,e,n,y,b,c(d,t,g,h,f)),n;if(v&&g<m)return l(d,t,g,m),n;var $=m-g,k=b-y,x=-1;if($<k){if(-1<(x=a(n,y,b,t,g,m,u)))return s(d,e,n,y,x,d(t[g],0)),s(d,e,n,x+$,b,c(d,t,m,h,f)),n}else if(k<$&&-1<(x=a(t,g,m,n,y,b,u)))return l(d,t,g,x),l(d,t,x+k,m),n;return $<2||k<2?(s(d,e,n,y,b,d(t[g],0)),l(d,t,g,m)):$==k&&function(e,t,n,r,s,o){for(;r<s&&o(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?s(d,e,n,y,b,c(d,t,m,h,f)):function(e,t,n,r,o,i,a,c,u,d,f,h,m){!function(e,t,n,r,o,i,a,c,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:o++,f++;break;case 1:d.push(r[o]),s(t,n,r,o++,o,f<c?t(i[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(i[a])?a++:l(t,i,a++,a)}}(function(e,t,n,r,s,o,i){var a,c,l,u,d,p,f=n+o,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(c=(l=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;l<o&&c<n&&i(r[s+l],e[t+c]);)l++,c++;if(l===o&&c===n)break e;d[b+a]=l}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<l&&0<c&&i(r[s+l-1],e[t+c-1]);)m[g--]=0,l--,c--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=l-c)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(c--,m[g--]=1):(l--,m[g--]=-1)}return m}(n,r,i,a,c,d,h)||function(e,t,n,r,s,o,i,a){var c=0,l=r<a?r:a,u=Array(l++),d=Array(l);d[0]=-1;for(var f=1;f<l;f++)d[f]=i;for(var h=s.slice(o,i),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(c=p(d,l,g=b+o))&&(d[c]=g,u[c]={newi:m,oldi:g,prev:u[c-1]})}for(c=--l,--i;d[c]>i;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var v=w.newi,$=w.oldi;v<n;)y[--l]=1,--n;for(;$<i;)y[--l]=-1,--i;y[--l]=0,--n,--i,w=w.prev}for(;t<=n;)y[--l]=1,--n;for(;o<=i;)y[--l]=-1,--i;return y}(n,r,o,i,a,c,u,d),e,t,n,r,a,c,f,m)}(d,e,n,y,b,k,t,g,m,$,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,y={};try{y.Map=Map}catch(u){y.Map=function(){var e=0,t=[],n=[];return{delete:function(s){var o=r(s);return o&&(t.splice(e,1),n.splice(e,1)),o},forEach:function(e,r){t.forEach((function(t,s){e.call(r,n[s],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(s,o){return n[r(s)?e:t.push(s)-1]=o,this}};function r(n){return-1<(e=t.indexOf(n))}}}var w=y.Map;function v(){return this}function $(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var x,_,S,C,R,E,A={},T={},L=[],P=T.hasOwnProperty,I=0,D={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in T||(I=L.push(e)),T[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<I;n++){var r=L[n];if(P.call(e,r))return T[r](e[r],t)}}},N=Array.isArray||(_=(x={}.toString).call([]),function(e){return x.call(e)===_}),j=(S=e,C="fragment",E="content"in M(R="template")?function(e){var t=M(R);return t.innerHTML=e,t.content}:function(e){var t,n=M(C),r=M(R);return O(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=M(C),n=M("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",O(t,n.firstChild.childNodes),t}:E)(e)});function O(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function M(e){return e===C?S.createDocumentFragment():S.createElementNS("http://www.w3.org/1999/xhtml",e)}var q,z,U,W,F,B,H,G,V,Y=(z="appendChild",U="cloneNode",W="createTextNode",B=(F="importNode")in(q=e),(H=q.createDocumentFragment())[z](q[W]("g")),H[z](q[W]("")),(B?q[F](H,!0):H[U](!0)).childNodes.length<2?function e(t,n){for(var r=t[U](),s=t.childNodes||[],o=s.length,i=0;n&&i<o;i++)r[z](e(s[i],n));return r}:B?q[F]:function(e,t){return e[U](!!t)}),K="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Z="-"+Math.random().toFixed(6)+"%",J=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Z+'"></p>',G.content.childNodes[0].getAttribute(V)==Z)||(Z="_dt: "+Z.slice(1,-1)+";",J=!0)}catch(u){}var Q="\x3c!--"+Z+"--\x3e",X=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,se=" \\f\\n\\r\\t",oe="[^"+se+"\\/>\"'=]+",ie="["+se+"]+"+oe,ae="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ce="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+oe.replace("\\/","")+"))?)",le=new RegExp(ae+ie+ce+"+)(["+se+"]*/?>)","g"),ue=new RegExp(ae+ie+ce+"*)(["+se+"]*/>)","g"),de=new RegExp("("+ie+"\\s*=\\s*)(['\"]?)"+Q+"\\2","gi");function pe(e,t,n,r){return"<"+t+n.replace(de,fe)+r}function fe(e,t,n){return t+(n||'"')+Z+(n||'"')}function he(e,t,n){return re.test(t)?e:"<"+t+n+"></"+t+">"}var me=J?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function ge(t,n,r,s){for(var o=t.childNodes,i=o.length,a=0;a<i;){var c=o[a];switch(c.nodeType){case ee:var l=s.concat(a);!function(t,n,r,s){for(var o,i=t.attributes,a=[],c=[],l=me(i,r),u=l.length,d=0;d<u;){var p=l[d++],f=p.value===Z;if(f||1<(o=p.value.split(Q)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=i[m]||i[m.toLowerCase()];if(f)n.push(be(g,s,m,null));else{for(var b=o.length-2;b--;)r.shift();n.push(be(g,s,m,o))}}c.push(p)}}for(var y=((d=0)<(u=c.length)&&J&&!("ownerSVGElement"in t));d<u;){var w=c[d++];y&&(w.value=""),t.removeAttribute(w.name)}var v=t.nodeName;if(/^script$/i.test(v)){var $=e.createElement(v);for(u=i.length,d=0;d<u;)$.setAttributeNode(i[d++].cloneNode(!0));$.textContent=t.textContent,t.parentNode.replaceChild($,t)}}(c,n,r,l),ge(c,n,r,l);break;case X:var u=c.textContent;if(u===Z)r.shift(),n.push(ne.test(t.nodeName)?ye(t,s):{type:"any",node:c,path:s.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"šŸ‘»":t.removeChild(c),a--,i--}break;case te:ne.test(t.nodeName)&&K.call(c.textContent)===Q&&(r.shift(),n.push(ye(t,s)))}a++}}function be(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function ye(e,t){return{type:"text",node:e,path:t}}var we,ve=(we=new n,{get:function(e){return we.get(e)},set:function(e,t){return we.set(e,t),t}});function $e(e,t){var n=(e.convert||function(e){return e.join(Q).replace(ue,he).replace(le,pe)})(t),r=e.transform;r&&(n=r(n));var s=j(n,e.type);xe(s);var o=[];return ge(s,o,t.slice(0),[]),{content:s,updates:function(n){for(var r=[],s=o.length,i=0,a=0;i<s;){var c=o[i++],l=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,c.path);switch(c.type){case"any":r.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var u=c.sparse,d=e.attribute(l,c.name,c.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return s+=a,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+" values instead of "+s+"\n"+t.join("${value}"));for(var o=1,i=1;o<e;){var a=r[o-i];if(a.sparse){var c=a.values,l=c[0],u=1,d=c.length;for(i+=d-2;u<d;)l+=arguments[o++]+c[u++];a.fn(l)}else a.fn(arguments[o++])}return n}}}}var ke=[];function xe(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===K.call(r.textContent).length&&e.removeChild(r)}}var _e,Se,Ce=(_e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Se=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Ee(n,!0)}(e,t):Ee(e.style,!1)});function Re(e,t,n){return t+"-"+n.toLowerCase()}function Ee(e,t){var n,r;return function(s){var o,i,a,c;switch(typeof s){case"object":if(s){if("object"===n){if(!t&&r!==s)for(i in r)i in s||(e[i]="")}else t?e.value="":e.cssText="";for(i in o=t?{}:e,s)a="number"!=typeof(c=s[i])||_e.test(i)?c:c+"px",!t&&/^--/.test(i)?o.setProperty(i,a):o[i]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Se,Re),":",e[t],";");return n.join("")}(r=o):r=s;break}default:r!=s&&(n="string",r=s,t?e.value=s||"":e.cssText=s||"")}}}var Ae,Te,Le=(Ae=[].slice,(Te=Pe.prototype).ELEMENT_NODE=1,Te.nodeType=111,Te.remove=function(e){var t,n=this.childNodes,r=this.firstChild,s=this.lastChild;return this._=null,e&&2===n.length?s.parentNode.removeChild(s):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(s),t.deleteContents()),r},Te.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,s=0,o=r.length;s<o;s++)t.appendChild(r[s]);return t},Pe);function Pe(e){var t=this.childNodes=Ae.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Ie(e){return{html:e}}function De(e,t){switch(e.nodeType){case Be:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Fe:return De(e.render(),t);default:return e}}function Ne(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(Ie).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function je(e){return null!=e&&"then"in e}var Oe,Me,qe,ze,Ue,We="ownerSVGElement",Fe=v.prototype.nodeType,Be=Le.prototype.nodeType,He=(Me=(Oe={Event:b,WeakSet:u}).Event,qe=Oe.WeakSet,ze=!0,Ue=null,function(e){return ze&&(ze=!ze,Ue=new qe,function(e){var t=new qe,n=new qe;try{new MutationObserver(i).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,s=[],o=function(e){s.push(e),clearTimeout(r),r=setTimeout((function(){i(s.splice(r=0,s.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){o({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){o({addedNodes:[e.target],removedNodes:[]})}),!0)}function i(e){for(var r,s=e.length,o=0;o<s;o++)a((r=e[o]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var s,o=new Me(t),i=e.length,a=0;a<i;1===(s=e[a++]).nodeType&&function e(t,n,r,s,o){Ue.has(t)&&!s.has(t)&&(o.delete(t),s.add(t),t.dispatchEvent(n));for(var i=t.children||[],a=i.length,c=0;c<a;e(i[c++],n,r,s,o));}(s,o,t,n,r));}}(e.ownerDocument)),Ue.add(e),e}),Ge=/^(?:form|list)$/i,Ve=[].slice;function Ye(t){return this.type=t,function(t){var n=ke,r=xe;return function(s){var o,i,a;return n!==s&&(o=t,i=n=s,a=ve.get(i)||ve.set(i,$e(o,i)),r=a.updates(Y.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ke=!(Ye.prototype={attribute:function(e,t,n){var r,s=We in e;if("style"===t)return Ce(e,n,s);if("."===t.slice(0,1))return l=e,u=t.slice(1),s?function(e){try{l[u]=e}catch(t){l.setAttribute(u,e)}}:function(e){l[u]=e};if("?"===t.slice(0,1))return i=e,a=t.slice(1),function(e){c!==!!e&&((c=!!e)?i.setAttribute(a,""):i.removeAttribute(a))};if(/^on/.test(t)){var o=t.slice(2);return"connected"===o||"disconnected"===o?He(e):t.toLowerCase()in e&&(o=o.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(o,r,!1),(r=t)&&e.addEventListener(o,t,!1))}}if("data"===t||!s&&t in e&&!Ge.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in D.attributes)return function(n){var s=D.attributes[t](e,n);r!==s&&(null==(r=s)?e.removeAttribute(t):e.setAttribute(t,s))};var i,a,c,l,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:De,before:e},s=We in e?"svg":"html",o=!1;return function i(a){switch(typeof a){case"string":case"number":case"boolean":o?n!==a&&(n=a,t[0].textContent=a):(o=!0,n=a,t=h(e.parentNode,t,[(c=a,e.ownerDocument.createTextNode(c))],r));break;case"function":i(a(e));break;case"object":case"undefined":if(null==a){o=!1,t=h(e.parentNode,t,[],r);break}default:if(o=!1,N(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":i({html:a});break;case"object":if(N(a[0])&&(a=a.concat.apply([],a)),je(a[0])){Promise.all(a).then(i);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Ve.call(a.childNodes):[a],r):je(a)?a.then(i):"placeholder"in a?Ne(a,i):"text"in a?i(String(a.text)):"any"in a?i(a.any):"html"in a?t=h(e.parentNode,t,Ve.call(j([].concat(a.html).join(""),s).childNodes),r):i("length"in a?Ve.call(a):D.invoke(a,i))}var c}},text:function(e){var t;return function n(r){var s;t!==r&&("object"==(s=typeof(t=r))&&r?je(r)?r.then(n):"placeholder"in r?Ne(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Ve.call(r).join(""):D.invoke(r,n)):"function"==s?n(r(e)):e.textContent=null==r?"":r)}}}),Ze=function(t){var r,s,o,i,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),c=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||c?(s={},o=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return s[t]||(s[t]=e)},Ze=c?o:(i=new n,function(e){return i.get(e)||(n=o(t=e),i.set(t,n),n);var t,n})):Ke=!0,Je(t)};function Je(e){return Ke?e:Ze(e)}function Qe(e){for(var t=arguments.length,n=[Je(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Xe=new n,et=function(e){var t,n,r;return function(){var s=Qe.apply(null,arguments);return r!==s[0]?(r=s[0],n=new Ye(e),t=nt(n.apply(n,s))):n.apply(n,s),t}},tt=function(e,t){var n=t.indexOf(":"),r=Xe.get(e),s=t;return-1<n&&(s=t.slice(n+1),t=t.slice(0,n)||"html"),r||Xe.set(e,r={}),r[s]||(r[s]=et(t))},nt=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Le(t):e},rt=new n;function st(){var e=rt.get(this),t=Qe.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(We in this?"svg":"html");rt.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var ot,it,at,ct,lt=D.define,ut=Ye.prototype;function dt(e){return arguments.length<2?null==e?et("html"):"string"==typeof e?dt.wire(null,e):"raw"in e?et("html")(e):"nodeType"in e?dt.bind(e):tt(e,"html"):("raw"in e?et("html"):dt.wire).apply(null,arguments)}return dt.Component=v,dt.bind=function(e){return st.bind(e)},dt.define=lt,dt.diff=h,(dt.hyper=dt).observe=He,dt.tagger=ut,dt.wire=function(e,t){return null==e?et(t||"html"):tt(e,t||"html")},dt._={WeakMap:n,WeakSet:u},ot=et,it=new n,at=Object.create,ct=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,s){var o,i,a,c=t.get(e)||ct(e,t);switch(typeof s){case"object":case"function":var l=c.w||(c.w=new n);return l.get(s)||(o=l,i=s,a=new e(r),o.set(i,a),a);default:var u=c.p||(c.p=at(null));return u[s]||(u[s]=new e(r))}}(this,it.get(e)||(r=e,s=new w,it.set(r,s),s),e,null==t?"default":t);var r,s}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:$("html",ot),svg:$("svg",ot),state:$("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var s in r)n[s]=r[s];return!1!==t&&this.render(),this}}}),dt}(document);const bn=gn,yn=D,wn=dn,vn=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(e=e.trim(),!e)throw new TypeError("Invalid input.");let t="",n="",r="",s=null,o=new Map,i="type",a=Array.from(e);for(let e=0;e<a.length;e++){const c=a[e];switch(i){case"type":if("/"===c){i="subtype";continue}t+=c;break;case"subtype":if(";"===c){i="param-start";continue}n+=c;break;case"param-start":if(Xe.test(c)||";"===c)continue;r+=c,i="param-name";break;case"param-name":if("="===c||";"===c){if("="===c){i="param-value",s=null;continue}o.set(r.toLowerCase(),null),r="";continue}r+=c;break;case"param-value":if('"'==c){i="collect-quoted-string";continue}if(";"===c){s=s.trimEnd(),i="param-start",tt(o,r,s),r="";continue}s="string"==typeof s?s+c:c;break;case"collect-quoted-string":if('"'===c){tt(o,r,s),i="ignore-input-until-next-param",r="",s=null;continue}if("\\"===c)continue;s="string"==typeof s?s+c:c;break;case"ignore-input-until-next-param":if(";"!==c)continue;i="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${i} `)}}r&&tt(o,r,s);if(""===t.trim()||!Qe.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!Qe.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(o.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?Qe.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},$n=mn,kn=Je,xn=/-/g;const _n=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Sn="en"===l||l.startsWith("en-")?"en-AU":l,Cn=new Intl.DateTimeFormat(Sn,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Sn?"2-digit":"numeric"}),Rn=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function En(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function An(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Tn(e,t="long"){const n=new Intl.ListFormat(l,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:s})=>"element"===n&&t?t(s,r++,e):s))}}const Ln=Tn("conjunction"),Pn=Tn("disjunction");function In(e,t){return Ln(e,t).join("")}function Dn(e,t){return Pn(e,t).join("")}function Nn(e){return e.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/</g,"<")}function jn(e){return e.trim().replace(/\s+/g," ")}function On(e,t=l){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=Mn(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function Mn(e,t,n=l){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}function qn(e,t=""){return _n.format(e).replace(xn,t)}function zn(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){ir(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}async function Un(e,t=864e5){const n=new Request(e),r=new URL(n.url);let s,o;if("caches"in window)try{if(s=await caches.open(r.origin),o=await s.match(n),o&&new Date(o.headers.get("Expires"))>new Date)return o}catch(e){console.error("Failed to use Cache API.",e)}const i=await fetch(n);if(!i.ok&&o)return console.warn(`Returning a stale cached response for ${r}`),o;if(s&&i.ok){const e=i.clone(),r=new Headers(i.headers),o=new Date(Date.now()+t);r.set("Expires",o.toISOString());const a=new Response(await e.blob(),{headers:r});await s.put(n,a).catch(console.error)}return i}function Wn(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>bn`${e}, `));return bn`${r}${n[n.length-1]}`}function Fn(e,t){return[].concat(Ln(e,t)).map((e=>"string"==typeof e?bn`${e}`:e))}function Bn(e,t=""){const n=function(e){let t=0;for(const n of e)t=Math.imul(31,t)+n.charCodeAt(0)|0;return String(t)}(jn(e.textContent));return Hn(e,t,n)}function Hn(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let s=r?n:n.toLowerCase();if(s=s.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),s?!/\.$/.test(s)&&/^[a-z]/i.test(t||s)||(s=`x${s}`):s="generatedID",t&&(s=`${t}-${s}`),e.ownerDocument.getElementById(s)){let t=0,n=`${s}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${s}-${t}`;s=n}return e.id=s,s}function Gn(e){const t=new Set,n="ltNodefault"in e.dataset?"":jn(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>jn(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(jn(e))))}return[...t]}function Vn(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function Yn(e,t){const n=t.closest(Rn);let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function Kn(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Zn(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}function Jn(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function Qn(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class Xn extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function er(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{Vn(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),tr(t),t}function tr(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...nr(t)])e.remove()}function*nr(e){for(;e.nextNode();)yield e.currentNode}class rr extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class sr extends Error{constructor(e,t,n){super(e);const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||Hn(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:s,elements:o,title:i,details:a}=this;return{message:e,name:t,plugin:r,hint:s,elements:o,title:i,details:a,stack:n}}}function or(e,t,n={}){const r={...n,isWarning:!1};s("error",new sr(e,t,r))}function ir(e,t,n={}){const r={...n,isWarning:!0};s("warn",new sr(e,t,r))}function ar(e){return{showError:(t,n)=>or(t,e,n),showWarning:(t,n)=>ir(t,e,n)}}function cr(e){return e?`\`${e}\``:""}function lr(e,{quotes:t}={quotes:!1}){return Dn(e,t?e=>cr(dr(e)):cr)}function ur(e,{quotes:t}={quotes:!1}){return In(e,t?e=>cr(dr(e)):cr)}function dr(e){return String(e)?`"${e}"`:""}function pr(e,...t){return fr(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[s,o]=r.slice(1,-1).split("|");if(o){return`${e}[${s}](${new URL(o,"https://respec.org/docs/")})`}return`${e}[\`${s}\`](https://respec.org/docs/#${s})`})).join(""))}function fr(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter((e=>e.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}const hr=new Map([["text/html","html"],["application/xml","xml"]]);function mr(e,t=document){const n=hr.get(e);if(!n){const t=[...hr.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=gr(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function gr(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;tr(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),An(r);const o=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&o.appendChild(i);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=bn`<meta charset="utf-8" />`);o.appendChild(a);const c=`ReSpec ${window.respecVersion||"Developer Channel"}`,l=bn` - <meta name="generator" content="${c}" /> - `;o.appendChild(l),t.prepend(o),s("beforesave",r)}(n);let r="";if("xml"===e)r=(new XMLSerializer).serializeToString(n);else!function(e){e.querySelectorAll("style").forEach((e=>{e.innerHTML=`\n${e.innerHTML}\n`})),e.querySelectorAll("head > *").forEach((e=>{e.outerHTML=`\n${e.outerHTML}`}))}(n),n.doctype&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML;return r}n("core/exporter",{rsDocToDataURL:mr});class br{constructor(){this._respecDonePromise=new Promise((e=>{o("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],o("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),o("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return gr("html",document)}}const yr="core/post-process";const wr="core/pre-process";const vr="core/base-runner";async function $r(e){!function(){const e=new br;Object.defineProperty(document,"respec",{value:e})}(),s("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),o("amend-user-config",n),o("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of i)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)}))}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter((([e,t])=>!!e&&!!t)).map((([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let s;try{s=JSON.parse(r)}catch{s=r}return[n,s]})),r=Object.fromEntries(n);Object.assign(e,r),s("amend-user-config",r)}(respecConfig),performance.mark(`${vr}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||or("Every item in `preProcess` must be a JS function.",wr),t})).map((async(t,n)=>{const r=ar(`${wr}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){or(`Function ${t.name} threw an error during \`preProcess\`.`,wr,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}}(respecConfig);const t=e.filter((e=>{return(t=e)&&(t.run||t.Plugin);var t}));t.forEach((e=>!e.name&&console.warn("Plugin lacks name:",e))),await async function(e,t){for(const n of e.filter((e=>e.prepare)))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise((async(r,s)=>{const o=setTimeout((()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),s(new Error(t))}),15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){s(e)}finally{clearTimeout(o),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}}))}catch(e){console.error(e)}}}(t,respecConfig),s("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter((e=>{const t="function"==typeof e;return t||or("Every item in `postProcess` must be a JS function.",yr),t})).map((async(t,n)=>{const r=ar(`${yr}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){or(`Function ${t.name} threw an error during \`postProcess\`.`,yr,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),s("end-all"),An(document),performance.mark(`${vr}-end`),performance.measure(vr,`${vr}-start`,`${vr}-end`)}var kr=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} +window.respecVersion="35.2.0",function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=!!window.require;if(!t){const e=function(e,t){const n=e.map((e=>{if(!(e in window.require.modules))throw new Error(`Unsupported dependency name: ${e}`);return window.require.modules[e]}));Promise.all(n).then((e=>t(...e)))};e.modules={},window.require=e}function n(e,n){t||(window.require.modules[e]=n)}const r=document.documentElement;r?.hasAttribute("lang")||(r.lang="en",r.hasAttribute("dir")||(r.dir="ltr"));const s={},o=r?.lang??"en";var i=Object.freeze({__proto__:null,l10n:s,lang:o,name:"core/l10n",run:function(e){e.l10n=s[o]||s.en}});const a=(e,t)=>t.some((t=>e instanceof t));let c,l;const u=new WeakMap,d=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return b(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function h(e){f=e(f)}function m(e){return(l||(l=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(y(this),t),b(this.request)}:function(...t){return b(e.apply(y(this),t))}}function g(e){return"function"==typeof e?m(e):(e instanceof IDBTransaction&&function(e){if(u.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",o),e.removeEventListener("abort",o)},s=()=>{t(),r()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",s),e.addEventListener("error",o),e.addEventListener("abort",o)}));u.set(e,t)}(e),a(e,c||(c=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,f):e)}function b(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",s),e.removeEventListener("error",o)},s=()=>{t(b(e.result)),r()},o=()=>{n(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",o)}));return p.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=g(e);return t!==e&&(d.set(e,t),p.set(t,e)),t}const y=e=>p.get(e);const w=["get","getKey","getAll","getAllKeys","count"],v=["put","add","delete","clear"],$=new Map;function k(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if($.get(t))return $.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=v.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!s&&!w.includes(n))return;const o=async function(e,...t){const o=this.transaction(e,s?"readwrite":"readonly");let i=o.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),s&&o.done]))[0]};return $.set(t,o),o}h((e=>({...e,get:(t,n,r)=>k(t,n)||e.get(t,n,r),has:(t,n)=>!!k(t,n)||e.has(t,n)})));const x=["continue","continuePrimaryKey","advance"],_={},S=new WeakMap,C=new WeakMap,R={get(e,t){if(!x.includes(t))return e[t];let n=_[t];return n||(n=_[t]=function(...e){S.set(this,C.get(this)[t](...e))}),n}};async function*E(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,R);for(C.set(n,t),p.set(n,y(t));t;)yield n,t=await(S.get(n)||t.continue()),S.delete(n)}function A(e,t){return t===Symbol.asyncIterator&&a(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&a(e,[IDBIndex,IDBObjectStore])}h((e=>({...e,get:(t,n,r)=>A(t,n)?E:e.get(t,n,r),has:(t,n)=>A(t,n)||e.has(t,n)})));var T=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),b(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=b(i);return r&&i.addEventListener("upgradeneeded",(e=>{r(b(i.result),e.oldVersion,e.newVersion,b(i.transaction),e)})),n&&i.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{o&&e.addEventListener("close",(()=>o())),s&&e.addEventListener("versionchange",(e=>s(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:y,wrap:b});function L(e,t,n,r,s,{level:o="error",autofix:i,ruleName:a}={}){function c(n){return n>0?e.slice(t,t+n):e.slice(Math.max(t+n,0),t)}function l(n,{precedes:r}={}){const s=n.map((e=>e.trivia+e.value)).join(""),o=e[t];return"eof"===o.type?s:r?s+o.trivia:s.slice(o.trivia.length)}const u="eof"!==e[t].type?e[t].line:e.length>1?e[t-1].line:1,d=function(e){const t=e.split("\n");return t[t.length-1]}(l(c(-5),{precedes:!0})),p=c(5),f=l(p),h=d+f.split("\n")[0]+"\n"+(" ".repeat(d.length)+"^"),m="Syntax"===s?"since":"inside",g=`${s} error at line ${u}${e.name?` in ${e.name}`:""}${n&&n.name?`, ${m} \`${n.partial?"partial ":""}${function(e){const t=[e];for(;e&&e.parent;){const{parent:n}=e;t.unshift(n),e=n}return t.map((e=>function(e,t){let n=e;return t&&(n+=` ${t}`),n}(e.type,e.name))).join(" -> ")}(n)}\``:""}:\n${h}`;return{message:`${g} ${r}`,bareMessage:r,context:g,line:u,sourceName:e.name,level:o,ruleName:a,autofix:i,input:f,tokens:p}}function P(e,t,n,r){return L(e,t,n,r,"Syntax")}function I(e,t,n,r,s={}){return s.ruleName=n,L(t.source,e.index,t,r,"Validation",s)}class D{constructor({source:e,tokens:t}){Object.defineProperties(this,{source:{value:e},tokens:{value:t,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){const e={type:void 0,name:void 0,inheritance:void 0};let t=this;for(;t!==Object.prototype;){const n=Object.getOwnPropertyDescriptors(t);for(const[t,r]of Object.entries(n))(r.enumerable||r.get)&&(e[t]=this[t]);t=Object.getPrototypeOf(t)}return e}}function N(e,t,{useNullableInner:n}={}){if(!e.union){const r=t.unique.get(e.idlType);if(!r)return;if("typedef"===r.type){const{typedefIncludesDictionary:n}=t.cache;if(n.has(r))return n.get(r);t.cache.typedefIncludesDictionary.set(r,void 0);const s=N(r.idlType,t);if(t.cache.typedefIncludesDictionary.set(r,s),s)return{reference:e,dictionary:s.dictionary}}if("dictionary"===r.type&&(n||!e.nullable))return{reference:e,dictionary:r}}for(const n of e.subtype){const e=N(n,t);if(e)return n.union?e:{reference:n,dictionary:e.dictionary}}}function j(e,t){if(t.cache.dictionaryIncludesRequiredField.has(e))return t.cache.dictionaryIncludesRequiredField.get(e);t.cache.dictionaryIncludesRequiredField.set(e,void 0);let n=e.members.some((e=>e.required));if(!n&&e.inheritance){const r=t.unique.get(e.inheritance);r?j(r,t)&&(n=!0):n=!0}return t.cache.dictionaryIncludesRequiredField.set(e,n),n}class O extends Array{constructor({source:e,tokens:t}){super(),Object.defineProperties(this,{source:{value:e},tokens:{value:t},parent:{value:null,writable:!0}})}}class M extends D{static parser(e,t){return()=>{const n=e.consumeKind(t);if(n)return new M({source:e.source,tokens:{value:n}})}}get value(){return ne(this.tokens.value.value)}write(e){return e.ts.wrap([e.token(this.tokens.value),e.token(this.tokens.separator)])}}class q extends M{static parse(e){const t=e.consumeKind("eof");if(t)return new q({source:e.source,tokens:{value:t}})}get type(){return"eof"}}function z(e,t){return re(e,{parser:M.parser(e,t),listName:t+" list"})}const U=["identifier","decimal","integer","string"],W=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((e=>[e,`Legacy${e}`])),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function F(e){for(const t of U){const n=z(e,t);if(n.length)return n}e.error("Expected identifiers, strings, decimals, or integers but none found")}class B extends D{static parse(e){const t={assign:e.consume("=")},n=he(new B({source:e.source,tokens:t}));if(n.list=[],t.assign){if(t.asterisk=e.consume("*"),t.asterisk)return n.this;t.secondaryName=e.consumeKind(...U)}return t.open=e.consume("("),t.open?(n.list=n.rhsIsList?F(e):ae(e),t.close=e.consume(")")||e.error("Unexpected token in extended attribute argument list")):t.assign&&!t.secondaryName&&e.error("No right hand side to extended attribute assignment"),n.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(e){const{rhsType:t}=this;return e.ts.wrap([e.token(this.tokens.assign),e.token(this.tokens.asterisk),e.reference_token(this.tokens.secondaryName,this.parent),e.token(this.tokens.open),...this.list.map((n=>"identifier-list"===t?e.identifier(n,this.parent):n.write(e))),e.token(this.tokens.close)])}}class H extends D{static parse(e){const t=e.consumeKind("identifier");if(t)return new H({source:e.source,tokens:{name:t},params:B.parse(e)})}constructor({source:e,tokens:t,params:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"params",{value:n})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){const{rhsType:e,tokens:t,list:n}=this.params;if(!e)return null;return{type:e,value:this.params.rhsIsList?n:this.params.tokens.secondaryName?ne(t.secondaryName.value):null}}get arguments(){const{rhsIsList:e,list:t}=this.params;return!t||e?[]:t}*validate(e){const{name:t}=this;if("LegacyNoInterfaceObject"===t){const e="`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.";yield I(this.tokens.name,this,"no-nointerfaceobject",e,{level:"warning"})}else if(W.has(t)){const e=`\`[${t}]\` extended attribute is a legacy feature that is now renamed to \`[${W.get(t)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield I(this.tokens.name,this,"renamed-legacy",e,{level:"warning",autofix:(n=this,()=>{const{name:e}=n;n.tokens.name.value=W.get(e),"TreatNullAs"===e&&(n.params.tokens={})})})}var n;for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.wrap([e.ts.trivia(this.tokens.name.trivia),e.ts.extendedAttribute(e.ts.wrap([e.ts.extendedAttributeReference(this.name),this.params.write(e)])),e.token(this.tokens.separator)])}}class G extends O{static parse(e){const t={};t.open=e.consume("[");const n=new G({source:e.source,tokens:t});return t.open?(n.push(...re(e,{parser:H.parse,listName:"extended attribute"})),t.close=e.consume("]")||e.error("Expected a closing token for the extended attribute list"),n.length||(e.unconsume(t.close.index),e.error("An extended attribute list must not be empty")),e.probe("[")&&e.error("Illegal double extended attribute lists, consider merging them"),n):n}*validate(e){for(const t of this)yield*t.validate(e)}write(e){return this.length?e.ts.wrap([e.token(this.tokens.open),...this.map((t=>t.write(e))),e.token(this.tokens.close)]):""}}function V(e,t){const n=e.consume("?");n&&(t.tokens.nullable=n),e.probe("?")&&e.error("Can't nullable more than once")}function Y(e,t){let n=function(e,t){const n=e.consume("FrozenArray","ObservableArray","Promise","sequence","record");if(!n)return;const r=he(new K({source:e.source,tokens:{base:n}}));switch(r.tokens.open=e.consume("<")||e.error(`No opening bracket after ${n.value}`),n.value){case"Promise":{e.probe("[")&&e.error("Promise type cannot have extended attribute");const n=le(e,t)||e.error("Missing Promise subtype");r.subtype.push(n);break}case"sequence":case"FrozenArray":case"ObservableArray":{const s=ce(e,t)||e.error(`Missing ${n.value} subtype`);r.subtype.push(s);break}case"record":{e.probe("[")&&e.error("Record key cannot have extended attribute");const n=e.consume(...be)||e.error(`Record key must be one of: ${be.join(", ")}`),s=new K({source:e.source,tokens:{base:n}});s.tokens.separator=e.consume(",")||e.error("Missing comma after record key type"),s.type=t;const o=ce(e,t)||e.error("Error parsing generic type record");r.subtype.push(s,o);break}}return r.idlType||e.error(`Error parsing generic type ${n.value}`),r.tokens.close=e.consume(">")||e.error(`Missing closing bracket after ${n.value}`),r.this}(e,t)||ie(e);if(!n){const t=e.consumeKind("identifier")||e.consume(...be,...ge);if(!t)return;n=new K({source:e.source,tokens:{base:t}}),e.probe("<")&&e.error(`Unsupported generic type ${t.value}`)}return"Promise"===n.generic&&e.probe("?")&&e.error("Promise type cannot be nullable"),n.type=t||null,V(e,n),n.nullable&&"any"===n.idlType&&e.error("Type `any` cannot be made nullable"),n}class K extends D{static parse(e,t){return Y(e,t)||function(e,t){const n={};if(n.open=e.consume("("),!n.open)return;const r=he(new K({source:e.source,tokens:n}));for(r.type=t||null;;){const n=ce(e,t)||e.error("No type after open parenthesis or 'or' in union type");"any"===n.idlType&&e.error("Type `any` cannot be included in a union type"),"Promise"===n.generic&&e.error("Type `Promise` cannot be included in a union type"),r.subtype.push(n);const s=e.consume("or");if(!s)break;n.tokens.separator=s}return r.idlType.length<2&&e.error("At least two types are expected in a union type but found less"),n.close=e.consume(")")||e.error("Unterminated union type"),V(e,r),r.this}(e,t)}constructor({source:e,tokens:t}){super({source:e,tokens:t}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new G({source:e,tokens:{}})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return ne([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter((e=>e)).map((e=>e.value)).join(" "))}*validate(e){if(yield*this.extAttrs.validate(e),"BufferSource"===this.idlType)for(const e of[this.extAttrs,this.parent?.extAttrs])for(const t of e){if("AllowShared"!==t.name)continue;const n="`[AllowShared] BufferSource` is now replaced with AllowSharedBufferSource.";yield I(this.tokens.base,this,"migrate-allowshared",n,{autofix:Z(this,t,e)})}if("void"===this.idlType){const e="`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.";yield I(this.tokens.base,this,"replace-void",e,{autofix:(t=this,()=>{t.tokens.base.value="undefined"})})}var t;const n=!this.union&&e.unique.get(this.idlType),r=this.union?this:n&&"typedef"===n.type?n.idlType:void 0;if(r&&this.nullable){const{reference:t}=N(r,e)||{};if(t){const e=(this.union?t:this).tokens.base,n="Nullable union cannot include a dictionary type.";yield I(e,this,"no-nullable-union-dict",n)}}else for(const t of this.subtype)yield*t.validate(e)}write(e){return e.ts.wrap([this.extAttrs.write(e),(()=>{if(this.union||this.generic)return e.ts.wrap([e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),...this.subtype.map((t=>t.write(e))),e.token(this.tokens.close)]);const t=this.tokens.prefix||this.tokens.base,n=this.tokens.prefix?[this.tokens.prefix.value,e.ts.trivia(this.tokens.base.trivia)]:[],r=e.reference(e.ts.wrap([...n,this.tokens.base.value,e.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return e.ts.wrap([e.ts.trivia(t.trivia),r])})(),e.token(this.tokens.nullable),e.token(this.tokens.separator)])}}function Z(e,t,n){return()=>{const r=n.indexOf(t);n.splice(r,1),!n.length&&e.tokens.base.trivia.match(/^\s$/)&&(e.tokens.base.trivia=""),e.tokens.base.value="AllowSharedBufferSource"}}class J extends D{static parse(e){const t=e.consume("=");if(!t)return null;const n=se(e)||e.consumeKind("string")||e.consume("null","[","{")||e.error("No value for default"),r=[n];if("["===n.value){const t=e.consume("]")||e.error("Default sequence value must be empty");r.push(t)}else if("{"===n.value){const t=e.consume("}")||e.error("Default dictionary value must be empty");r.push(t)}return new J({source:e.source,tokens:{assign:t},expression:r})}constructor({source:e,tokens:t,expression:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"expression",{value:n})}get type(){return oe(this.expression[0]).type}get value(){return oe(this.expression[0]).value}get negative(){return oe(this.expression[0]).negative}write(e){return e.ts.wrap([e.token(this.tokens.assign),...this.expression.map((t=>e.token(t)))])}}class Q extends D{static parse(e){const t=e.position,n={},r=he(new Q({source:e.source,tokens:n}));return r.extAttrs=G.parse(e),n.optional=e.consume("optional"),r.idlType=ce(e,"argument-type"),r.idlType?(n.optional||(n.variadic=e.consume("...")),n.name=e.consumeKind("identifier")||e.consume(...ye),n.name?(r.default=n.optional?J.parse(e):null,r.this):e.unconsume(t)):e.unconsume(t)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return ne(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e);const t=N(this.idlType,e,{useNullableInner:!0});if(t)if(this.idlType.nullable){const e="Dictionary arguments cannot be nullable.";yield I(this.tokens.name,this,"no-nullable-dict-arg",e)}else if(this.optional){if(!this.default){const e="Optional dictionary arguments must have a default value of `{}`.";yield I(this.tokens.name,this,"dict-arg-default",e,{autofix:X(this)})}}else if(this.parent&&!j(t.dictionary,e)&&function(e){const t=e.parent.arguments||e.parent.list,n=t.indexOf(e),r=t.slice(n+1).some((e=>!e.optional));return!r}(this)){const e="Dictionary argument must be optional if it has no required fields";yield I(this.tokens.name,this,"dict-arg-optional",e,{autofix:(n=this,()=>{const e=fe(n.idlType);n.tokens.optional={...e,type:"optional",value:"optional"},e.trivia=" ",X(n)()})})}var n}write(e){return e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.optional),e.ts.type(this.idlType.write(e)),e.token(this.tokens.variadic),e.name_token(this.tokens.name,{data:this}),this.default?this.default.write(e):"",e.token(this.tokens.separator)])}}function X(e){return()=>{e.default=J.parse(new ke(" = {}"))}}class ee extends D{static parse(e,{special:t,regular:n}={}){const r={special:t},s=he(new ee({source:e.source,tokens:r}));return t&&"stringifier"===t.value&&(r.termination=e.consume(";"),r.termination)?(s.arguments=[],s):(t||n||(r.special=e.consume("getter","setter","deleter")),s.idlType=le(e)||e.error("Missing return type"),r.name=e.consumeKind("identifier")||e.consume("includes"),r.open=e.consume("(")||e.error("Invalid operation"),s.arguments=ae(e),r.close=e.consume(")")||e.error("Unterminated operation"),r.termination=e.consume(";")||e.error("Unterminated operation, expected `;`"),s.this)}get type(){return"operation"}get name(){const{name:e}=this.tokens;return e?ne(e.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(e){if(yield*this.extAttrs.validate(e),!this.name&&["","static"].includes(this.special)){const e="Regular or static operations must have both a return type and an identifier.";yield I(this.tokens.open,this,"incomplete-op",e)}this.idlType&&(yield*this.idlType.validate(e));for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this,n=this.idlType?[e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map((t=>t.write(e)))),e.token(this.tokens.close)]:[];return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),this.tokens.name?e.token(this.tokens.special):e.token(this.tokens.special,e.ts.nameless,{data:this,parent:t}),...n,e.token(this.tokens.termination)]),{data:this,parent:t})}}class te extends D{static parse(e,{special:t,noInherit:n=!1,readonly:r=!1}={}){const s=e.position,o={special:t},i=he(new te({source:e.source,tokens:o}));if(t||n||(o.special=e.consume("inherit")),"inherit"===i.special&&e.probe("readonly")&&e.error("Inherited attributes cannot be read-only"),o.readonly=e.consume("readonly"),r&&!o.readonly&&e.probe("attribute")&&e.error("Attributes must be readonly in this context"),o.base=e.consume("attribute"),o.base)return i.idlType=ce(e,"attribute-type")||e.error("Attribute lacks a type"),o.name=e.consumeKind("identifier")||e.consume("async","required")||e.error("Attribute lacks a name"),o.termination=e.consume(";")||e.error("Unterminated attribute, expected `;`"),i.this;e.unconsume(s)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return ne(this.tokens.name.value)}*validate(e){if(yield*this.extAttrs.validate(e),yield*this.idlType.validate(e),["sequence","record"].includes(this.idlType.generic)){const e=`Attributes cannot accept ${this.idlType.generic} types.`;yield I(this.tokens.name,this,"attr-invalid-type",e)}{const{reference:t}=N(this.idlType,e)||{};if(t){const e=(this.idlType.union?t:this.idlType).tokens.base,n="Attributes cannot accept dictionary types.";yield I(e,this,"attr-invalid-type",n)}}if(this.readonly&&function(e,t){if(e.union)return!1;if(e.extAttrs.some((e=>"EnforceRange"===e.name)))return!0;const n=t.unique.get(e.idlType);return"typedef"===n?.type&&n.idlType.extAttrs.some((e=>"EnforceRange"===e.name))}(this.idlType,e)){const e=this.idlType.tokens.base,t="Readonly attributes cannot accept [EnforceRange] extended attribute.";yield I(e,this,"attr-invalid-type",t)}}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.special),e.token(this.tokens.readonly),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.termination)]),{data:this,parent:t})}}function ne(e){return e.startsWith("_")?e.slice(1):e}function re(e,{parser:t,allowDangler:n,listName:r="list"}){const s=t(e);if(!s)return[];s.tokens.separator=e.consume(",");const o=[s];for(;s.tokens.separator;){const s=t(e);if(!s){n||e.error(`Trailing comma in ${r}`);break}if(s.tokens.separator=e.consume(","),o.push(s),!s.tokens.separator)break}return o}function se(e){return e.consumeKind("decimal","integer")||e.consume("true","false","Infinity","-Infinity","NaN")}function oe({type:e,value:t}){switch(e){case"decimal":case"integer":return{type:"number",value:t};case"string":return{type:"string",value:t.slice(1,-1)}}switch(t){case"true":case"false":return{type:"boolean",value:"true"===t};case"Infinity":case"-Infinity":return{type:"Infinity",negative:t.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:t}}}function ie(e){const{source:t}=e,n=function(){const n=e.consume("unsigned"),r=e.consume("short","long");if(r){const s=e.consume("long");return new K({source:t,tokens:{prefix:n,base:r,postfix:s}})}n&&e.error("Failed to parse integer type")}()||function(){const n=e.consume("unrestricted"),r=e.consume("float","double");if(r)return new K({source:t,tokens:{prefix:n,base:r}});n&&e.error("Failed to parse float type")}();if(n)return n;const r=e.consume("bigint","boolean","byte","octet","undefined");return r?new K({source:t,tokens:{base:r}}):void 0}function ae(e){return re(e,{parser:Q.parse,listName:"arguments list"})}function ce(e,t){const n=G.parse(e),r=K.parse(e,t);return r&&(he(r).extAttrs=n),r}function le(e,t){const n=K.parse(e,t||"return-type");if(n)return n;const r=e.consume("void");if(r){const t=new K({source:e.source,tokens:{base:r}});return t.type="return-type",t}}function ue(e){const t=e.consume("stringifier");if(!t)return;return te.parse(e,{special:t})||ee.parse(e,{special:t})||e.error("Unterminated stringifier")}function de(e){const t=e.split("\n");if(t.length){const e=t[t.length-1].match(/^\s+/);if(e)return e[0]}return""}function pe(e){return()=>{if(e.extAttrs.length){const t=new ke("Exposed=Window,"),n=H.parse(t);n.tokens.separator=t.consume(",");const r=e.extAttrs[0];/^\s/.test(r.tokens.name.trivia)||(r.tokens.name.trivia=` ${r.tokens.name.trivia}`),e.extAttrs.unshift(n)}else{he(e).extAttrs=G.parse(new ke("[Exposed=Window]"));const t=e.tokens.base.trivia;e.extAttrs.tokens.open.trivia=t,e.tokens.base.trivia=`\n${de(t)}`}}}function fe(e){if(e.extAttrs.length)return e.extAttrs.tokens.open;if("operation"===e.type&&!e.special)return fe(e.idlType);return Object.values(e.tokens).sort(((e,t)=>e.index-t.index))[0]}function he(e,t){if(t||(t=e),!e)return e;return new Proxy(e,{get(e,t){const n=e[t];return Array.isArray(n)&&"source"!==t?he(n,e):n},set(e,n,r){if(e[n]=r,!r)return!0;if(Array.isArray(r))for(const e of r)void 0!==e.parent&&(e.parent=t);else void 0!==r.parent&&(r.parent=t);return!0}})}const me={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},ge=["ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float32Array","Float64Array","any","object","symbol"],be=["ByteString","DOMString","USVString"],ye=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],we=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(ye,be,ge),ve=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],$e=["_constructor","toString","_toString"];class ke{constructor(e){this.source=function(e){const t=[];let n=0,r="",s=1,o=0;for(;n<e.length;){const a=e.charAt(n);let c=-1;if(/[\t\n\r ]/.test(a)?c=i("whitespace",{noFlushTrivia:!0}):"/"===a&&(c=i("comment",{noFlushTrivia:!0})),-1!==c){const e=t.pop().value;s+=(e.match(/\n/g)||[]).length,r+=e,o-=1}else if(/[-0-9.A-Z_a-z]/.test(a)){if(c=i("decimal"),-1===c&&(c=i("integer")),-1===c){c=i("identifier");const e=t.length-1,n=t[e];if(-1!==c){if($e.includes(n.value)){const r=`${ne(n.value)} is a reserved identifier and must not be used.`;throw new xe(P(t,e,null,r))}we.includes(n.value)&&(n.type="inline")}}}else'"'===a&&(c=i("string"));for(const i of ve)if(e.startsWith(i,n)){t.push({type:"inline",value:i,trivia:r,line:s,index:o}),r="",n+=i.length,c=n;break}if(-1===c&&(c=i("other")),-1===c)throw new Error("Token stream not progressing");n=c,o+=1}return t.push({type:"eof",value:"",trivia:r,line:s,index:o}),t;function i(i,{noFlushTrivia:a}={}){const c=me[i];c.lastIndex=n;const l=c.exec(e);return l?(t.push({type:i,value:l[0],trivia:r,line:s,index:o}),a||(r=""),c.lastIndex):-1}}(e),this.position=0}error(e){throw new xe(P(this.source,this.position,this.current,e))}probeKind(e){return this.source.length>this.position&&this.source[this.position].type===e}probe(e){return this.probeKind("inline")&&this.source[this.position].value===e}consumeKind(...e){for(const t of e){if(!this.probeKind(t))continue;const e=this.source[this.position];return this.position++,e}}consume(...e){if(!this.probeKind("inline"))return;const t=this.source[this.position];for(const n of e)if(t.value===n)return this.position++,t}consumeIdentifier(e){if(this.probeKind("identifier")&&this.source[this.position].value===e)return this.consumeKind("identifier")}unconsume(e){this.position=e}}class xe extends Error{constructor({message:e,bareMessage:t,context:n,line:r,sourceName:s,input:o,tokens:i}){super(e),this.name="WebIDLParseError",this.bareMessage=t,this.context=n,this.line=r,this.sourceName=s,this.input=o,this.tokens=i}}class _e extends M{static parse(e){const t=e.consumeKind("string");if(t)return new _e({source:e.source,tokens:{value:t}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(e){const{parent:t}=this;return e.ts.wrap([e.ts.trivia(this.tokens.value.trivia),e.ts.definition(e.ts.wrap(['"',e.ts.name(this.value,{data:this,parent:t}),'"']),{data:this,parent:t}),e.token(this.tokens.separator)])}}class Se extends D{static parse(e){const t={};if(t.base=e.consume("enum"),!t.base)return;t.name=e.consumeKind("identifier")||e.error("No name for enum");const n=he(new Se({source:e.source,tokens:t}));return e.current=n.this,t.open=e.consume("{")||e.error("Bodyless enum"),n.values=re(e,{parser:_e.parse,allowDangler:!0,listName:"enumeration"}),e.probeKind("string")&&e.error("No comma between enum values"),t.close=e.consume("}")||e.error("Unexpected value in enum"),n.values.length||e.error("No value in enum"),t.termination=e.consume(";")||e.error("No semicolon after enum"),n.this}get type(){return"enum"}get name(){return ne(this.tokens.name.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.open),e.ts.wrap(this.values.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Ce extends D{static parse(e){const t=e.consumeKind("identifier");if(!t)return;const n={target:t};if(n.includes=e.consume("includes"),n.includes)return n.mixin=e.consumeKind("identifier")||e.error("Incomplete includes statement"),n.termination=e.consume(";")||e.error("No terminating ; for includes statement"),new Ce({source:e.source,tokens:n});e.unconsume(t.index)}get type(){return"includes"}get target(){return ne(this.tokens.target.value)}get includes(){return ne(this.tokens.mixin.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.reference_token(this.tokens.target,this),e.token(this.tokens.includes),e.reference_token(this.tokens.mixin,this),e.token(this.tokens.termination)]),{data:this})}}class Re extends D{static parse(e){const t={},n=he(new Re({source:e.source,tokens:t}));if(t.base=e.consume("typedef"),t.base)return n.idlType=ce(e,"typedef-type")||e.error("Typedef lacks a type"),t.name=e.consumeKind("identifier")||e.error("Typedef lacks a name"),e.current=n.this,t.termination=e.consume(";")||e.error("Unterminated typedef, expected `;`"),n.this}get type(){return"typedef"}get name(){return ne(this.tokens.name.value)}*validate(e){yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.termination)]),{data:this})}}class Ee extends D{static parse(e,t){const n={base:t},r=he(new Ee({source:e.source,tokens:n}));return n.name=e.consumeKind("identifier")||e.error("Callback lacks a name"),e.current=r.this,n.assign=e.consume("=")||e.error("Callback lacks an assignment"),r.idlType=le(e)||e.error("Callback lacks a return type"),n.open=e.consume("(")||e.error("Callback lacks parentheses for arguments"),r.arguments=ae(e),n.close=e.consume(")")||e.error("Unterminated callback"),n.termination=e.consume(";")||e.error("Unterminated callback, expected `;`"),r.this}get type(){return"callback"}get name(){return ne(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.assign),e.ts.type(this.idlType.write(e)),e.token(this.tokens.open),...this.arguments.map((t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Ae extends D{static parse(e,t,{inheritable:n,allowedMembers:r}){const{tokens:s,type:o}=t;for(s.name=e.consumeKind("identifier")||e.error(`Missing name in ${o}`),e.current=t,t=he(t),n&&Object.assign(s,function(e){const t=e.consume(":");return t?{colon:t,inheritance:e.consumeKind("identifier")||e.error("Inheritance lacks a type")}:{}}(e)),s.open=e.consume("{")||e.error(`Bodyless ${o}`),t.members=[];;){if(s.close=e.consume("}"),s.close)return s.termination=e.consume(";")||e.error(`Missing semicolon after ${o}`),t.this;const n=G.parse(e);let i;for(const[t,...n]of r)if(i=he(t(e,...n)),i)break;i||e.error("Unknown member"),i.extAttrs=n,t.members.push(i.this)}}get partial(){return!!this.tokens.partial}get name(){return ne(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?ne(this.tokens.inheritance.value):null}*validate(e){for(const t of this.members)t.validate&&(yield*t.validate(e))}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.callback),e.token(this.tokens.partial),e.token(this.tokens.base),e.token(this.tokens.mixin),e.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?e.ts.wrap([e.token(this.tokens.colon),e.ts.trivia(this.tokens.inheritance.trivia),e.ts.inheritance(e.reference(this.tokens.inheritance.value,{context:this}))]):"")(),e.token(this.tokens.open),e.ts.wrap(this.members.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Te extends D{static parse(e){const t={};if(t.base=e.consume("const"),!t.base)return;let n=ie(e);if(!n){const t=e.consumeKind("identifier")||e.error("Const lacks a type");n=new K({source:e.source,tokens:{base:t}})}e.probe("?")&&e.error("Unexpected nullable constant type"),n.type="const-type",t.name=e.consumeKind("identifier")||e.error("Const lacks a name"),t.assign=e.consume("=")||e.error("Const lacks value assignment"),t.value=se(e)||e.error("Const lacks a value"),t.termination=e.consume(";")||e.error("Unterminated const, expected `;`");const r=new Te({source:e.source,tokens:t});return he(r).idlType=n,r}get type(){return"const"}get name(){return ne(this.tokens.name.value)}get value(){return oe(this.tokens.value)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.assign),e.token(this.tokens.value),e.token(this.tokens.termination)]),{data:this,parent:t})}}class Le extends D{static parse(e){const t=e.position,n=he(new Le({source:e.source,tokens:{}})),{tokens:r}=n;if(r.readonly=e.consume("readonly"),r.readonly||(r.async=e.consume("async")),r.base=r.readonly?e.consume("maplike","setlike"):r.async?e.consume("iterable"):e.consume("iterable","maplike","setlike"),!r.base)return void e.unconsume(t);const{type:s}=n,o="maplike"===s,i=o||"iterable"===s,a=n.async&&"iterable"===s;r.open=e.consume("<")||e.error(`Missing less-than sign \`<\` in ${s} declaration`);const c=ce(e)||e.error(`Missing a type argument in ${s} declaration`);return n.idlType=[c],n.arguments=[],i&&(c.tokens.separator=e.consume(","),c.tokens.separator?n.idlType.push(ce(e)):o&&e.error(`Missing second type argument in ${s} declaration`)),r.close=e.consume(">")||e.error(`Missing greater-than sign \`>\` in ${s} declaration`),e.probe("(")&&(a?(r.argsOpen=e.consume("("),n.arguments.push(...ae(e)),r.argsClose=e.consume(")")||e.error("Unterminated async iterable argument list")):e.error("Arguments are only allowed for `async iterable`")),r.termination=e.consume(";")||e.error(`Missing semicolon after ${s} declaration`),n.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(e){for(const t of this.idlType)yield*t.validate(e);for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.readonly),e.token(this.tokens.async),e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),e.ts.wrap(this.idlType.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.argsOpen),e.ts.wrap(this.arguments.map((t=>t.write(e)))),e.token(this.tokens.argsClose),e.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class Pe extends D{static parse(e){const t=e.consume("constructor");if(!t)return;const n={base:t};n.open=e.consume("(")||e.error("No argument list in constructor");const r=ae(e);n.close=e.consume(")")||e.error("Unterminated constructor"),n.termination=e.consume(";")||e.error("No semicolon after constructor");const s=new Pe({source:e.source,tokens:n});return he(s).arguments=r,s}get type(){return"constructor"}*validate(e){for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base,e.ts.nameless,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map((t=>t.write(e)))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this,parent:t})}}function Ie(e){const t=e.consume("static");if(!t)return;return te.parse(e,{special:t})||ee.parse(e,{special:t})||e.error("No body in static member")}class De extends Ae{static parse(e,t,{extMembers:n=[],partial:r=null}={}){const s={partial:r,base:t};return Ae.parse(e,new De({source:e.source,tokens:s}),{inheritable:!r,allowedMembers:[...n,[Te.parse],[Pe.parse],[Ie],[ue],[Le.parse],[te.parse],[ee.parse]]})}get type(){return"interface"}*validate(e){if(yield*this.extAttrs.validate(e),!this.partial&&this.extAttrs.every((e=>"Exposed"!==e.name))){const e="Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield I(this.tokens.name,this,"require-exposed",e,{autofix:pe(this)})}const t=this.extAttrs.filter((e=>"Constructor"===e.name));for(const e of t){const t="Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.";yield I(e.tokens.name,this,"constructor-member",t,{autofix:Ne(this,e)})}if(this.extAttrs.some((e=>"Global"===e.name))){const e=this.extAttrs.filter((e=>"LegacyFactoryFunction"===e.name));for(const t of e){const e="Interfaces marked as `[Global]` cannot have factory functions.";yield I(t.tokens.name,this,"no-constructible-global",e)}const t=this.members.filter((e=>"constructor"===e.type));for(const e of t){const t="Interfaces marked as `[Global]` cannot have constructors.";yield I(e.tokens.base,this,"no-constructible-global",t)}}yield*super.validate(e),this.partial||(yield*function*(e,t){const n=function(e){const t=i(e);return{statics:new Set(t.filter((e=>"static"===e.special)).map((e=>e.name))),nonstatics:new Set(t.filter((e=>"static"!==e.special)).map((e=>e.name)))}}(t),r=e.partials.get(t.name)||[],s=e.mixinMap.get(t.name)||[];for(const e of[...r,...s]){const r=i(e),s=r.filter((e=>"static"===e.special)),a=r.filter((e=>"static"!==e.special));yield*o(s,n.statics,e,t),yield*o(a,n.nonstatics,e,t),s.forEach((e=>n.statics.add(e.name))),a.forEach((e=>n.nonstatics.add(e.name)))}function*o(e,t,n,r){for(const s of e){const{name:e}=s;if(e&&t.has(e)){const t=`The ${"static"===s.special?"static ":""}operation "${e}" has already been defined for the base interface "${r.name}" either in itself or in a mixin`;yield I(s.tokens.name,n,"no-cross-overload",t)}}}function i(e){return e.members.filter((({type:e})=>"operation"===e))}}(e,this))}}function Ne(e,t){return e=he(e),()=>{const n=de(e.extAttrs.tokens.open.trivia),r=e.members.length?de(fe(e.members[0]).trivia):function(e){const t=de(e),n=t.includes("\t")?"\t":" ";return t+n}(n),s=Pe.parse(new ke(`\n${r}constructor();`));s.extAttrs=new G({source:e.source,tokens:{}}),he(s).arguments=t.arguments;const o=function(e,t){const n=e.slice().reverse().findIndex(t);return-1===n?n:e.length-n-1}(e.members,(e=>"constructor"===e.type));e.members.splice(o+1,0,s);const{close:i}=e.tokens;i.trivia.includes("\n")||(i.trivia+=`\n${n}`);const{extAttrs:a}=e,c=a.indexOf(t),l=a.splice(c,1);a.length?a.length===c?a[c-1].tokens.separator=void 0:a[c].tokens.name.trivia.trim()||(a[c].tokens.name.trivia=l[0].tokens.name.trivia):a.tokens.open=a.tokens.close=void 0}}class je extends Ae{static parse(e,t,{extMembers:n=[],partial:r}={}){const s={partial:r,base:t};if(s.mixin=e.consume("mixin"),s.mixin)return Ae.parse(e,new je({source:e.source,tokens:s}),{allowedMembers:[...n,[Te.parse],[ue],[te.parse,{noInherit:!0}],[ee.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class Oe extends D{static parse(e){const t={},n=he(new Oe({source:e.source,tokens:t}));return n.extAttrs=G.parse(e),t.required=e.consume("required"),n.idlType=ce(e,"dictionary-type")||e.error("Dictionary member lacks a type"),t.name=e.consumeKind("identifier")||e.error("Dictionary member lacks a name"),n.default=J.parse(e),t.required&&n.default&&e.error("Required member must not have a default"),t.termination=e.consume(";")||e.error("Unterminated dictionary member, expected `;`"),n.this}get type(){return"field"}get name(){return ne(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(e){yield*this.idlType.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.required),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),this.default?this.default.write(e):"",e.token(this.tokens.termination)]),{data:this,parent:t})}}class Me extends Ae{static parse(e,{extMembers:t=[],partial:n}={}){const r={partial:n};if(r.base=e.consume("dictionary"),r.base)return Ae.parse(e,new Me({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[...t,[Oe.parse]]})}get type(){return"dictionary"}}class qe extends Ae{static parse(e,{extMembers:t=[],partial:n}={}){const r={partial:n};if(r.base=e.consume("namespace"),r.base)return Ae.parse(e,new qe({source:e.source,tokens:r}),{allowedMembers:[...t,[te.parse,{noInherit:!0,readonly:!0}],[Te.parse],[ee.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(e){if(!this.partial&&this.extAttrs.every((e=>"Exposed"!==e.name))){const e="Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield I(this.tokens.name,this,"require-exposed",e,{autofix:pe(this)})}yield*super.validate(e)}}class ze extends Ae{static parse(e,t,{extMembers:n=[]}={}){const r={callback:t};if(r.base=e.consume("interface"),r.base)return Ae.parse(e,new ze({source:e.source,tokens:r}),{allowedMembers:[...n,[Te.parse],[ee.parse,{regular:!0}]]})}get type(){return"callback interface"}}function Ue(e,t){const n=e.source;function r(t){e.error(t)}function s(...t){return e.consume(...t)}function o(n){const o=s("interface");if(o)return je.parse(e,o,{...n,...t?.extensions?.mixin})||De.parse(e,o,{...n,...t?.extensions?.interface})||r("Interface has no proper body")}function i(){if(t.productions)for(const n of t.productions){const t=n(e);if(t)return t}return function(){const n=s("callback");if(n)return e.probe("interface")?ze.parse(e,n,{...t?.extensions?.callbackInterface}):Ee.parse(e,n)}()||o()||function(){const n=s("partial");if(n)return Me.parse(e,{partial:n,...t?.extensions?.dictionary})||o({partial:n})||qe.parse(e,{partial:n,...t?.extensions?.namespace})||r("Partial doesn't apply to anything")}()||Me.parse(e,t?.extensions?.dictionary)||Se.parse(e)||Re.parse(e)||Ce.parse(e)||qe.parse(e,t?.extensions?.namespace)}const a=function(){if(!n.length)return[];const s=[];for(;;){const t=G.parse(e),n=i();if(!n){t.length&&r("Stray extended attributes");break}he(n).extAttrs=t,s.push(n)}const o=q.parse(e);return t.concrete&&s.push(o),s}();return e.position<n.length&&r("Unrecognised tokens"),a}function We(e){return e}const Fe={wrap:e=>e.join(""),trivia:We,name:We,reference:We,type:We,generic:We,nameless:We,inheritance:We,definition:We,extendedAttribute:We,extendedAttributeReference:We};class Be{constructor(e){this.ts=Object.assign({},Fe,e)}reference(e,{unescaped:t,context:n}){return t||(t=e.startsWith("_")?e.slice(1):e),this.ts.reference(e,t,n)}token(e,t=We,...n){if(!e)return"";const r=t(e.value,...n);return this.ts.wrap([this.ts.trivia(e.trivia),r])}reference_token(e,t){return this.token(e,this.reference.bind(this),{context:t})}name_token(e,t){return this.token(e,this.ts.name,t)}identifier(e,t){return this.ts.wrap([this.reference_token(e.tokens.value,t),this.token(e.tokens.separator)])}}function He(e,t){const n=new Map,r=e.filter((e=>"includes"===e.type));for(const e of r){const r=t.get(e.includes);if(!r)continue;const s=n.get(e.target);s?s.push(r):n.set(e.target,[r])}return n}function*Ge(e){const t=function(e){const t=new Map,n=new Set,r=new Map;for(const s of e)if(s.partial){const e=r.get(s.name);e?e.push(s):r.set(s.name,[s])}else s.name&&(t.has(s.name)?n.add(s):t.set(s.name,s));return{all:e,unique:t,partials:r,duplicates:n,mixinMap:He(e,t),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(e);for(const e of t.all)e.validate&&(yield*e.validate(t));yield*function*({unique:e,duplicates:t}){for(const n of t){const{name:t}=n,r=`The name "${t}" of type "${e.get(t).type}" was already seen`;yield I(n.tokens.name,n,"no-duplicate",r)}}(t)}var Ve=Object.freeze({__proto__:null,WebIDLParseError:xe,parse:function(e,t={}){const n=new ke(e);return void 0!==t.sourceName&&(n.source.name=t.sourceName),Ue(n,t)},validate:function(e){return[...Ge((t=e,t.flat?t.flat():[].concat(...t)))];var t},write:function(e,{templates:t=Fe}={}){t=Object.assign({},Fe,t);const n=new Be(t);return t.wrap(e.map((e=>e.write(n))))}});const Ye=/^[!#$%&'*+-.^`|~\w]+$/,Ke=/[\u000A\u000D\u0009\u0020]/u,Ze=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function Je(e,t,n){(t&&""!==t&&!e.has(t)&&Ze.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function Qe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Xe={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function et(e){Xe=e}const tt=/[&<>"']/,nt=new RegExp(tt.source,"g"),rt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,st=new RegExp(rt.source,"g"),ot={"&":"&","<":"<",">":">",'"':""","'":"'"},it=e=>ot[e];function at(e,t){if(t){if(tt.test(e))return e.replace(nt,it)}else if(rt.test(e))return e.replace(st,it);return e}const ct=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function lt(e){return e.replace(ct,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const ut=/(^|[^\[])\^/g;function dt(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(ut,"$1"),n=n.replace(e,s),r},getRegex:()=>new RegExp(n,t)};return r}function pt(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const ft={exec:()=>null};function ht(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function mt(e,t,n){const r=e.length;if(0===r)return"";let s=0;for(;s<r;){const o=e.charAt(r-s-1);if(o!==t||n){if(o===t||!n)break;s++}else s++}return e.slice(0,r-s)}function gt(e,t,n,r){const s=t.href,o=t.title?at(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:s,title:o,text:i,tokens:r.inlineTokens(i)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:s,title:o,text:at(i)}}class bt{options;rules;lexer;constructor(e){this.options=e||Xe}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:mt(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=mt(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");e=mt(e.replace(/^ *>[ \t]?/gm,""),"\n");const n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const o=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let i="",a="",c=!1;for(;e;){let n=!1;if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;i=t[0],e=e.substring(i.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),l=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=r.slice(u),u+=t[1].length);let d=!1;if(!r&&/^ *$/.test(l)&&(i+=l+"\n",e=e.substring(l.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const c=e.split("\n",1)[0];if(l=c,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),s.test(l))break;if(o.test(l))break;if(t.test(l))break;if(n.test(e))break;if(l.search(/[^ ]/)>=u||!l.trim())a+="\n"+l.slice(u);else{if(d)break;if(r.search(/[^ ]/)>=4)break;if(s.test(r))break;if(o.test(r))break;if(n.test(r))break;a+="\n"+l}d||l.trim()||(d=!0),i+=c+"\n",e=e.substring(c.length+1),r=l.slice(u)}}s.loose||(c?s.loose=!0:/\n *\n *$/.test(i)&&(c=!0));let p,f=null;this.options.gfm&&(f=/^\[[ xX]\] /.exec(a),f&&(p="[ ] "!==f[0],a=a.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:i,task:!!f,checked:p,loose:!1,text:a,tokens:[]}),s.raw+=i}s.items[s.items.length-1].raw=i.trimEnd(),s.items[s.items.length-1].text=a.trimEnd(),s.raw=s.raw.trimEnd();for(let e=0;e<s.items.length;e++)if(this.lexer.state.top=!1,s.items[e].tokens=this.lexer.blockTokens(s.items[e].text,[]),!s.loose){const t=s.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));s.loose=n}if(s.loose)for(let e=0;e<s.items.length;e++)s.items[e].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=ht(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?o.align.push("right"):/^ *:-+: *$/.test(e)?o.align.push("center"):/^ *:-+ *$/.test(e)?o.align.push("left"):o.align.push(null);for(const e of n)o.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of s)o.rows.push(ht(e,o.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:at(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=mt(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),gt(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return gt(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let s,o,i=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(o=[...s].length,r[3]||r[4]){i+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){a+=o;continue}if(i-=o,i>0)continue;o=Math.min(o,o+i+a);const t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+o);if(Math.min(n,o)%2){const e=c.slice(1,-1);return{type:"em",raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}const l=c.slice(2,-2);return{type:"strong",raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=at(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=at(t[1]),n="mailto:"+e):(e=at(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=at(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=at(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:at(t[0]),{type:"text",raw:t[0],text:e}}}}const yt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,wt=/(?:[*+-]|\d{1,9}[.)])/,vt=dt(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,wt).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),$t=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,kt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,xt=dt(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",kt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_t=dt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,wt).getRegex(),St="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ct=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Rt=dt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Ct).replace("tag",St).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Et=dt($t).replace("hr",yt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",St).getRegex(),At={blockquote:dt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Et).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:xt,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:yt,html:Rt,lheading:vt,list:_t,newline:/^(?: *(?:\n|$))+/,paragraph:Et,table:ft,text:/^[^\n]+/},Tt=dt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",yt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",St).getRegex(),Lt={...At,table:Tt,paragraph:dt($t).replace("hr",yt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Tt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",St).getRegex()},Pt={...At,html:dt("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Ct).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ft,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:dt($t).replace("hr",yt).replace("heading"," *#{1,6} *[^\n]").replace("lheading",vt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},It=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Dt=/^( {2,}|\\)\n(?!\s*$)/,Nt="\\p{P}\\p{S}",jt=dt(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Nt).getRegex(),Ot=dt(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Nt).getRegex(),Mt=dt("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Nt).getRegex(),qt=dt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Nt).getRegex(),zt=dt(/\\([punct])/,"gu").replace(/punct/g,Nt).getRegex(),Ut=dt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Wt=dt(Ct).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ft=dt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Wt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Bt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ht=dt(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Bt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Gt=dt(/^!?\[(label)\]\[(ref)\]/).replace("label",Bt).replace("ref",kt).getRegex(),Vt=dt(/^!?\[(ref)\](?:\[\])?/).replace("ref",kt).getRegex(),Yt={_backpedal:ft,anyPunctuation:zt,autolink:Ut,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:Dt,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:ft,emStrongLDelim:Ot,emStrongRDelimAst:Mt,emStrongRDelimUnd:qt,escape:It,link:Ht,nolink:Vt,punctuation:jt,reflink:Gt,reflinkSearch:dt("reflink|nolink(?!\\()","g").replace("reflink",Gt).replace("nolink",Vt).getRegex(),tag:Ft,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:ft},Kt={...Yt,link:dt(/^!?\[(label)\]\((.*?)\)/).replace("label",Bt).getRegex(),reflink:dt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Bt).getRegex()},Zt={...Yt,escape:dt(It).replace("])","~|])").getRegex(),url:dt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Jt={...Zt,br:dt(Dt).replace("{2,}","*").getRegex(),text:dt(Zt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Qt={normal:At,gfm:Lt,pedantic:Pt},Xt={normal:Yt,gfm:Zt,breaks:Jt,pedantic:Kt};class en{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Xe,this.options.tokenizer=this.options.tokenizer||new bt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Qt.normal,inline:Xt.normal};this.options.pedantic?(t.block=Qt.pedantic,t.inline=Xt.pedantic):this.options.gfm&&(t.block=Qt.gfm,this.options.breaks?t.inline=Xt.breaks:t.inline=Xt.gfm),this.tokenizer.rules=t}static get rules(){return{block:Qt,inline:Xt}}static lex(e,t){return new en(t).lex(e)}static lexInline(e,t){return new en(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){let n,r,s,o;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s)))r=t[t.length-1],o&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),o=s.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,s,o,i,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(c));)c=c.slice(0,o.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class tn{options;constructor(e){this.options=e||Xe}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+at(r)+'">'+(n?e:at(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:at(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const r=pt(e);if(null===r)return n;let s='<a href="'+(e=r)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>",s}image(e,t,n){const r=pt(e);if(null===r)return n;let s=`<img src="${e=r}" alt="${n}"`;return t&&(s+=` title="${t}"`),s+=">",s}text(e){return e}}class nn{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class rn{options;renderer;textRenderer;constructor(e){this.options=e||Xe,this.options.renderer=this.options.renderer||new tn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new nn}static parse(e,t){return new rn(t).parse(e)}static parseInline(e,t){return new rn(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const s=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const e=s,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(s.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=s;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,lt(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=s;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=s;let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let o="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];r="";for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});o+=this.renderer.tablerow(r)}n+=this.renderer.table(t,o);continue}case"blockquote":{const e=s,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=s,t=e.ordered,r=e.start,o=e.loose;let i="";for(let t=0;t<e.items.length;t++){const n=e.items[t],r=n.checked,s=n.task;let a="";if(n.task){const e=this.renderer.checkbox(!!r);o?n.tokens.length>0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(n.tokens,o),i+=this.renderer.listitem(a,s,!!r)}n+=this.renderer.list(i,t,r);continue}case"html":{const e=s;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=s;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let o=s,i=o.tokens?this.parseInline(o.tokens):o.text;for(;r+1<e.length&&"text"===e[r+1].type;)o=e[++r],i+="\n"+(o.tokens?this.parseInline(o.tokens):o.text);n+=t?this.renderer.paragraph(i):i;continue}default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const s=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){n+=e||"";continue}}switch(s.type){case"escape":{const e=s;n+=t.text(e.text);break}case"html":{const e=s;n+=t.html(e.text);break}case"link":{const e=s;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=s;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=s;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=s;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=s;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=s;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=s;n+=t.text(e.text);break}default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class sn{options;constructor(e){this.options=e||Xe}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}const on=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(en.lex,rn.parse);parseInline=this.#e(en.lexInline,rn.parseInline);Parser=rn;Renderer=tn;TextRenderer=nn;Lexer=en;Tokenizer=bt;Hooks=sn;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{const s=e[r].flat(1/0);n=n.concat(this.walkTokens(s,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new tn(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const r=n,s=e.renderer[r],o=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=o.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new bt(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,s=e.tokenizer[r],o=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new sn;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,s=e.hooks[r],o=t[r];sn.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(s.call(t,e)).then((e=>o.call(t,e)));const n=s.call(t,e);return o.call(t,n)}:t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return en.lex(e,t??this.defaults)}parser(e,t){return rn.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const s={...r},o={...this.defaults,...s};!0===this.defaults.async&&!1===s.async&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const i=this.#t(!!o.silent,!!o.async);if(null==n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then((t=>e(t,o))).then((e=>o.hooks?o.hooks.processAllTokens(e):e)).then((e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then((()=>e)):e)).then((e=>t(e,o))).then((e=>o.hooks?o.hooks.postprocess(e):e)).catch(i);try{o.hooks&&(n=o.hooks.preprocess(n));let r=e(n,o);o.hooks&&(r=o.hooks.processAllTokens(r)),o.walkTokens&&this.walkTokens(r,o.walkTokens);let s=t(r,o);return o.hooks&&(s=o.hooks.postprocess(s)),s}catch(e){return i(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+at(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function an(e,t){return on.parse(e,t)}function cn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}an.options=an.setOptions=function(e){return on.setOptions(e),an.defaults=on.defaults,et(an.defaults),an},an.getDefaults=Qe,an.defaults=Xe,an.use=function(...e){return on.use(...e),an.defaults=on.defaults,et(an.defaults),an},an.walkTokens=function(e,t){return on.walkTokens(e,t)},an.parseInline=on.parseInline,an.Parser=rn,an.parser=rn.parse,an.Renderer=tn,an.TextRenderer=nn,an.Lexer=en,an.lexer=en.lex,an.Tokenizer=bt,an.Hooks=sn,an.parse=an,an.options,an.setOptions,an.use,an.walkTokens,an.parseInline,rn.parse,en.lex;var ln,un={exports:{}};var dn,pn=(ln||(ln=1,dn=un,function(e,t){dn.exports=t()}(0,(function(){var e=[],t=[],n={},r={},s={};function o(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(t[0],(function(n,r){var s,o,a=(s=t[1],o=arguments,s.replace(/\$(\d{1,2})/g,(function(e,t){return o[t]||""})));return i(""===n?e[r-1]:n,a)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var s=r.length;s--;){var o=r[s];if(o[0].test(t))return a(t,o)}return t}function l(e,t,n){return function(r){var s=r.toLowerCase();return t.hasOwnProperty(s)?i(r,s):e.hasOwnProperty(s)?i(r,e[s]):c(s,r,n)}}function u(e,t,n,r){return function(r){var s=r.toLowerCase();return!!t.hasOwnProperty(s)||!e.hasOwnProperty(s)&&c(s,s,n)===s}}function d(e,t,n){return(n?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=l(s,r,e),d.isPlural=u(s,r,e),d.singular=l(r,s,t),d.isSingular=u(r,s,t),d.addPluralRule=function(t,n){e.push([o(t),n])},d.addSingularRule=function(e,n){t.push([o(e),n])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},d.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),s[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return d.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return d.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return d.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eĆ©]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d}))),un.exports),fn=cn(pn),hn=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,s=o.prototype;return s.delete=function(e){return this.has(e)&&delete e[this._]},s.get=function(e){return this.has(e)?e[this._]:void 0},s.has=function(e){return r.call(e,this._)},s.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},o;function o(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(i,this)}function i(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=s.prototype;function s(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},r.WeakSet=s}(Math.random(),Object.defineProperty)}function s(e,t,n,r,s,o){for(var i=("selectedIndex"in t),a=i;r<s;){var c,l=e(n[r],1);t.insertBefore(l,o),i&&a&&l.selected&&(a=!a,c=t.selectedIndex,t.selectedIndex=c<0?r:d.call(t.querySelectorAll("option"),l)),r++}}function o(e,t){return e==t}function i(e){return e}function a(e,t,n,r,s,o,i){var a=o-s;if(a<1)return-1;for(;a<=n-t;){for(var c=t,l=s;c<n&&l<o&&i(e[c],r[l]);)c++,l++;if(l===o)return t;t=c+1}return-1}function c(e,t,n,r,s){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:s}function l(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,s=t;r<s;){var o=(r+s)/2>>>0;n<e[o]?s=o:r=1+o}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||o,d=r.node||i,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,y=0;g<m&&y<b&&u(t[g],n[y]);)g++,y++;for(;g<m&&y<b&&u(t[m-1],n[b-1]);)m--,b--;var w=g===m,v=y===b;if(w&&v)return n;if(w&&y<b)return s(d,e,n,y,b,c(d,t,g,h,f)),n;if(v&&g<m)return l(d,t,g,m),n;var $=m-g,k=b-y,x=-1;if($<k){if(-1<(x=a(n,y,b,t,g,m,u)))return s(d,e,n,y,x,d(t[g],0)),s(d,e,n,x+$,b,c(d,t,m,h,f)),n}else if(k<$&&-1<(x=a(t,g,m,n,y,b,u)))return l(d,t,g,x),l(d,t,x+k,m),n;return $<2||k<2?(s(d,e,n,y,b,d(t[g],0)),l(d,t,g,m)):$==k&&function(e,t,n,r,s,o){for(;r<s&&o(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?s(d,e,n,y,b,c(d,t,m,h,f)):function(e,t,n,r,o,i,a,c,u,d,f,h,m){!function(e,t,n,r,o,i,a,c,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:o++,f++;break;case 1:d.push(r[o]),s(t,n,r,o++,o,f<c?t(i[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(i[a])?a++:l(t,i,a++,a)}}(function(e,t,n,r,s,o,i){var a,c,l,u,d,p,f=n+o,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(c=(l=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;l<o&&c<n&&i(r[s+l],e[t+c]);)l++,c++;if(l===o&&c===n)break e;d[b+a]=l}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<l&&0<c&&i(r[s+l-1],e[t+c-1]);)m[g--]=0,l--,c--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=l-c)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(c--,m[g--]=1):(l--,m[g--]=-1)}return m}(n,r,i,a,c,d,h)||function(e,t,n,r,s,o,i,a){var c=0,l=r<a?r:a,u=Array(l++),d=Array(l);d[0]=-1;for(var f=1;f<l;f++)d[f]=i;for(var h=s.slice(o,i),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(c=p(d,l,g=b+o))&&(d[c]=g,u[c]={newi:m,oldi:g,prev:u[c-1]})}for(c=--l,--i;d[c]>i;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var v=w.newi,$=w.oldi;v<n;)y[--l]=1,--n;for(;$<i;)y[--l]=-1,--i;y[--l]=0,--n,--i,w=w.prev}for(;t<=n;)y[--l]=1,--n;for(;o<=i;)y[--l]=-1,--i;return y}(n,r,o,i,a,c,u,d),e,t,n,r,a,c,f,m)}(d,e,n,y,b,k,t,g,m,$,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,y={};try{y.Map=Map}catch(u){y.Map=function(){var e=0,t=[],n=[];return{delete:function(s){var o=r(s);return o&&(t.splice(e,1),n.splice(e,1)),o},forEach:function(e,r){t.forEach((function(t,s){e.call(r,n[s],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(s,o){return n[r(s)?e:t.push(s)-1]=o,this}};function r(n){return-1<(e=t.indexOf(n))}}}var w=y.Map;function v(){return this}function $(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var x,_,S,C,R,E,A={},T={},L=[],P=T.hasOwnProperty,I=0,D={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in T||(I=L.push(e)),T[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<I;n++){var r=L[n];if(P.call(e,r))return T[r](e[r],t)}}},N=Array.isArray||(_=(x={}.toString).call([]),function(e){return x.call(e)===_}),j=(S=e,C="fragment",E="content"in M(R="template")?function(e){var t=M(R);return t.innerHTML=e,t.content}:function(e){var t,n=M(C),r=M(R);return O(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=M(C),n=M("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",O(t,n.firstChild.childNodes),t}:E)(e)});function O(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function M(e){return e===C?S.createDocumentFragment():S.createElementNS("http://www.w3.org/1999/xhtml",e)}var q,z,U,W,F,B,H,G,V,Y=(z="appendChild",U="cloneNode",W="createTextNode",B=(F="importNode")in(q=e),(H=q.createDocumentFragment())[z](q[W]("g")),H[z](q[W]("")),(B?q[F](H,!0):H[U](!0)).childNodes.length<2?function e(t,n){for(var r=t[U](),s=t.childNodes||[],o=s.length,i=0;n&&i<o;i++)r[z](e(s[i],n));return r}:B?q[F]:function(e,t){return e[U](!!t)}),K="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Z="-"+Math.random().toFixed(6)+"%",J=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Z+'"></p>',G.content.childNodes[0].getAttribute(V)==Z)||(Z="_dt: "+Z.slice(1,-1)+";",J=!0)}catch(u){}var Q="\x3c!--"+Z+"--\x3e",X=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,se=" \\f\\n\\r\\t",oe="[^"+se+"\\/>\"'=]+",ie="["+se+"]+"+oe,ae="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ce="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+oe.replace("\\/","")+"))?)",le=new RegExp(ae+ie+ce+"+)(["+se+"]*/?>)","g"),ue=new RegExp(ae+ie+ce+"*)(["+se+"]*/>)","g"),de=new RegExp("("+ie+"\\s*=\\s*)(['\"]?)"+Q+"\\2","gi");function pe(e,t,n,r){return"<"+t+n.replace(de,fe)+r}function fe(e,t,n){return t+(n||'"')+Z+(n||'"')}function he(e,t,n){return re.test(t)?e:"<"+t+n+"></"+t+">"}var me=J?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function ge(t,n,r,s){for(var o=t.childNodes,i=o.length,a=0;a<i;){var c=o[a];switch(c.nodeType){case ee:var l=s.concat(a);!function(t,n,r,s){for(var o,i=t.attributes,a=[],c=[],l=me(i,r),u=l.length,d=0;d<u;){var p=l[d++],f=p.value===Z;if(f||1<(o=p.value.split(Q)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=i[m]||i[m.toLowerCase()];if(f)n.push(be(g,s,m,null));else{for(var b=o.length-2;b--;)r.shift();n.push(be(g,s,m,o))}}c.push(p)}}for(var y=((d=0)<(u=c.length)&&J&&!("ownerSVGElement"in t));d<u;){var w=c[d++];y&&(w.value=""),t.removeAttribute(w.name)}var v=t.nodeName;if(/^script$/i.test(v)){var $=e.createElement(v);for(u=i.length,d=0;d<u;)$.setAttributeNode(i[d++].cloneNode(!0));$.textContent=t.textContent,t.parentNode.replaceChild($,t)}}(c,n,r,l),ge(c,n,r,l);break;case X:var u=c.textContent;if(u===Z)r.shift(),n.push(ne.test(t.nodeName)?ye(t,s):{type:"any",node:c,path:s.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"šŸ‘»":t.removeChild(c),a--,i--}break;case te:ne.test(t.nodeName)&&K.call(c.textContent)===Q&&(r.shift(),n.push(ye(t,s)))}a++}}function be(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function ye(e,t){return{type:"text",node:e,path:t}}var we,ve=(we=new n,{get:function(e){return we.get(e)},set:function(e,t){return we.set(e,t),t}});function $e(e,t){var n=(e.convert||function(e){return e.join(Q).replace(ue,he).replace(le,pe)})(t),r=e.transform;r&&(n=r(n));var s=j(n,e.type);xe(s);var o=[];return ge(s,o,t.slice(0),[]),{content:s,updates:function(n){for(var r=[],s=o.length,i=0,a=0;i<s;){var c=o[i++],l=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,c.path);switch(c.type){case"any":r.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var u=c.sparse,d=e.attribute(l,c.name,c.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return s+=a,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+" values instead of "+s+"\n"+t.join("${value}"));for(var o=1,i=1;o<e;){var a=r[o-i];if(a.sparse){var c=a.values,l=c[0],u=1,d=c.length;for(i+=d-2;u<d;)l+=arguments[o++]+c[u++];a.fn(l)}else a.fn(arguments[o++])}return n}}}}var ke=[];function xe(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===K.call(r.textContent).length&&e.removeChild(r)}}var _e,Se,Ce=(_e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Se=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Ee(n,!0)}(e,t):Ee(e.style,!1)});function Re(e,t,n){return t+"-"+n.toLowerCase()}function Ee(e,t){var n,r;return function(s){var o,i,a,c;switch(typeof s){case"object":if(s){if("object"===n){if(!t&&r!==s)for(i in r)i in s||(e[i]="")}else t?e.value="":e.cssText="";for(i in o=t?{}:e,s)a="number"!=typeof(c=s[i])||_e.test(i)?c:c+"px",!t&&/^--/.test(i)?o.setProperty(i,a):o[i]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Se,Re),":",e[t],";");return n.join("")}(r=o):r=s;break}default:r!=s&&(n="string",r=s,t?e.value=s||"":e.cssText=s||"")}}}var Ae,Te,Le=(Ae=[].slice,(Te=Pe.prototype).ELEMENT_NODE=1,Te.nodeType=111,Te.remove=function(e){var t,n=this.childNodes,r=this.firstChild,s=this.lastChild;return this._=null,e&&2===n.length?s.parentNode.removeChild(s):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(s),t.deleteContents()),r},Te.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,s=0,o=r.length;s<o;s++)t.appendChild(r[s]);return t},Pe);function Pe(e){var t=this.childNodes=Ae.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Ie(e){return{html:e}}function De(e,t){switch(e.nodeType){case Be:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Fe:return De(e.render(),t);default:return e}}function Ne(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(Ie).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function je(e){return null!=e&&"then"in e}var Oe,Me,qe,ze,Ue,We="ownerSVGElement",Fe=v.prototype.nodeType,Be=Le.prototype.nodeType,He=(Me=(Oe={Event:b,WeakSet:u}).Event,qe=Oe.WeakSet,ze=!0,Ue=null,function(e){return ze&&(ze=!ze,Ue=new qe,function(e){var t=new qe,n=new qe;try{new MutationObserver(i).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,s=[],o=function(e){s.push(e),clearTimeout(r),r=setTimeout((function(){i(s.splice(r=0,s.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){o({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){o({addedNodes:[e.target],removedNodes:[]})}),!0)}function i(e){for(var r,s=e.length,o=0;o<s;o++)a((r=e[o]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var s,o=new Me(t),i=e.length,a=0;a<i;1===(s=e[a++]).nodeType&&function e(t,n,r,s,o){Ue.has(t)&&!s.has(t)&&(o.delete(t),s.add(t),t.dispatchEvent(n));for(var i=t.children||[],a=i.length,c=0;c<a;e(i[c++],n,r,s,o));}(s,o,t,n,r));}}(e.ownerDocument)),Ue.add(e),e}),Ge=/^(?:form|list)$/i,Ve=[].slice;function Ye(t){return this.type=t,function(t){var n=ke,r=xe;return function(s){var o,i,a;return n!==s&&(o=t,i=n=s,a=ve.get(i)||ve.set(i,$e(o,i)),r=a.updates(Y.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ke=!(Ye.prototype={attribute:function(e,t,n){var r,s=We in e;if("style"===t)return Ce(e,n,s);if("."===t.slice(0,1))return l=e,u=t.slice(1),s?function(e){try{l[u]=e}catch(t){l.setAttribute(u,e)}}:function(e){l[u]=e};if("?"===t.slice(0,1))return i=e,a=t.slice(1),function(e){c!==!!e&&((c=!!e)?i.setAttribute(a,""):i.removeAttribute(a))};if(/^on/.test(t)){var o=t.slice(2);return"connected"===o||"disconnected"===o?He(e):t.toLowerCase()in e&&(o=o.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(o,r,!1),(r=t)&&e.addEventListener(o,t,!1))}}if("data"===t||!s&&t in e&&!Ge.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in D.attributes)return function(n){var s=D.attributes[t](e,n);r!==s&&(null==(r=s)?e.removeAttribute(t):e.setAttribute(t,s))};var i,a,c,l,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:De,before:e},s=We in e?"svg":"html",o=!1;return function i(a){switch(typeof a){case"string":case"number":case"boolean":o?n!==a&&(n=a,t[0].textContent=a):(o=!0,n=a,t=h(e.parentNode,t,[(c=a,e.ownerDocument.createTextNode(c))],r));break;case"function":i(a(e));break;case"object":case"undefined":if(null==a){o=!1,t=h(e.parentNode,t,[],r);break}default:if(o=!1,N(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":i({html:a});break;case"object":if(N(a[0])&&(a=a.concat.apply([],a)),je(a[0])){Promise.all(a).then(i);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Ve.call(a.childNodes):[a],r):je(a)?a.then(i):"placeholder"in a?Ne(a,i):"text"in a?i(String(a.text)):"any"in a?i(a.any):"html"in a?t=h(e.parentNode,t,Ve.call(j([].concat(a.html).join(""),s).childNodes),r):i("length"in a?Ve.call(a):D.invoke(a,i))}var c}},text:function(e){var t;return function n(r){var s;t!==r&&("object"==(s=typeof(t=r))&&r?je(r)?r.then(n):"placeholder"in r?Ne(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Ve.call(r).join(""):D.invoke(r,n)):"function"==s?n(r(e)):e.textContent=null==r?"":r)}}}),Ze=function(t){var r,s,o,i,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),c=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||c?(s={},o=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return s[t]||(s[t]=e)},Ze=c?o:(i=new n,function(e){return i.get(e)||(n=o(t=e),i.set(t,n),n);var t,n})):Ke=!0,Je(t)};function Je(e){return Ke?e:Ze(e)}function Qe(e){for(var t=arguments.length,n=[Je(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Xe=new n,et=function(e){var t,n,r;return function(){var s=Qe.apply(null,arguments);return r!==s[0]?(r=s[0],n=new Ye(e),t=nt(n.apply(n,s))):n.apply(n,s),t}},tt=function(e,t){var n=t.indexOf(":"),r=Xe.get(e),s=t;return-1<n&&(s=t.slice(n+1),t=t.slice(0,n)||"html"),r||Xe.set(e,r={}),r[s]||(r[s]=et(t))},nt=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Le(t):e},rt=new n;function st(){var e=rt.get(this),t=Qe.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(We in this?"svg":"html");rt.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var ot,it,at,ct,lt=D.define,ut=Ye.prototype;function dt(e){return arguments.length<2?null==e?et("html"):"string"==typeof e?dt.wire(null,e):"raw"in e?et("html")(e):"nodeType"in e?dt.bind(e):tt(e,"html"):("raw"in e?et("html"):dt.wire).apply(null,arguments)}return dt.Component=v,dt.bind=function(e){return st.bind(e)},dt.define=lt,dt.diff=h,(dt.hyper=dt).observe=He,dt.tagger=ut,dt.wire=function(e,t){return null==e?et(t||"html"):tt(e,t||"html")},dt._={WeakMap:n,WeakSet:u},ot=et,it=new n,at=Object.create,ct=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,s){var o,i,a,c=t.get(e)||ct(e,t);switch(typeof s){case"object":case"function":var l=c.w||(c.w=new n);return l.get(s)||(o=l,i=s,a=new e(r),o.set(i,a),a);default:var u=c.p||(c.p=at(null));return u[s]||(u[s]=new e(r))}}(this,it.get(e)||(r=e,s=new w,it.set(r,s),s),e,null==t?"default":t);var r,s}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:$("html",ot),svg:$("svg",ot),state:$("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var s in r)n[s]=r[s];return!1!==t&&this.render(),this}}}),dt}(document);const mn=hn,gn=T,bn=an,yn=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(e=e.trim(),!e)throw new TypeError("Invalid input.");let t="",n="",r="",s=null,o=new Map,i="type",a=Array.from(e);for(let e=0;e<a.length;e++){const c=a[e];switch(i){case"type":if("/"===c){i="subtype";continue}t+=c;break;case"subtype":if(";"===c){i="param-start";continue}n+=c;break;case"param-start":if(Ke.test(c)||";"===c)continue;r+=c,i="param-name";break;case"param-name":if("="===c||";"===c){if("="===c){i="param-value",s=null;continue}o.set(r.toLowerCase(),null),r="";continue}r+=c;break;case"param-value":if('"'==c){i="collect-quoted-string";continue}if(";"===c){s=s.trimEnd(),i="param-start",Je(o,r,s),r="";continue}s="string"==typeof s?s+c:c;break;case"collect-quoted-string":if('"'===c){Je(o,r,s),i="ignore-input-until-next-param",r="",s=null;continue}if("\\"===c)continue;s="string"==typeof s?s+c:c;break;case"ignore-input-until-next-param":if(";"!==c)continue;i="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${i} `)}}r&&Je(o,r,s);if(""===t.trim()||!Ye.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!Ye.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(o.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?Ye.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},wn=fn,vn=Ve,$n=/-/g;const kn=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),xn="en"===o||o.startsWith("en-")?"en-AU":o,_n=new Intl.DateTimeFormat(xn,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===xn?"2-digit":"numeric"}),Sn=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function Cn(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Rn(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function En(e,t="long"){const n=new Intl.ListFormat(o,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map((({type:n,value:s})=>"element"===n&&t?t(s,r++,e):s))}}const An=En("conjunction"),Tn=En("disjunction");function Ln(e,t){return An(e,t).join("")}function Pn(e,t){return Tn(e,t).join("")}function In(e){return e.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/</g,"<")}function Dn(e){return e.trim().replace(/\s+/g," ")}function Nn(e,t=o){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=jn(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function jn(e,t,n=o){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}function On(e,t=""){return kn.format(e).replace($n,t)}function Mn(e,t,...n){const r=[this,e,...n];if(t){const n=t.split(/\s+/);for(const t of n){const n=window[t];if(n)try{e=n.apply(this,r)}catch(e){sr(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace.",cause:e})}}}return e}async function qn(e,t=864e5){const n=new Request(e),r=new URL(n.url);let s,o;if("caches"in window)try{if(s=await caches.open(r.origin),o=await s.match(n),o&&new Date(o.headers.get("Expires"))>new Date)return o}catch(e){console.error("Failed to use Cache API.",e)}const i=await fetch(n);if(!i.ok&&o)return console.warn(`Returning a stale cached response for ${r}`),o;if(s&&i.ok){const e=i.clone(),r=new Headers(i.headers),o=new Date(Date.now()+t);r.set("Expires",o.toISOString());const a=new Response(await e.blob(),{headers:r});await s.put(n,a).catch(console.error)}return i}function zn(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>mn`${e}, `));return mn`${r}${n[n.length-1]}`}function Un(e,t){return[].concat(An(e,t)).map((e=>"string"==typeof e?mn`${e}`:e))}function Wn(e,t=""){const n=function(e){let t=0;for(const n of e)t=Math.imul(31,t)+n.charCodeAt(0)|0;return String(t)}(Dn(e.textContent));return Fn(e,t,n)}function Fn(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let s=r?n:n.toLowerCase();if(s=s.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,""),s?!/\.$/.test(s)&&/^[a-z]/i.test(t||s)||(s=`x${s}`):s="generatedID",t&&(s=`${t}-${s}`),e.ownerDocument.getElementById(s)){let t=0,n=`${s}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${s}-${t}`;s=n}return e.id=s,s}function Bn(e){const t=new Set,n="ltNodefault"in e.dataset?"":Dn(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>Dn(e))).forEach((e=>t.add(e))):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r.title?t.add(r.title):'""'===e.textContent&&t.add("the-empty-string"),t.add(n),t.delete(""),e.dataset.localLt){e.dataset.localLt.split("|").forEach((e=>t.add(Dn(e))))}return[...t]}function Hn(e,t,n={copyAttributes:!0}){if(e.localName===t)return e;const r=e.ownerDocument.createElement(t);if(n.copyAttributes)for(const{name:t,value:n}of e.attributes)r.setAttribute(t,n);return r.append(...e.childNodes),e.replaceWith(r),r}function Gn(e,t){const n=t.closest(Sn);let r=!1;if(n&&(r=!t.closest(".normative")||!n.querySelector(".normative")),e.startsWith("!")){if(r)return{type:"informative",illegal:!0};r=!1}else e.startsWith("?")&&(r=!0);return{type:r?"informative":"normative",illegal:!1}}function Vn(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Yn(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}function Kn(e,t){const n=[];let r=e.parentElement;for(;r;){const e=r.closest(t);if(!e)break;n.push(e),r=e.parentElement}return n}function Zn(e){const{previousSibling:t}=e;if(!t||t.nodeType!==Node.TEXT_NODE)return"";const n=t.textContent.lastIndexOf("\n");if(-1===n)return"";const r=t.textContent.slice(n+1);return/\S/.test(r)?"":r}class Jn extends Set{constructor(e=[]){super();for(const t of e)this.add(t)}add(e){return this.has(e)||this.getCanonicalKey(e)?this:super.add(e)}has(e){return super.has(e)||[...this.keys()].some((t=>t.toLowerCase()===e.toLowerCase()))}delete(e){return super.has(e)?super.delete(e):super.delete(this.getCanonicalKey(e))}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find((t=>t.toLowerCase()===e.toLowerCase()))}}function Qn(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{Hn(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),Xn(t),t}function Xn(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...er(t)])e.remove()}function*er(e){for(;e.nextNode();)yield e.currentNode}class tr extends Map{constructor(e=[]){return super(),e.forEach((([e,t])=>{this.set(e,t)})),this}set(e,t){return super.set(e.toLowerCase(),t),this}get(e){return super.get(e.toLowerCase())}has(e){return super.has(e.toLowerCase())}delete(e){return super.delete(e.toLowerCase())}}class nr extends Error{constructor(e,t,n){super(e,{...n.cause&&{cause:n.cause}});const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach((t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||Fn(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:s,elements:o,title:i,details:a}=this;return{message:e,name:t,plugin:r,hint:s,elements:o,title:i,details:a,stack:n,...this.cause instanceof Error&&{cause:{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}}}}}function rr(e,t,n={}){const r={...n,isWarning:!1};fr("error",new nr(e,t,r))}function sr(e,t,n={}){const r={...n,isWarning:!0};fr("warn",new nr(e,t,r))}function or(e){return{showError:(t,n)=>rr(t,e,n),showWarning:(t,n)=>sr(t,e,n)}}function ir(e){return e?`\`${e}\``:""}function ar(e,{quotes:t}={quotes:!1}){return Pn(e,t?e=>ir(lr(e)):ir)}function cr(e,{quotes:t}={quotes:!1}){return Ln(e,t?e=>ir(lr(e)):ir)}function lr(e){return String(e)?`"${e}"`:""}function ur(e,...t){return dr(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[s,o]=r.slice(1,-1).split("|");if(o){return`${e}[${s}](${new URL(o,"https://respec.org/docs/")})`}return`${e}[\`${s}\`](https://respec.org/docs/#${s})`})).join(""))}function dr(e){if(!e)return e;const t=e.trimEnd().split("\n");for(;t.length&&!t[0].trim();)t.shift();const n=t.filter((e=>e.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}const pr=new EventTarget;function fr(e,t){if(pr.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const n=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function hr(e,t,n={once:!1}){pr.addEventListener(e,(async n=>{try{await t(n.detail)}catch(t){rr(`Error in handler for topic "${e}": ${t.message}`,`sub:${e}`,{cause:t})}}),n)}n("core/pubsubhub",{sub:hr});const mr=["githubToken","githubUser"];const gr=new Map([["text/html","html"],["application/xml","xml"]]);function br(e,t=document){const n=gr.get(e);if(!n){const t=[...gr.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=yr(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function yr(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;Xn(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Rn(r);const s=e.createDocumentFragment(),o=e.querySelector("meta[name='viewport']");o&&t.firstChild!==o&&s.appendChild(o);let i=e.querySelector("meta[charset], meta[content*='charset=']");i||(i=mn`<meta charset="utf-8" />`);s.appendChild(i);const a=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=mn` + <meta name="generator" content="${a}" /> + `;s.appendChild(c),t.prepend(s),fr("beforesave",r)}(n);let r="";if("xml"===e)r=(new XMLSerializer).serializeToString(n);else!function(e){e.querySelectorAll("style").forEach((e=>{e.innerHTML=`\n${e.innerHTML}\n`})),e.querySelectorAll("head > *").forEach((e=>{e.outerHTML=`\n${e.outerHTML}`}))}(n),n.doctype&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML;return r}n("core/exporter",{rsDocToDataURL:br});class wr{constructor(){this._respecDonePromise=new Promise((e=>{hr("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],hr("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),hr("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return yr("html",document)}}const vr="core/post-process";const $r="core/pre-process";const kr="core/base-runner";async function xr(e){!function(){const e=new wr;Object.defineProperty(document,"respec",{value:e})}(),fr("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),hr("amend-user-config",n),hr("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of mr)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)}))}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter((([e,t])=>!!e&&!!t)).map((([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let s;try{s=JSON.parse(r)}catch{s=r}return[n,s]})),r=Object.fromEntries(n);Object.assign(e,r),fr("amend-user-config",r)}(respecConfig),performance.mark(`${kr}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||rr("Every item in `preProcess` must be a JS function.",$r),t})).map((async(t,n)=>{const r=or(`${$r}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){rr(`Function ${t.name} threw an error during \`preProcess\`.`,$r,{hint:"See developer console.",cause:e})}}));await Promise.all(t)}}(respecConfig);const t=e.filter((e=>{return(t=e)&&(t.run||t.Plugin);var t}));t.forEach((e=>!e.name&&console.warn("Plugin lacks name:",e))),await async function(e,t){for(const n of e.filter((e=>e.prepare)))try{await n.prepare(t)}catch(e){console.error(e)}}(t,respecConfig),await async function(e,t){for(const n of e){const e=n.name||"";try{await new Promise((async(r,s)=>{const o=setTimeout((()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),s(new Error(t))}),15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r()):n.run&&(await n.run(t),r())}catch(e){s(e)}finally{clearTimeout(o),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}}))}catch(e){console.error(e)}}}(t,respecConfig),fr("plugins-done",respecConfig),await async function(e){if(Array.isArray(e.postProcess)){const t=e.postProcess.filter((e=>{const t="function"==typeof e;return t||rr("Every item in `postProcess` must be a JS function.",vr),t})).map((async(t,n)=>{const r=or(`${vr}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){rr(`Function ${t.name} threw an error during \`postProcess\`.`,vr,{hint:"See developer console.",cause:e})}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),fr("end-all"),Rn(document),performance.mark(`${kr}-end`),performance.measure(kr,`${kr}-start`,`${kr}-end`)}var _r=String.raw`.respec-modal .close-button{position:absolute;z-index:inherit;padding:.2em;font-weight:700;cursor:pointer;margin-left:5px;border:none;background:0 0} #respec-ui{position:fixed;display:flex;flex-direction:row-reverse;top:20px;right:20px;width:202px;text-align:right;z-index:9000} #respec-pill,.respec-info-button{height:2.4em;background:#fff;background:var(--bg,#fff);color:#787878;color:var(--tocnav-normal-text,#787878);border:1px solid #ccc;box-shadow:1px 1px 8px 0 rgba(100,100,100,.5);box-shadow:1px 1px 8px 0 var(--tocsidebar-shadow,rgba(100,100,100,.5));padding:.2em 0} .respec-info-button{border:none;opacity:.75;border-radius:2em;margin-right:1em;min-width:3.5em;will-change:opacity} @@ -64,42 +64,42 @@ to{margin-top:0;border:1px solid #ccc;border-radius:0;box-shadow:1px 1px 8px 0 r .respec-iframe:not(.ready){background:url(https://respec.org/xref/loader.gif) no-repeat center} .respec-iframe+a[href]{font-size:.9rem;float:right;margin:0 .5em .5em;border-bottom-width:1px} p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} -.respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const xr=/>/gm,_r=/&/gm;class Sr extends wn.Renderer{code(e,t,n){const{language:r,...s}=Sr.parseInfoString(t);if(/(^webidl$)/i.test(r))return`<pre class="idl">${e}</pre>`;const o=super.code(e,r,n).replace('class="language-','class="'),{example:i,illegalExample:a}=s;if(!i&&!a)return o;const c=i||a,l=`${r} ${i?"example":"illegal-example"}`;return o.replace("<pre>",`<pre title="${c}" class="${l}">`)}image(e,t,n){if(!t)return super.image(e,t,n);return String.raw` +.respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const Sr=/>/gm,Cr=/&/gm;class Rr extends bn.Renderer{code(e,t,n){const{language:r,...s}=Rr.parseInfoString(t);if(/(^webidl$)/i.test(r))return`<pre class="idl">${e}</pre>`;const o=super.code(e,r,n).replace('class="language-','class="'),{example:i,illegalExample:a}=s;if(!i&&!a)return o;const c=i||a,l=`${r} ${i?"example":"illegal-example"}`;return o.replace("<pre>",`<pre title="${c}" class="${l}">`)}image(e,t,n){if(!t)return super.image(e,t,n);return String.raw` <figure> <img src="${e}" alt="${n}" /> <figcaption>${t}</figcaption> </figure> - `}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let s;if(r)try{s=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...s}}heading(e,t,n){const r=/(.+)\s+{#([\w-]+)}$/;if(r.test(e)){const[,n,s]=e.match(r);return`<h${t} id="${s}">${n}</h${t}>`}return super.heading(e,t,n)}}const Cr={gfm:!0,renderer:new Sr};function Rr(e,t={inline:!1}){const n=fr(e).replace(xr,">").replace(_r,"&");return t.inline?wn.parseInline(n,Cr):wn.parse(n,Cr)}function Er(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=Rr(e.innerHTML)}const Ar=(Tr="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(Tr);return t.forEach(Er),Array.from(t)});var Tr;var Lr=Object.freeze({__proto__:null,markdownToHtml:Rr,name:"core/markdown",run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void Ar(document.body);const r=document.getElementById("respec-ui");r.remove();const s=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),s=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),s.trim()){const t=Qn(e);e.append(`\n\n${t}`)}}}(s,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),Er(s),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(s.querySelectorAll(".nolinks a[href]")),s.append(r),document.body.replaceWith(s)}});function Pr(e,t){e&&Array.from(t).forEach((([t,n])=>{e.setAttribute(`aria-${t}`,n)}))}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=kr,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const Ir=bn`<div id="respec-ui" class="removeOnSave" hidden></div>`,Dr=bn`<ul + `}static parseInfoString(e){const t=e.search(/\s/);if(-1===t)return{language:e};const n=e.slice(0,t),r=e.slice(t+1);let s;if(r)try{s=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...s}}heading(e,t,n){const r=/(.+)\s+{#([\w-]+)}$/;if(r.test(e)){const[,n,s]=e.match(r);return`<h${t} id="${s}">${n}</h${t}>`}return super.heading(e,t,n)}}const Er={gfm:!0,renderer:new Rr};function Ar(e,t={inline:!1}){const n=dr(e).replace(Sr,">").replace(Cr,"&");return t.inline?bn.parseInline(n,Er):bn.parse(n,Er)}function Tr(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=Ar(e.innerHTML)}const Lr=(Pr="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(Pr);return t.forEach(Tr),Array.from(t)});var Pr;var Ir=Object.freeze({__proto__:null,markdownToHtml:Ar,name:"core/markdown",run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void Lr(document.body);const r=document.getElementById("respec-ui");r.remove();const s=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),s=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),s.trim()){const t=Zn(e);e.append(`\n\n${t}`)}}}(s,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),Tr(s),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(s.querySelectorAll(".nolinks a[href]")),s.append(r),document.body.replaceWith(s)}});function Dr(e,t){e&&Array.from(t).forEach((([t,n])=>{e.setAttribute(`aria-${t}`,n)}))}!function(){const e=document.createElement("style");e.id="respec-ui-styles",e.textContent=_r,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const Nr=mn`<div id="respec-ui" class="removeOnSave" hidden></div>`,jr=mn`<ul id="respec-menu" role="menu" aria-labelledby="respec-pill" hidden -></ul>`,Nr=bn`<button +></ul>`,Or=mn`<button class="close-button" - onclick=${()=>Gr.closeModal()} + onclick=${()=>Yr.closeModal()} title="Close" > āŒ -</button>`;let jr,Or;window.addEventListener("load",(()=>Fr(Dr)));const Mr=[],qr=[],zr={};o("start-all",(()=>document.body.prepend(Ir)),{once:!0}),o("end-all",(()=>document.body.prepend(Ir)),{once:!0});const Ur=bn`<button id="respec-pill" disabled>ReSpec</button>`;function Wr(){Dr.classList.toggle("respec-hidden"),Dr.classList.toggle("respec-visible"),Dr.hidden=!Dr.hidden}function Fr(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",(e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))}))}Ir.appendChild(Ur),Ur.addEventListener("click",(e=>{e.stopPropagation(),Ur.setAttribute("aria-expanded",String(Dr.hidden)),Wr(),Dr.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{Dr.hidden||Wr()})),Ir.appendChild(Dr),Dr.addEventListener("keydown",(e=>{"Escape"!==e.key||Dr.hidden||(Ur.setAttribute("aria-expanded",String(Dr.hidden)),Wr(),Ur.focus())}));const Br=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function Hr(e,t,n,r){t.push(e),zr.hasOwnProperty(n)||(zr[n]=function(e,t,n){const r=`respec-pill-${e}`,s=bn`<button +</button>`;let Mr,qr;window.addEventListener("load",(()=>Hr(jr)));const zr=[],Ur=[],Wr={};hr("start-all",(()=>document.body.prepend(Nr)),{once:!0}),hr("end-all",(()=>document.body.prepend(Nr)),{once:!0});const Fr=mn`<button id="respec-pill" disabled>ReSpec</button>`;function Br(){jr.classList.toggle("respec-hidden"),jr.classList.toggle("respec-visible"),jr.hidden=!jr.hidden}function Hr(e){const t=e.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),n=t[0],r=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",(e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===n&&(r.focus(),e.preventDefault()):document.activeElement===r&&(n.focus(),e.preventDefault()))}))}Nr.appendChild(Fr),Fr.addEventListener("click",(e=>{e.stopPropagation(),Fr.setAttribute("aria-expanded",String(jr.hidden)),Br(),jr.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{jr.hidden||Br()})),Nr.appendChild(jr),jr.addEventListener("keydown",(e=>{"Escape"!==e.key||jr.hidden||(Fr.setAttribute("aria-expanded",String(jr.hidden)),Br(),Fr.focus())}));const Gr=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function Vr(e,t,n,r){t.push(e),Wr.hasOwnProperty(n)||(Wr[n]=function(e,t,n){const r=`respec-pill-${e}`,s=mn`<button id="${r}" class="respec-info-button" - ></button>`;s.addEventListener("click",(()=>{s.setAttribute("aria-expanded","true");const r=bn`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(Vr(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),r.appendChild(n)}Gr.freshModal(n,r,s)}));const o=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return Pr(s,o),s}(n,t,r),Ir.appendChild(zr[n]));const s=zr[n];s.textContent=t.length;const o=1===t.length?$n.singular(r):r;Pr(s,new Map([["label",`${t.length} ${o}`]]))}Pr(Ur,Br);const Gr={show(){try{Ir.hidden=!1}catch(e){console.error(e)}},hide(){Ir.hidden=!0},enable(){Ur.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const s=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,o=bn`<button id="${s}" class="respec-option"> + ></button>`;s.addEventListener("click",(()=>{s.setAttribute("aria-expanded","true");const r=mn`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(Kr(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),r.appendChild(n)}Yr.freshModal(n,r,s)}));const o=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return Dr(s,o),s}(n,t,r),Nr.appendChild(Wr[n]));const s=Wr[n];s.textContent=t.length;const o=1===t.length?wn.singular(r):r;Dr(s,new Map([["label",`${t.length} ${o}`]]))}Dr(Fr,Gr);const Yr={show(){try{Nr.hidden=!1}catch(e){console.error(e)}},hide(){Nr.hidden=!0},enable(){Fr.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const s=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,o=mn`<button id="${s}" class="respec-option"> <span class="respec-cmd-icon" aria-hidden="true">${r}</span> ${e}ā€¦ - </button>`,i=bn`<li role="menuitem">${o}</li>`;return i.addEventListener("click",t),Dr.appendChild(i),o},error(e){Hr(e,Mr,"error","ReSpec Errors")},warning(e){Hr(e,qr,"warning","ReSpec Warnings")},closeModal(e){Or&&(Or.classList.remove("respec-show-overlay"),Or.classList.add("respec-hide-overlay"),Or.addEventListener("transitionend",(()=>{Or.remove(),Or=null}))),e&&e.setAttribute("aria-expanded","false"),jr&&(jr.remove(),jr=null,Ur.focus())},freshModal(e,t,n){jr&&jr.remove(),Or&&Or.remove(),Or=bn`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,s=`${r}-heading`;jr=bn`<div + </button>`,i=mn`<li role="menuitem">${o}</li>`;return i.addEventListener("click",t),jr.appendChild(i),o},error(e){Vr(e,zr,"error","ReSpec Errors")},warning(e){Vr(e,Ur,"warning","ReSpec Warnings")},closeModal(e){qr&&(qr.classList.remove("respec-show-overlay"),qr.classList.add("respec-hide-overlay"),qr.addEventListener("transitionend",(()=>{qr.remove(),qr=null}))),e&&e.setAttribute("aria-expanded","false"),Mr&&(Mr.remove(),Mr=null,Fr.focus())},freshModal(e,t,n){Mr&&Mr.remove(),qr&&qr.remove(),qr=mn`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,s=`${r}-heading`;Mr=mn`<div id="${r}" class="respec-modal removeOnSave" role="dialog" aria-labelledby="${s}" > - ${Nr} + ${Or} <h3 id="${s}">${e}</h3> <div class="inside">${t}</div> - </div>`;const o=new Map([["labelledby",s]]);Pr(jr,o),document.body.append(Or,jr),Or.addEventListener("click",(()=>this.closeModal(n))),Or.classList.toggle("respec-show-overlay"),jr.hidden=!1,Fr(jr)}};function Vr(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${Rr(`<p class="respec-hint"><strong>How to fix:</strong> ${fr(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred <strong>${e.elements.length}</strong> times at:</p>\n ${Rr(e.elements.map(Yr).join("\n"))}`:"",s=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${Rr(`**${Nn(e.message)}**`,{inline:!0})}${n}${r}${s}${t}`}function Yr(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function Kr(e){try{Gr.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await $r(e)}finally{Gr.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&Gr.closeModal()})),window.respecUI=Gr,o("error",(e=>Gr.error(e))),o("warn",(e=>Gr.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const Zr=[Promise.resolve().then((function(){return Jr})),Promise.resolve().then((function(){return u})),Promise.resolve().then((function(){return ts})),Promise.resolve().then((function(){return Ys})),Promise.resolve().then((function(){return Js})),Promise.resolve().then((function(){return no})),Promise.resolve().then((function(){return co})),Promise.resolve().then((function(){return bo})),Promise.resolve().then((function(){return Lr})),Promise.resolve().then((function(){return yo})),Promise.resolve().then((function(){return $o})),Promise.resolve().then((function(){return _o})),Promise.resolve().then((function(){return Ws})),Promise.resolve().then((function(){return Ro})),Promise.resolve().then((function(){return Eo})),Promise.resolve().then((function(){return Lo})),Promise.resolve().then((function(){return zi})),Promise.resolve().then((function(){return Fi})),Promise.resolve().then((function(){return Xi})),Promise.resolve().then((function(){return ea})),Promise.resolve().then((function(){return sa})),Promise.resolve().then((function(){return la})),Promise.resolve().then((function(){return ha})),Promise.resolve().then((function(){return ba})),Promise.resolve().then((function(){return wa})),Promise.resolve().then((function(){return Ua})),Promise.resolve().then((function(){return ai})),Promise.resolve().then((function(){return ac})),Promise.resolve().then((function(){return kc})),Promise.resolve().then((function(){return Ja})),Promise.resolve().then((function(){return yi})),Promise.resolve().then((function(){return Nc})),Promise.resolve().then((function(){return Oc})),Promise.resolve().then((function(){return fo})),Promise.resolve().then((function(){return Mc})),Promise.resolve().then((function(){return qc})),Promise.resolve().then((function(){return Vc})),Promise.resolve().then((function(){return Kc})),Promise.resolve().then((function(){return Jc})),Promise.resolve().then((function(){return rl})),Promise.resolve().then((function(){return pl})),Promise.resolve().then((function(){return gl})),Promise.resolve().then((function(){return vl})),Promise.resolve().then((function(){return _l})),Promise.resolve().then((function(){return Tl})),Promise.resolve().then((function(){return Ll})),Promise.resolve().then((function(){return Ol})),Promise.resolve().then((function(){return Bl})),Promise.resolve().then((function(){return Ea})),Promise.resolve().then((function(){return Jl})),Promise.resolve().then((function(){return nu})),Promise.resolve().then((function(){return cu})),Promise.resolve().then((function(){return uu})),Promise.resolve().then((function(){return pu})),Promise.resolve().then((function(){return vu})),Promise.resolve().then((function(){return xu})),Promise.resolve().then((function(){return Eu})),Promise.resolve().then((function(){return Au})),Promise.resolve().then((function(){return Tu})),Promise.resolve().then((function(){return Pu})),Promise.resolve().then((function(){return Nu})),Promise.resolve().then((function(){return qu})),Promise.resolve().then((function(){return Wu})),Promise.resolve().then((function(){return Gu})),Promise.resolve().then((function(){return Ku})),Promise.resolve().then((function(){return ed})),Promise.resolve().then((function(){return rd})),Promise.resolve().then((function(){return id})),Promise.resolve().then((function(){return pd})),Promise.resolve().then((function(){return md})),Promise.resolve().then((function(){return yd})),Promise.resolve().then((function(){return kd})),Promise.resolve().then((function(){return Cd}))];Promise.all(Zr).then((e=>Kr(e))).catch((e=>console.error(e)));var Jr=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){window.location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(window.location.hash).slice(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}window.location.hash=`#${e}`}))}});const Qr="w3c/group",Xr="https://respec.org/w3c/groups/";async function es(e){let t="",n=e;e.includes("/")&&([t,n]=e.split("/",2));const r=new URL(`${n}/${t}`,Xr),s=await Un(r.href);if(s.ok){const e=await s.json(),{id:t,name:n,patentURI:r,patentPolicy:o,type:i,wgURI:a}=e;return{wg:n,wgId:t,wgURI:a,wgPatentURI:r,wgPatentPolicy:o,groupType:i}}const o=await s.text();let i,a=`Failed to fetch group details (HTTP: ${s.status}).`;409===s.status?[a,i]=o.split("\n",2):404===s.status&&(i=pr`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${"[group]"} configuration option.`),or(a,Qr,{hint:i})}var ts=Object.freeze({__proto__:null,name:Qr,run:async function(e){if(!e.group)return;const{group:t}=e,n=Array.isArray(t)?await async function(e){const t=await Promise.all(e.map(es)),n={wg:[],wgId:[],wgURI:[],wgPatentURI:[],wgPatentPolicy:[],groupType:[]};for(const e of t.filter(Boolean))for(const t of Object.keys(n))n[t].push(e[t]);return n}(t):await es(t);Object.assign(e,n)}});function ns(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return ir(t,"core/templates/show-link"),void console.warn(t,e)}return bn` + </div>`;const o=new Map([["labelledby",s]]);Dr(Mr,o),document.body.append(qr,Mr),qr.addEventListener("click",(()=>this.closeModal(n))),qr.classList.toggle("respec-show-overlay"),Mr.hidden=!1,Hr(Mr)}};function Kr(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${Ar(`<p class="respec-hint"><strong>How to fix:</strong> ${dr(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred <strong>${e.elements.length}</strong> times at:</p>\n ${Ar(e.elements.map(Zr).join("\n"))}`:"",s=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${Ar(`**${In(e.message)}**`,{inline:!0})}${n}${r}${s}${t}`}function Zr(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function Jr(e){try{Yr.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await xr(e)}finally{Yr.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&Yr.closeModal()})),window.respecUI=Yr,hr("error",(e=>Yr.error(e))),hr("warn",(e=>Yr.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const Qr=[Promise.resolve().then((function(){return Xr})),Promise.resolve().then((function(){return i})),Promise.resolve().then((function(){return rs})),Promise.resolve().then((function(){return Zs})),Promise.resolve().then((function(){return Xs})),Promise.resolve().then((function(){return so})),Promise.resolve().then((function(){return uo})),Promise.resolve().then((function(){return wo})),Promise.resolve().then((function(){return Ir})),Promise.resolve().then((function(){return vo})),Promise.resolve().then((function(){return xo})),Promise.resolve().then((function(){return Co})),Promise.resolve().then((function(){return Bs})),Promise.resolve().then((function(){return Ao})),Promise.resolve().then((function(){return To})),Promise.resolve().then((function(){return Io})),Promise.resolve().then((function(){return Wi})),Promise.resolve().then((function(){return Hi})),Promise.resolve().then((function(){return ta})),Promise.resolve().then((function(){return na})),Promise.resolve().then((function(){return ia})),Promise.resolve().then((function(){return da})),Promise.resolve().then((function(){return ga})),Promise.resolve().then((function(){return wa})),Promise.resolve().then((function(){return $a})),Promise.resolve().then((function(){return Fa})),Promise.resolve().then((function(){return li})),Promise.resolve().then((function(){return lc})),Promise.resolve().then((function(){return _c})),Promise.resolve().then((function(){return Xa})),Promise.resolve().then((function(){return vi})),Promise.resolve().then((function(){return Oc})),Promise.resolve().then((function(){return qc})),Promise.resolve().then((function(){return mo})),Promise.resolve().then((function(){return zc})),Promise.resolve().then((function(){return Uc})),Promise.resolve().then((function(){return Kc})),Promise.resolve().then((function(){return Jc})),Promise.resolve().then((function(){return Xc})),Promise.resolve().then((function(){return ol})),Promise.resolve().then((function(){return hl})),Promise.resolve().then((function(){return yl})),Promise.resolve().then((function(){return kl})),Promise.resolve().then((function(){return Cl})),Promise.resolve().then((function(){return Pl})),Promise.resolve().then((function(){return Il})),Promise.resolve().then((function(){return ql})),Promise.resolve().then((function(){return Gl})),Promise.resolve().then((function(){return Ta})),Promise.resolve().then((function(){return Xl})),Promise.resolve().then((function(){return su})),Promise.resolve().then((function(){return uu})),Promise.resolve().then((function(){return pu})),Promise.resolve().then((function(){return hu})),Promise.resolve().then((function(){return ku})),Promise.resolve().then((function(){return Su})),Promise.resolve().then((function(){return Tu})),Promise.resolve().then((function(){return Lu})),Promise.resolve().then((function(){return Pu})),Promise.resolve().then((function(){return Du})),Promise.resolve().then((function(){return Ou})),Promise.resolve().then((function(){return Uu})),Promise.resolve().then((function(){return Bu})),Promise.resolve().then((function(){return Yu})),Promise.resolve().then((function(){return Ju})),Promise.resolve().then((function(){return nd})),Promise.resolve().then((function(){return od})),Promise.resolve().then((function(){return cd})),Promise.resolve().then((function(){return hd})),Promise.resolve().then((function(){return bd})),Promise.resolve().then((function(){return vd})),Promise.resolve().then((function(){return _d})),Promise.resolve().then((function(){return Ed}))];Promise.all(Qr).then((e=>Jr(e))).catch((e=>console.error(e)));var Xr=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){window.location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(window.location.hash).slice(1);const t=document.getElementById(e),n=/\W/.test(e);if(!t&&n){const t=e.replace(/[\W]+/gim,"-").replace(/^-+/,"").replace(/-+$/,"");document.getElementById(t)&&(e=t)}window.location.hash=`#${e}`}))}});const es="w3c/group",ts="https://respec.org/w3c/groups/";async function ns(e){let t="",n=e;e.includes("/")&&([t,n]=e.split("/",2));const r=new URL(`${n}/${t}`,ts),s=await qn(r.href);if(s.ok){const e=await s.json(),{id:t,name:n,patentURI:r,patentPolicy:o,type:i,wgURI:a}=e;return{wg:n,wgId:t,wgURI:a,wgPatentURI:r,wgPatentPolicy:o,groupType:i}}const o=await s.text();let i,a=`Failed to fetch group details (HTTP: ${s.status}).`;409===s.status?[a,i]=o.split("\n",2):404===s.status&&(i=ur`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${"[group]"} configuration option.`),rr(a,es,{hint:i})}var rs=Object.freeze({__proto__:null,name:es,run:async function(e){if(!e.group)return;const{group:t}=e,n=Array.isArray(t)?await async function(e){const t=await Promise.all(e.map(ns)),n={wg:[],wgId:[],wgURI:[],wgPatentURI:[],wgPatentPolicy:[],groupType:[]};for(const e of t.filter(Boolean))for(const t of Object.keys(n))n[t].push(e[t]);return n}(t):await ns(t);Object.assign(e,n)}});function ss(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return sr(t,"core/templates/show-link"),void console.warn(t,e)}return mn` <dt class="${e.class?e.class:null}">${e.key}</dt> - ${e.data?e.data.map(rs):rs(e)} - `}function rs(e){return bn`<dd class="${e.class?e.class:null}"> - ${e.href?bn`<a href="${e.href}">${e.value||e.href}</a>`:e.value} - </dd>`}const ss="core/templates/show-logo";function os(e,t){const n=bn`<a href="${e.url||null}" class="logo" + ${e.data?e.data.map(os):os(e)} + `}function os(e){return mn`<dd class="${e.class?e.class:null}"> + ${e.href?mn`<a href="${e.href}">${e.value||e.href}</a>`:e.value} + </dd>`}const is="core/templates/show-logo";function as(e,t){const n=mn`<a href="${e.url||null}" class="logo" ><img alt="${e.alt||null}" crossorigin @@ -108,7 +108,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} src="${e.src||null}" width="${e.width||null}" /> - </a>`;if(!e.alt){const r=pr`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;or(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,ss,{hint:r,elements:[n]})}if(!e.src){const e=pr`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;or(`Logo at index ${t} is missing "\`src\`" property.`,ss,{hint:e,elements:[n]})}return n}const is="core/templates/show-people",as=On({en:{until:e=>bn` Until ${e} `},es:{until:e=>bn` Hasta ${e} `},ko:{until:e=>bn` ${e} ģ“ģ „ `},ja:{until:e=>bn` ${e} 仄前 `},de:{until:e=>bn` bis ${e} `},zh:{until:e=>bn` ē›“到 ${e} `}}),cs=()=>bn`<svg + </a>`;if(!e.alt){const r=ur`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;rr(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,is,{hint:r,elements:[n]})}if(!e.src){const e=ur`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;rr(`Logo at index ${t} is missing "\`src\`" property.`,is,{hint:e,elements:[n]})}return n}const cs="core/templates/show-people",ls=Nn({en:{until:e=>mn` Until ${e} `},es:{until:e=>mn` Hasta ${e} `},ko:{until:e=>mn` ${e} ģ“ģ „ `},ja:{until:e=>mn` ${e} 仄前 `},de:{until:e=>mn` bis ${e} `},zh:{until:e=>mn` ē›“到 ${e} `}}),us=()=>mn`<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" @@ -127,104 +127,104 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} class="st1" d="M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z" /> - </svg>`;function ls(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(s=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,o=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${s}\`](${n}#${s})" configuration option.`;if(!e.name)return or(`${o} Missing required property \`"name"\`.`,is,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${o} ORCID "${e.orcid}" at index ${t} is invalid.`,s=`The origin should be "https://orcid.org", not "${r.origin}".`;return or(n,is,{hint:s}),!1}const s=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(s))return or(`${o} ORCID "${s}" has wrong format.`,is,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=e.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0),r=(12-n%11)%11,s=10===r?"X":String(r);return t===s}(n))return or(`${o} ORCID "${n}" failed checksum check.`,is,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(i=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(i)?new Date(i):"Invalid Date").toString())?(or(`${o} The property "\`retiredDate\`" is not a valid date.`,is,{hint:`The expected format is YYYY-MM-DD. ${r}`}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every(((e,r)=>{switch(!0){case"object"!=typeof e:return or(`${n}. Member "extra" at index ${r} is not an object.`,is,{hint:t}),!1;case!e.hasOwnProperty("name"):return or(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,is,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return or(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,is,{hint:t}),!1}return!0})):(or(`${n}. A person's "extras" member must be an array.`,is,{hint:t}),!1)}(e.extras,r,o))&&(e.url&&e.mailto&&ir(`${o} Has both "url" and "mailto" property.`,is,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&ir(`${o} Has a "\`companyURL\`" property but no "\`company\`" property.`,is,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var i});var s;return n.filter(r).map(us)}function us(e){const t=[e.name],n=[e.company],r=e.w3cid||null,s=[];if(e.mailto&&(e.url=`mailto:${e.mailto}`),e.url){const n="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";s.push(bn`<a class="${n}" href="${e.url}">${t}</a>`)}else s.push(bn`<span class="p-name fn">${t}</span>`);if(e.orcid&&s.push(bn`<a class="p-name orcid" href="${e.orcid}">${cs()}</a>`),e.company){const t="p-org org h-org",r=e.companyURL?bn`<a class="${t}" href="${e.companyURL}">${n}</a>`:bn`<span class="${t}">${n}</span>`;s.push(bn` (${r})`)}e.note&&s.push(document.createTextNode(` (${e.note})`)),e.extras&&s.push(...e.extras.map((e=>bn`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?bn`<a href="${r}" class="${t}">${n}</a>`:bn`<span class="${t}">${n}</span>`}(e)}`)));const{retiredDate:o}=e;if(e.retiredDate){const e=bn`<time datetime="${o}" - >${Cn.format(new Date(o))}</time - >`;s.push(bn` - ${as.until(e)} `)}return bn`<dd + </svg>`;function ds(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(s=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,o=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${s}\`](${n}#${s})" configuration option.`;if(!e.name)return rr(`${o} Missing required property \`"name"\`.`,cs,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${o} ORCID "${e.orcid}" at index ${t} is invalid.`,s=`The origin should be "https://orcid.org", not "${r.origin}".`;return rr(n,cs,{hint:s}),!1}const s=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(s))return rr(`${o} ORCID "${s}" has wrong format.`,cs,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=e.split("").slice(0,-1).filter((e=>/\d/.test(e))).map(Number).reduce(((e,t)=>2*(e+t)),0),r=(12-n%11)%11,s=10===r?"X":String(r);return t===s}(n))return rr(`${o} ORCID "${n}" failed checksum check.`,cs,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(i=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(i)?new Date(i):"Invalid Date").toString())?(rr(`${o} The property "\`retiredDate\`" is not a valid date.`,cs,{hint:`The expected format is YYYY-MM-DD. ${r}`}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every(((e,r)=>{switch(!0){case"object"!=typeof e:return rr(`${n}. Member "extra" at index ${r} is not an object.`,cs,{hint:t}),!1;case!e.hasOwnProperty("name"):return rr(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,cs,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return rr(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,cs,{hint:t}),!1}return!0})):(rr(`${n}. A person's "extras" member must be an array.`,cs,{hint:t}),!1)}(e.extras,r,o))&&(e.url&&e.mailto&&sr(`${o} Has both "url" and "mailto" property.`,cs,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&sr(`${o} Has a "\`companyURL\`" property but no "\`company\`" property.`,cs,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var i});var s;return n.filter(r).map(ps)}function ps(e){const t=[e.name],n=[e.company],r=e.w3cid||null,s=[];if(e.mailto&&(e.url=`mailto:${e.mailto}`),e.url){const n="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";s.push(mn`<a class="${n}" href="${e.url}">${t}</a>`)}else s.push(mn`<span class="p-name fn">${t}</span>`);if(e.orcid&&s.push(mn`<a class="p-name orcid" href="${e.orcid}">${us()}</a>`),e.company){const t="p-org org h-org",r=e.companyURL?mn`<a class="${t}" href="${e.companyURL}">${n}</a>`:mn`<span class="${t}">${n}</span>`;s.push(mn` (${r})`)}e.note&&s.push(document.createTextNode(` (${e.note})`)),e.extras&&s.push(...e.extras.map((e=>mn`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?mn`<a href="${r}" class="${t}">${n}</a>`:mn`<span class="${t}">${n}</span>`}(e)}`)));const{retiredDate:o}=e;if(e.retiredDate){const e=mn`<time datetime="${o}" + >${_n.format(new Date(o))}</time + >`;s.push(mn` - ${ls.until(e)} `)}return mn`<dd class="editor p-author h-card vcard" data-editor-id="${r}" > ${s} - </dd>`}const ds=On({en:{archives:"archives",author:"Author:",authors:"Authors:",commit_history:"Commit history",edited_in_place:"edited in place",editor:"Editor:",editors:"Editors:",feedback:"Feedback:",former_editor:"Former editor:",former_editors:"Former editors:",history:"History:",implementation_report:"Implementation report:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest published version:",latest_recommendation:"Latest Recommendation:",message_topic:"ā€¦ message topic ā€¦",more_details_about_this_doc:"More details about this document",multiple_alternates:e=>`This document is also available in ${e?"these non-normative formats":"this non-normative format"}:`,prev_editor_draft:"Previous editor's draft:",prev_recommendation:"Previous Recommendation:",prev_version:"Previous version:",publication_history:"Publication history",test_suite:"Test suite:",this_version:"This version:",with_subject_line:"with subject line",your_topic_here:"YOUR TOPIC HERE"},ko:{author:"ģ €ģž:",authors:"ģ €ģž:",editor:"ķŽøģ§‘ģž:",editors:"ķŽøģ§‘ģž:",former_editor:"ģ“ģ „ ķŽøģ§‘ģž:",former_editors:"ģ“ģ „ ķŽøģ§‘ģž:",latest_editors_draft:"ģµœģ‹  ķŽøģ§‘ ģ“ˆģ•ˆ:",latest_published_version:"ģµœģ‹  ė²„ģ „:",this_version:"ķ˜„ģž¬ ė²„ģ „:"},zh:{author:"ä½œč€…ļ¼š",authors:"ä½œč€…ļ¼š",commit_history:"Gitꏐäŗ¤åŽ†å²",editor:"ē¼–č¾‘ļ¼š",editors:"ē¼–č¾‘ļ¼š",feedback:"反馈ļ¼š",former_editor:"原ē¼–č¾‘ļ¼š",former_editors:"原ē¼–č¾‘ļ¼š",history:"历史ļ¼š",implementation_report:"实ēŽ°ęŠ„告ļ¼š",latest_editors_draft:"꜀ꖰē¼–č¾‘č‰ēØæļ¼š",latest_published_version:"ęœ€ę–°å‘åøƒē‰ˆęœ¬ļ¼š",latest_recommendation:"ęœ€ę–°å‘åøƒēš„ę­£å¼ęŽØčę ‡å‡†ļ¼š",message_topic:"ā€¦ 邮件äø»é¢˜ ā€¦",prev_editor_draft:"äøŠäø€ē‰ˆē¼–č¾‘č‰ēØæļ¼š",prev_recommendation:"äøŠäø€ē‰ˆę­£å¼ęŽØčę ‡å‡†ļ¼š",prev_version:"äøŠäø€ē‰ˆļ¼š",test_suite:"굋čƕ儗件ļ¼š",this_version:"ęœ¬ē‰ˆęœ¬ļ¼š"},ja:{archives:"ć‚¢ćƒ¼ć‚«ć‚¤ćƒ–",author:"著者ļ¼š",authors:"著者ļ¼š",commit_history:"ę›“ę–°å±„ę­“",edited_in_place:"ę”¹ē‰ˆćŖćę›“ę–°",editor:"ē·Ø者ļ¼š",editors:"ē·Ø者ļ¼š",feedback:"ćƒ•ć‚£ćƒ¼ćƒ‰ćƒćƒƒć‚Æ:",former_editor:"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š",former_editors:"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š",history:"å±„ę­“:",implementation_report:"å®Ÿč£…ćƒ¬ćƒćƒ¼ćƒˆļ¼š",latest_editors_draft:"ęœ€ę–°ć®ē·Ø集ē”Øč‰ę”ˆļ¼š",latest_published_version:"ęœ€ę–°ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š",latest_recommendation:"ęœ€ę–°ć®å‹§å‘Šē‰ˆ:",message_topic:"ā€¦ ćƒ”ćƒ¼ćƒ«ä»¶å ā€¦",more_details_about_this_doc:"恓恮ꖇę›øć«ć¤ć„ć¦ć®ć‚ˆć‚Šč©³ē“°",prev_editor_draft:"å‰å›žć®ē·Ø集ē”Øč‰ę”ˆ:",prev_recommendation:"å‰å›žć®å‹§å‘Šē‰ˆ:",prev_version:"å‰å›žć®ćƒćƒ¼ć‚øćƒ§ćƒ³:",publication_history:"公č”Øå±„ę­“",test_suite:"ćƒ†ć‚¹ćƒˆć‚¹ć‚¤ćƒ¼ćƒˆļ¼š",this_version:"ć“ć®ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š",with_subject_line:"ę¬”ć®ä»¶åć§"},nl:{author:"Auteur:",authors:"Auteurs:",editor:"Redacteur:",editors:"Redacteurs:",latest_editors_draft:"Laatste werkversie:",latest_published_version:"Laatst gepubliceerde versie:",this_version:"Deze versie:"},es:{archives:"archivos",author:"Autor:",authors:"Autores:",commit_history:"Historial de cambios",edited_in_place:"editado en lugar",editor:"Editor:",editors:"Editores:",feedback:"Comentarios:",former_editor:"Antiguo editor:",former_editors:"Antiguos editores:",history:"Historia:",implementation_report:"Informe de implementaciĆ³n:",latest_editors_draft:"ƚltima versiĆ³n del editor:",latest_published_version:"ƚltima versiĆ³n publicada:",latest_recommendation:"RecomendaciĆ³n mĆ”s reciente:",message_topic:"ā€¦ detalles de mensaje ā€¦",more_details_about_this_doc:"MĆ”s detalles sobre este documento:",publication_history:"Historial de publicaciĆ³n",prev_editor_draft:"ƚltima versiĆ³n del editor:",prev_recommendation:"ƚltima RecomendaciĆ³n:",prev_version:"ƚltima versiĆ³n:",test_suite:"Suite de pruebas:",this_version:"Esta versiĆ³n:",with_subject_line:"con lĆ­nea de asunto",your_topic_here:"TU SUJETO AQUƍ"},de:{archives:"Archiv",author:"Autor/in:",authors:"Autor/innen:",commit_history:"Commit-Historie",edited_in_place:"zuletzt geƤndert am",editor:"Redaktion:",editors:"Redaktion:",feedback:"Feedback:",former_editor:"FrĆ¼here Mitwirkende:",former_editors:"FrĆ¼here Mitwirkende:",history:"Verlauf:",implementation_report:"Umsetzungsbericht:",latest_editors_draft:"Letzter Entwurf:",latest_published_version:"Letzte publizierte Fassung:",latest_recommendation:"Aktuellste Empfehlung:",more_details_about_this_doc:"Mehr Informationen Ć¼ber dieses Dokument",multiple_alternates:e=>`Dieses Dokument ist ebenfalls in ${e?"diesen nicht-normativen Formaten verfĆ¼gbar":"diesem nicht-normativen Format verfĆ¼gbar"}:`,prev_editor_draft:"Vorheriger Entwurf:",prev_recommendation:"Vorherige Empfehlung:",prev_version:"Vorherige Version:",publication_history:"Verƶffentlichungsverlauf",test_suite:"Testumgebung:",this_version:"Diese Fassung:"}});function ps(e){let t=document.querySelector("h2#subtitle");return t&&t.parentElement?(t.remove(),e.subtitle=t.textContent.trim()):e.subtitle&&(t=document.createElement("h2"),t.textContent=e.subtitle,t.id="subtitle"),t&&t.classList.add("subtitle"),t}var fs=(e,t)=>(o("beforesave",(e=>{const t=e.querySelector(".head details");t&&(t.open=!0)})),bn`<div class="head"> - ${e.logos.length?bn`<p class="logos">${e.logos.map(os)}</p>`:""} - ${document.querySelector("h1#title")} ${ps(e)} - <p id="w3c-state">${function(e){const t=e.isCR||e.isCRY?e.longStatus:e.textStatus,n=e.prependW3C?bn`<a href="https://www.w3.org/standards/types#${e.specStatus}" + </dd>`}const fs=Nn({en:{archives:"archives",author:"Author:",authors:"Authors:",commit_history:"Commit history",edited_in_place:"edited in place",editor:"Editor:",editors:"Editors:",feedback:"Feedback:",former_editor:"Former editor:",former_editors:"Former editors:",history:"History:",implementation_report:"Implementation report:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest published version:",latest_recommendation:"Latest Recommendation:",message_topic:"ā€¦ message topic ā€¦",more_details_about_this_doc:"More details about this document",multiple_alternates:e=>`This document is also available in ${e?"these non-normative formats":"this non-normative format"}:`,prev_editor_draft:"Previous editor's draft:",prev_recommendation:"Previous Recommendation:",prev_version:"Previous version:",publication_history:"Publication history",test_suite:"Test suite:",this_version:"This version:",with_subject_line:"with subject line",your_topic_here:"YOUR TOPIC HERE"},ko:{author:"ģ €ģž:",authors:"ģ €ģž:",editor:"ķŽøģ§‘ģž:",editors:"ķŽøģ§‘ģž:",former_editor:"ģ“ģ „ ķŽøģ§‘ģž:",former_editors:"ģ“ģ „ ķŽøģ§‘ģž:",latest_editors_draft:"ģµœģ‹  ķŽøģ§‘ ģ“ˆģ•ˆ:",latest_published_version:"ģµœģ‹  ė²„ģ „:",this_version:"ķ˜„ģž¬ ė²„ģ „:"},zh:{author:"ä½œč€…ļ¼š",authors:"ä½œč€…ļ¼š",commit_history:"Gitꏐäŗ¤åŽ†å²",editor:"ē¼–č¾‘ļ¼š",editors:"ē¼–č¾‘ļ¼š",feedback:"反馈ļ¼š",former_editor:"原ē¼–č¾‘ļ¼š",former_editors:"原ē¼–č¾‘ļ¼š",history:"历史ļ¼š",implementation_report:"实ēŽ°ęŠ„告ļ¼š",latest_editors_draft:"꜀ꖰē¼–č¾‘č‰ēØæļ¼š",latest_published_version:"ęœ€ę–°å‘åøƒē‰ˆęœ¬ļ¼š",latest_recommendation:"ęœ€ę–°å‘åøƒēš„ę­£å¼ęŽØčę ‡å‡†ļ¼š",message_topic:"ā€¦ 邮件äø»é¢˜ ā€¦",prev_editor_draft:"äøŠäø€ē‰ˆē¼–č¾‘č‰ēØæļ¼š",prev_recommendation:"äøŠäø€ē‰ˆę­£å¼ęŽØčę ‡å‡†ļ¼š",prev_version:"äøŠäø€ē‰ˆļ¼š",test_suite:"굋čƕ儗件ļ¼š",this_version:"ęœ¬ē‰ˆęœ¬ļ¼š"},ja:{archives:"ć‚¢ćƒ¼ć‚«ć‚¤ćƒ–",author:"著者ļ¼š",authors:"著者ļ¼š",commit_history:"ę›“ę–°å±„ę­“",edited_in_place:"ę”¹ē‰ˆćŖćę›“ę–°",editor:"ē·Ø者ļ¼š",editors:"ē·Ø者ļ¼š",feedback:"ćƒ•ć‚£ćƒ¼ćƒ‰ćƒćƒƒć‚Æ:",former_editor:"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š",former_editors:"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š",history:"å±„ę­“:",implementation_report:"å®Ÿč£…ćƒ¬ćƒćƒ¼ćƒˆļ¼š",latest_editors_draft:"ęœ€ę–°ć®ē·Ø集ē”Øč‰ę”ˆļ¼š",latest_published_version:"ęœ€ę–°ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š",latest_recommendation:"ęœ€ę–°ć®å‹§å‘Šē‰ˆ:",message_topic:"ā€¦ ćƒ”ćƒ¼ćƒ«ä»¶å ā€¦",more_details_about_this_doc:"恓恮ꖇę›øć«ć¤ć„ć¦ć®ć‚ˆć‚Šč©³ē“°",prev_editor_draft:"å‰å›žć®ē·Ø集ē”Øč‰ę”ˆ:",prev_recommendation:"å‰å›žć®å‹§å‘Šē‰ˆ:",prev_version:"å‰å›žć®ćƒćƒ¼ć‚øćƒ§ćƒ³:",publication_history:"公č”Øå±„ę­“",test_suite:"ćƒ†ć‚¹ćƒˆć‚¹ć‚¤ćƒ¼ćƒˆļ¼š",this_version:"ć“ć®ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š",with_subject_line:"ę¬”ć®ä»¶åć§"},nl:{author:"Auteur:",authors:"Auteurs:",editor:"Redacteur:",editors:"Redacteurs:",latest_editors_draft:"Laatste werkversie:",latest_published_version:"Laatst gepubliceerde versie:",this_version:"Deze versie:"},es:{archives:"archivos",author:"Autor:",authors:"Autores:",commit_history:"Historial de cambios",edited_in_place:"editado en lugar",editor:"Editor:",editors:"Editores:",feedback:"Comentarios:",former_editor:"Antiguo editor:",former_editors:"Antiguos editores:",history:"Historia:",implementation_report:"Informe de implementaciĆ³n:",latest_editors_draft:"ƚltima versiĆ³n del editor:",latest_published_version:"ƚltima versiĆ³n publicada:",latest_recommendation:"RecomendaciĆ³n mĆ”s reciente:",message_topic:"ā€¦ detalles de mensaje ā€¦",more_details_about_this_doc:"MĆ”s detalles sobre este documento:",publication_history:"Historial de publicaciĆ³n",prev_editor_draft:"ƚltima versiĆ³n del editor:",prev_recommendation:"ƚltima RecomendaciĆ³n:",prev_version:"ƚltima versiĆ³n:",test_suite:"Suite de pruebas:",this_version:"Esta versiĆ³n:",with_subject_line:"con lĆ­nea de asunto",your_topic_here:"TU SUJETO AQUƍ"},de:{archives:"Archiv",author:"Autor/in:",authors:"Autor/innen:",commit_history:"Commit-Historie",edited_in_place:"zuletzt geƤndert am",editor:"Redaktion:",editors:"Redaktion:",feedback:"Feedback:",former_editor:"FrĆ¼here Mitwirkende:",former_editors:"FrĆ¼here Mitwirkende:",history:"Verlauf:",implementation_report:"Umsetzungsbericht:",latest_editors_draft:"Letzter Entwurf:",latest_published_version:"Letzte publizierte Fassung:",latest_recommendation:"Aktuellste Empfehlung:",more_details_about_this_doc:"Mehr Informationen Ć¼ber dieses Dokument",multiple_alternates:e=>`Dieses Dokument ist ebenfalls in ${e?"diesen nicht-normativen Formaten verfĆ¼gbar":"diesem nicht-normativen Format verfĆ¼gbar"}:`,prev_editor_draft:"Vorheriger Entwurf:",prev_recommendation:"Vorherige Empfehlung:",prev_version:"Vorherige Version:",publication_history:"Verƶffentlichungsverlauf",test_suite:"Testumgebung:",this_version:"Diese Fassung:"}});function hs(e){let t=document.querySelector("h2#subtitle");return t&&t.parentElement?(t.remove(),e.subtitle=t.textContent.trim()):e.subtitle&&(t=document.createElement("h2"),t.textContent=e.subtitle,t.id="subtitle"),t&&t.classList.add("subtitle"),t}var ms=(e,t)=>(hr("beforesave",(e=>{const t=e.querySelector(".head details");t&&(t.open=!0)})),mn`<div class="head"> + ${e.logos.length?mn`<p class="logos">${e.logos.map(as)}</p>`:""} + ${document.querySelector("h1#title")} ${hs(e)} + <p id="w3c-state">${function(e){const t=e.isCR||e.isCRY?e.longStatus:e.textStatus,n=e.prependW3C?mn`<a href="https://www.w3.org/standards/types#${e.specStatus}" >W3C ${t}</a - >`:bn`${t}`;return bn`${n}${" "} + >`:mn`${t}`;return mn`${n}${" "} <time class="dt-published" datetime="${e.dashDate}" - >${Cn.format(e.publishDate)}</time - >${e.modificationDate?bn`, ${ds.edited_in_place}${" "} + >${_n.format(e.publishDate)}</time + >${e.modificationDate?mn`, ${fs.edited_in_place}${" "} <time class="dt-modified" - datetime="${_n.format(e.modificationDate)}" - >${Cn.format(e.modificationDate)}</time + datetime="${kn.format(e.modificationDate)}" + >${_n.format(e.modificationDate)}</time >`:""}`}(e)}</p> <details open="${localStorage.getItem("tr-metadata")||"true"}"> - <summary>${ds.more_details_about_this_doc}</summary> + <summary>${fs.more_details_about_this_doc}</summary> <dl> - ${e.thisVersion?bn`<dt>${ds.this_version}</dt> + ${e.thisVersion?mn`<dt>${fs.this_version}</dt> <dd> <a class="u-url" href="${e.thisVersion}" >${e.thisVersion}</a > </dd>`:""} - ${"latestVersion"in e?bn`<dt>${ds.latest_published_version}</dt> + ${"latestVersion"in e?mn`<dt>${fs.latest_published_version}</dt> <dd> - ${e.latestVersion?bn`<a href="${e.latestVersion}" + ${e.latestVersion?mn`<a href="${e.latestVersion}" >${e.latestVersion}</a >`:"none"} </dd>`:""} - ${e.edDraftURI?bn` - <dt>${ds.latest_editors_draft}</dt> + ${e.edDraftURI?mn` + <dt>${fs.latest_editors_draft}</dt> <dd><a href="${e.edDraftURI}">${e.edDraftURI}</a></dd> `:""} - ${e.historyURI||e.github?bn`<dt>${ds.history}</dt> - ${e.historyURI?bn`<dd> + ${e.historyURI||e.github?mn`<dt>${fs.history}</dt> + ${e.historyURI?mn`<dd> <a href="${e.historyURI}">${e.historyURI}</a> </dd>`:""} - ${e.github?bn`<dd> + ${e.github?mn`<dd> <a href="${e.github.commitHistoryURL}" - >${ds.commit_history}</a + >${fs.commit_history}</a > </dd>`:""}`:""} - ${e.testSuiteURI?bn` - <dt>${ds.test_suite}</dt> + ${e.testSuiteURI?mn` + <dt>${fs.test_suite}</dt> <dd><a href="${e.testSuiteURI}">${e.testSuiteURI}</a></dd> `:""} - ${e.implementationReportURI?bn` - <dt>${ds.implementation_report}</dt> + ${e.implementationReportURI?mn` + <dt>${fs.implementation_report}</dt> <dd> <a href="${e.implementationReportURI}" >${e.implementationReportURI}</a > </dd> `:""} - ${e.prevED?bn` - <dt>${ds.prev_editor_draft}</dt> + ${e.prevED?mn` + <dt>${fs.prev_editor_draft}</dt> <dd><a href="${e.prevED}">${e.prevED}</a></dd> `:""} - ${e.showPreviousVersion?bn` - <dt>${ds.prev_version}</dt> + ${e.showPreviousVersion?mn` + <dt>${fs.prev_version}</dt> <dd><a href="${e.prevVersion}">${e.prevVersion}</a></dd> `:""} - ${e.prevRecURI?e.isRec?bn` - <dt>${ds.prev_recommendation}</dt> + ${e.prevRecURI?e.isRec?mn` + <dt>${fs.prev_recommendation}</dt> <dd><a href="${e.prevRecURI}">${e.prevRecURI}</a></dd> - `:bn` - <dt>${ds.latest_recommendation}</dt> + `:mn` + <dt>${fs.latest_recommendation}</dt> <dd><a href="${e.prevRecURI}">${e.prevRecURI}</a></dd> `:""} - ${e.editors.length?bn` - <dt>${e.editors.length>1?ds.editors:ds.editor}</dt> - ${ls(e,"editors")} + ${e.editors.length?mn` + <dt>${e.editors.length>1?fs.editors:fs.editor}</dt> + ${ds(e,"editors")} `:""} - ${e.formerEditors.length?bn` + ${e.formerEditors.length?mn` <dt> - ${e.formerEditors.length>1?ds.former_editors:ds.former_editor} + ${e.formerEditors.length>1?fs.former_editors:fs.former_editor} </dt> - ${ls(e,"formerEditors")} + ${ds(e,"formerEditors")} `:""} - ${e.authors.length?bn` - <dt>${e.authors.length>1?ds.authors:ds.author}</dt> - ${ls(e,"authors")} + ${e.authors.length?mn` + <dt>${e.authors.length>1?fs.authors:fs.author}</dt> + ${ds(e,"authors")} `:""} - ${e.github||e.wgPublicList?bn`<dt>${ds.feedback}</dt> - ${hs(e)}`:""} - ${e.errata?bn`<dt>Errata:</dt> + ${e.github||e.wgPublicList?mn`<dt>${fs.feedback}</dt> + ${gs(e)}`:""} + ${e.errata?mn`<dt>Errata:</dt> <dd><a href="${e.errata}">Errata exists</a>.</dd>`:""} - ${e.otherLinks?e.otherLinks.map(ns):""} + ${e.otherLinks?e.otherLinks.map(ss):""} </dl> </details> - ${e.isRec?bn`<p> + ${e.isRec?mn`<p> See also <a href="${`https://www.w3.org/Translations/?technology=${e.shortName}`}" @@ -232,75 +232,75 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} <strong>translations</strong></a >. </p>`:""} - ${e.alternateFormats?bn`<p> - ${ds.multiple_alternates(t.multipleAlternates)} + ${e.alternateFormats?mn`<p> + ${fs.multiple_alternates(t.multipleAlternates)} ${t.alternatesHTML} </p>`:""} - ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;if(e.isUnofficial&&e.licenseInfo)return bn`<p class="copyright"> + ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;if(e.isUnofficial&&e.licenseInfo)return mn`<p class="copyright"> Copyright © ${e.copyrightStart?`${e.copyrightStart}-`:""}${e.publishYear} the document editors/authors. - ${"unlicensed"!==e.licenseInfo.name?bn`Text is available under the + ${"unlicensed"!==e.licenseInfo.name?mn`Text is available under the <a rel="license" href="${e.licenseInfo.url}" >${e.licenseInfo.name}</a >; additional terms may apply.`:""} - </p>`;return function(e){return bn`<p class="copyright"> + </p>`;return function(e){return mn`<p class="copyright"> <a href="https://www.w3.org/policies/#copyright">Copyright</a> © ${e.copyrightStart?`${e.copyrightStart}-`:""}${e.publishYear} - ${e.additionalCopyrightHolders?bn` ${[e.additionalCopyrightHolders]} & `:""} + ${e.additionalCopyrightHolders?mn` ${[e.additionalCopyrightHolders]} & `:""} <a href="https://www.w3.org/">World Wide Web Consortium</a>. <abbr title="World Wide Web Consortium">W3C</abbr><sup>®</sup> <a href="https://www.w3.org/policies/#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/policies/#W3C_Trademarks">trademark</a - >${function(e){const{url:t,short:n,name:r}=e;if("unlicensed"===r)return bn`. <span class="issue">THIS DOCUMENT IS UNLICENSED</span>.`;return bn` and + >${function(e){const{url:t,short:n,name:r}=e;if("unlicensed"===r)return mn`. <span class="issue">THIS DOCUMENT IS UNLICENSED</span>.`;return mn` and <a rel="license" href="${t}" title="${r}">${n}</a> rules apply.`}(e.licenseInfo)} </p>`}(e)}(e)} <hr title="Separator for header" /> - </div>`);function hs(e){const t=[];if(e.github){const{repoURL:n,issuesURL:r,newIssuesURL:s,pullsURL:o,fullName:i}=e.github;t.push(bn`<dd> + </div>`);function gs(e){const t=[];if(e.github){const{repoURL:n,issuesURL:r,newIssuesURL:s,pullsURL:o,fullName:i}=e.github;t.push(mn`<dd> <a href="${n}">GitHub ${i}</a> (<a href="${o}">pull requests</a>, <a href="${s}">new issue</a>, <a href="${r}">open issues</a>) - </dd>`)}if(e.wgPublicList){const n=new URL(`mailto:${e.wgPublicList}@w3.org`),r=e.subjectPrefix??`[${e.shortName}] ${ds.your_topic_here}`,s=bn`<a + </dd>`)}if(e.wgPublicList){const n=new URL(`mailto:${e.wgPublicList}@w3.org`),r=e.subjectPrefix??`[${e.shortName}] ${fs.your_topic_here}`,s=mn`<a href="${n.href}?subject=${encodeURIComponent(r)}" >${n.pathname}</a - >`,o=e.subjectPrefix||bn`[${e.shortName}] <em>${ds.message_topic}</em>`,i=bn`${ds.with_subject_line}${" "} - <kbd>${o}</kbd>`,a=new URL(e.wgPublicList,"https://lists.w3.org/Archives/Public/"),c=bn`(<a href="${a}" rel="discussion" - >${ds.archives}</a - >)`;t.push(bn`<dd>${s} ${i} ${c}</dd>`)}return t}var ms=(e,t)=>{const n=document.querySelector(".copyright");n&&n.remove();const r=document.querySelector("h1#title"),s=r.cloneNode(!0);return bn`<div class="head"> - ${e.logos.length?bn`<p class="logos">${e.logos.map(os)}</p>`:""} - ${r} ${ps(e)} + >`,o=e.subjectPrefix||mn`[${e.shortName}] <em>${fs.message_topic}</em>`,i=mn`${fs.with_subject_line}${" "} + <kbd>${o}</kbd>`,a=new URL(e.wgPublicList,"https://lists.w3.org/Archives/Public/"),c=mn`(<a href="${a}" rel="discussion" + >${fs.archives}</a + >)`;t.push(mn`<dd>${s} ${i} ${c}</dd>`)}return t}var bs=(e,t)=>{const n=document.querySelector(".copyright");n&&n.remove();const r=document.querySelector("h1#title"),s=r.cloneNode(!0);return mn`<div class="head"> + ${e.logos.length?mn`<p class="logos">${e.logos.map(as)}</p>`:""} + ${r} ${hs(e)} <p id="w3c-state"> <a href="https://www.w3.org/standards/types#reports" >${e.longStatus}</a > <time class="dt-published" datetime="${e.dashDate}" - >${Cn.format(e.publishDate)}</time + >${_n.format(e.publishDate)}</time > </p> <dl> - ${e.thisVersion?bn`<dt>${ds.this_version}</dt> + ${e.thisVersion?mn`<dt>${fs.this_version}</dt> <dd> <a class="u-url" href="${e.thisVersion}" >${e.thisVersion}</a > </dd>`:""} - ${"latestVersion"in e?bn`<dt>${ds.latest_published_version}</dt> + ${"latestVersion"in e?mn`<dt>${fs.latest_published_version}</dt> <dd> - ${e.latestVersion?bn`<a href="${e.latestVersion}" + ${e.latestVersion?mn`<a href="${e.latestVersion}" >${e.latestVersion}</a >`:"none"} </dd>`:""} - ${e.edDraftURI?bn` - <dt>${ds.latest_editors_draft}</dt> + ${e.edDraftURI?mn` + <dt>${fs.latest_editors_draft}</dt> <dd><a href="${e.edDraftURI}">${e.edDraftURI}</a></dd> `:""} - ${e.testSuiteURI?bn` + ${e.testSuiteURI?mn` <dt>Test suite:</dt> <dd><a href="${e.testSuiteURI}">${e.testSuiteURI}</a></dd> `:""} - ${e.implementationReportURI?bn` + ${e.implementationReportURI?mn` <dt>Implementation report:</dt> <dd> <a href="${e.implementationReportURI}" @@ -308,47 +308,47 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} > </dd> `:""} - ${e.prevVersion?bn` + ${e.prevVersion?mn` <dt>Previous version:</dt> <dd><a href="${e.prevVersion}">${e.prevVersion}</a></dd> `:""} - ${e.isCGFinal?"":bn` - ${e.prevED?bn` + ${e.isCGFinal?"":mn` + ${e.prevED?mn` <dt>Previous editor's draft:</dt> <dd><a href="${e.prevED}">${e.prevED}</a></dd> `:""} `} - ${e.editors.length?bn` - <dt>${e.editors.length>1?ds.editors:ds.editor}</dt> - ${ls(e,"editors")} + ${e.editors.length?mn` + <dt>${e.editors.length>1?fs.editors:fs.editor}</dt> + ${ds(e,"editors")} `:""} - ${e.formerEditors.length?bn` + ${e.formerEditors.length?mn` <dt> - ${e.formerEditors.length>1?ds.former_editors:ds.former_editor} + ${e.formerEditors.length>1?fs.former_editors:fs.former_editor} </dt> - ${ls(e,"formerEditors")} + ${ds(e,"formerEditors")} `:""} - ${e.authors.length?bn` - <dt>${e.authors.length>1?ds.authors:ds.author}</dt> - ${ls(e,"authors")} + ${e.authors.length?mn` + <dt>${e.authors.length>1?fs.authors:fs.author}</dt> + ${ds(e,"authors")} `:""} - ${e.github||e.wgPublicList?bn`<dt>${ds.feedback}</dt> - ${hs(e)}`:""} - ${e.otherLinks?e.otherLinks.map(ns):""} + ${e.github||e.wgPublicList?mn`<dt>${fs.feedback}</dt> + ${gs(e)}`:""} + ${e.otherLinks?e.otherLinks.map(ss):""} </dl> - ${e.alternateFormats?bn`<p> + ${e.alternateFormats?mn`<p> ${t.multipleAlternates?"This document is also available in these non-normative formats:":"This document is also available in this non-normative format:"} ${t.alternatesHTML} </p>`:""} - ${n||bn`<p class="copyright"> + ${n||mn`<p class="copyright"> <a href="https://www.w3.org/policies/#copyright">Copyright</a> © ${e.copyrightStart?`${e.copyrightStart}-`:""}${e.publishYear} - ${e.additionalCopyrightHolders?bn` ${[e.additionalCopyrightHolders]} & `:""} + ${e.additionalCopyrightHolders?mn` ${[e.additionalCopyrightHolders]} & `:""} the Contributors to the ${s.childNodes} Specification, published by the <a href="${e.wgURI}">${e.wg}</a> under the - ${e.isCGFinal?bn` + ${e.isCGFinal?mn` <a href="https://www.w3.org/community/about/agreements/fsa/" >W3C Community Final Specification Agreement (FSA)</a >. A human-readable @@ -357,7 +357,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} >summary</a > is available. - `:bn` + `:mn` <a href="https://www.w3.org/community/about/agreements/cla/" >W3C Community Contributor License Agreement (CLA)</a >. A human-readable @@ -369,50 +369,50 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} `} </p>`} <hr title="Separator for header" /> - </div>`};const gs=On({en:{sotd:"Status of This Document",status_at_publication:bn`This section describes the status of this + </div>`};const ys=Nn({en:{sotd:"Status of This Document",status_at_publication:mn`This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the <a href="https://www.w3.org/TR/">W3C technical reports index</a> at - https://www.w3.org/TR/.`},ko:{sotd:"ķ˜„ģž¬ ė¬øģ„œģ˜ ģƒķƒœ",status_at_publication:bn`ģ“ ė¶€ė¶„ģ€ ķ˜„ģž¬ ė¬øģ„œģ˜ ė°œķ–‰ ė‹¹ģ‹œ ģƒķƒœģ— ėŒ€ķ•“ + https://www.w3.org/TR/.`},ko:{sotd:"ķ˜„ģž¬ ė¬øģ„œģ˜ ģƒķƒœ",status_at_publication:mn`ģ“ ė¶€ė¶„ģ€ ķ˜„ģž¬ ė¬øģ„œģ˜ ė°œķ–‰ ė‹¹ģ‹œ ģƒķƒœģ— ėŒ€ķ•“ źø°ģˆ ķ•©ė‹ˆė‹¤. W3C ė°œķ–‰ ė¬øģ„œģ˜ ģµœģ‹  ėŖ©ė” ė° ķ…Œķ¬ė‹ˆģ»¬ ė¦¬ķ¬ķŠø ģµœģ‹ ķŒģ„ https://www.w3.org/TR/ ģ˜ <a href="https://www.w3.org/TR/">W3C technical reports index</a> ģ—ģ„œ - ģ—“ėžŒķ•  ģˆ˜ ģžˆģŠµė‹ˆė‹¤.`},zh:{sotd:"关äŗŽęœ¬ę–‡ę”£",status_at_publication:bn`ęœ¬ē« čŠ‚ꏏčæ°äŗ†ęœ¬ę–‡ę”£ēš„发åøƒēŠ¶ę€ć€‚W3Cēš„ę–‡ę”£åˆ—č”Øå’Œęœ€ę–°ē‰ˆęœ¬åÆ通čæ‡<a + ģ—“ėžŒķ•  ģˆ˜ ģžˆģŠµė‹ˆė‹¤.`},zh:{sotd:"关äŗŽęœ¬ę–‡ę”£",status_at_publication:mn`ęœ¬ē« čŠ‚ꏏčæ°äŗ†ęœ¬ę–‡ę”£ēš„发åøƒēŠ¶ę€ć€‚W3Cēš„ę–‡ę”£åˆ—č”Øå’Œęœ€ę–°ē‰ˆęœ¬åÆ通čæ‡<a href="https://www.w3.org/TR/" >W3CꊀęœÆęŠ„å‘Š</a - >ē“¢å¼•č®æ问怂`},ja:{sotd:"恓恮ꖇę›øć®ä½ē½®ä»˜ć‘",status_at_publication:bn`恓恮ēÆ€ć«ćÆć€å…¬é–‹ę™‚ē‚¹ć§ć®ć“恮ꖇę›øć®ä½ē½®ć„恑恌čØ˜ć•ć‚Œć¦ć„ć‚‹ć€‚ē¾ę™‚ē‚¹ć§ć®W3C恮ē™ŗč”Œę–‡ę›øćØć“ć®ćƒ†ć‚Æćƒ‹ć‚«ćƒ«ćƒ¬ćƒćƒ¼ćƒˆć®ęœ€ę–°ē‰ˆćÆ态äø‹čØ˜ć‹ć‚‰å‚ē…§ć§ćć‚‹ć€‚ + >ē“¢å¼•č®æ问怂`},ja:{sotd:"恓恮ꖇę›øć®ä½ē½®ä»˜ć‘",status_at_publication:mn`恓恮ēÆ€ć«ćÆć€å…¬é–‹ę™‚ē‚¹ć§ć®ć“恮ꖇę›øć®ä½ē½®ć„恑恌čØ˜ć•ć‚Œć¦ć„ć‚‹ć€‚ē¾ę™‚ē‚¹ć§ć®W3C恮ē™ŗč”Œę–‡ę›øćØć“ć®ćƒ†ć‚Æćƒ‹ć‚«ćƒ«ćƒ¬ćƒćƒ¼ćƒˆć®ęœ€ę–°ē‰ˆćÆ态äø‹čØ˜ć‹ć‚‰å‚ē…§ć§ćć‚‹ć€‚ <a href="https://www.w3.org/TR/">W3C technical reports index</a> - (https://www.w3.org/TR/)`},nl:{sotd:"Status van dit document"},es:{sotd:"Estado de este Document",status_at_publication:bn`Esta secciĆ³n describe el estado del presente + (https://www.w3.org/TR/)`},nl:{sotd:"Status van dit document"},es:{sotd:"Estado de este Document",status_at_publication:mn`Esta secciĆ³n describe el estado del presente documento al momento de su publicaciĆ³n. Una lista de las publicaciones actuales del W3C y la Ćŗltima revisiĆ³n del presente informe tĆ©cnico puede hallarse en http://www.w3.org/TR/ <a href="https://www.w3.org/TR/">el Ć­ndice de informes tĆ©cnicos</a> del - W3C.`},de:{sotd:"Status dieses Dokuments",status_at_publication:bn`Dieser Abschnitt beschreibt den Status des + W3C.`},de:{sotd:"Status dieses Dokuments",status_at_publication:mn`Dieser Abschnitt beschreibt den Status des Dokuments zum Zeitpunkt der Publikation. Eine Liste der aktuellen Publikatinen des W3C und die aktuellste Fassung dieser Spezifikation kann im <a href="https://www.w3.org/TR/">W3C technical reports index</a> unter - https://www.w3.org/TR/ abgerufen werden.`}}),bs="https://www.w3.org/policies/process/20231103/";function ys(e){return/^[aeiou]/i.test(e)?`an ${e}`:`a ${e}`}var ws=(e,t)=>bn` - <h2>${gs.sotd}</h2> - ${e.isPreview?vs(e):""} - ${e.isUnofficial?function(e){const{additionalContent:t}=e;return bn` + https://www.w3.org/TR/ abgerufen werden.`}}),ws="https://www.w3.org/policies/process/20231103/";function vs(e){return/^[aeiou]/i.test(e)?`an ${e}`:`a ${e}`}var $s=(e,t)=>mn` + <h2>${ys.sotd}</h2> + ${e.isPreview?ks(e):""} + ${e.isUnofficial?function(e){const{additionalContent:t}=e;return mn` <p> This document is a draft of a potential specification. It has no official standing of any kind and does not represent the support or consensus of any standards organization. </p> ${t} - `}(t):e.isTagFinding?t.additionalContent:e.isNoTrack?function(e,t){const{isMO:n}=e,{additionalContent:r}=t;return bn` + `}(t):e.isTagFinding?t.additionalContent:e.isNoTrack?function(e,t){const{isMO:n}=e,{additionalContent:r}=t;return mn` <p> This document is merely a W3C-internal ${n?"member-confidential":""} document. It has no official standing of any kind and does not represent consensus of the W3C Membership. </p> ${r} - `}(e,t):bn` - <p><em>${gs.status_at_publication}</em></p> - ${e.isMemberSubmission?function(e,t){return bn` + `}(e,t):mn` + <p><em>${ys.status_at_publication}</em></p> + ${e.isMemberSubmission?function(e,t){return mn` ${t.additionalContent} - ${e.isMemberSubmission?function(e){const t=`https://www.w3.org/Submission/${e.publishDate.getUTCFullYear()}/${e.submissionCommentNumber}/Comment/`,n="PP2017"===e.wgPatentPolicy?"https://www.w3.org/Consortium/Patent-Policy-20170801/":"https://www.w3.org/policies/patent-policy/";return bn`<p> + ${e.isMemberSubmission?function(e){const t=`https://www.w3.org/Submission/${e.publishDate.getUTCFullYear()}/${e.submissionCommentNumber}/Comment/`,n="PP2017"===e.wgPatentPolicy?"https://www.w3.org/Consortium/Patent-Policy-20170801/":"https://www.w3.org/policies/patent-policy/";return mn`<p> By publishing this document, W3C acknowledges that the <a href="${e.thisVersion}">Submitting Members</a> have made a formal Submission request to W3C for discussion. Publication of this document by @@ -434,35 +434,35 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} >list of acknowledged W3C Member Submissions</a >. </p>`}(e):""} - `}(e,t):bn` + `}(e,t):mn` ${e.sotdAfterWGinfo?"":t.additionalContent} - ${e.overrideStatus?"":bn` ${function(e){if(!e.wg)return;let t=null;const n=document.querySelector(".proposed-addition"),r=document.querySelector(".proposed-correction"),s=document.querySelector(".addition"),o=document.querySelector(".correction"),i=n||r||s||o;e.isRec&&i&&(n&&r||s&&o?t=bn`It includes - ${n?bn`<a href="${bs}#proposed-amendments"> + ${e.overrideStatus?"":mn` ${function(e){if(!e.wg)return;let t=null;const n=document.querySelector(".proposed-addition"),r=document.querySelector(".proposed-correction"),s=document.querySelector(".addition"),o=document.querySelector(".correction"),i=n||r||s||o;e.isRec&&i&&(n&&r||s&&o?t=mn`It includes + ${n?mn`<a href="${ws}#proposed-amendments"> proposed amendments</a - >`:bn`<a href="${bs}#candidate-amendments"> + >`:mn`<a href="${ws}#candidate-amendments"> candidate amendments</a >`}, introducing substantive changes and new features since the previous - Recommendation.`:n||s?t=bn`It includes - ${n?bn`<a href="${bs}#proposed-addition"> + Recommendation.`:n||s?t=mn`It includes + ${n?mn`<a href="${ws}#proposed-addition"> proposed additions</a - >`:bn`<a href="${bs}#candidate-addition"> + >`:mn`<a href="${ws}#candidate-addition"> candidate additions</a >`}, - introducing new features since the previous Recommendation.`:(r||o)&&(t=bn`It includes - ${r?bn`<a href="${bs}#proposed-correction"> + introducing new features since the previous Recommendation.`:(r||o)&&(t=mn`It includes + ${r?mn`<a href="${ws}#proposed-correction"> proposed corrections</a - >`:bn`<a href="${bs}#candidate-correction"> + >`:mn`<a href="${ws}#candidate-correction"> candidate corrections</a - >`}.`));const a=Es[e.specStatus]?bn` using the - <a href="${bs}#recs-and-notes" - >${Es[e.specStatus]} track</a - >`:"";return bn`<p> - This document was published by ${$s(e)} as - ${ys(e.longStatus)}${a}. ${t} + >`}.`));const a=Ts[e.specStatus]?mn` using the + <a href="${ws}#recs-and-notes" + >${Ts[e.specStatus]} track</a + >`:"";return mn`<p> + This document was published by ${xs(e)} as + ${vs(e.longStatus)}${a}. ${t} </p>`}(e)} `} ${e.sotdAfterWGinfo?t.additionalContent:""} - ${e.isRec?function(e){const{revisedRecEnd:t}=e,n=document.querySelector("#sotd.updateable-rec");let r="";document.querySelector(".proposed-addition")?r="additions":document.querySelector(".proposed-correction")&&(r="corrections");return bn` + ${e.isRec?function(e){const{revisedRecEnd:t}=e,n=document.querySelector("#sotd.updateable-rec");let r="";document.querySelector(".proposed-addition")?r="additions":document.querySelector(".proposed-correction")&&(r="corrections");return mn` <p> W3C recommends the wide deployment of this specification as a standard for the Web. @@ -477,59 +477,59 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} >royalty-free licensing</a > for implementations. - ${n?bn`Future updates to this Recommendation may incorporate - <a href="${bs}#allow-new-features">new features</a>.`:""} + ${n?mn`Future updates to this Recommendation may incorporate + <a href="${ws}#allow-new-features">new features</a>.`:""} </p> - ${document.querySelector(".addition")?bn`<p class="addition"> + ${document.querySelector(".addition")?mn`<p class="addition"> Candidate additions are marked in the document. </p>`:""} - ${document.querySelector(".correction")?bn`<p class="correction"> + ${document.querySelector(".correction")?mn`<p class="correction"> Candidate corrections are marked in the document. </p>`:""} - ${document.querySelector(".proposed-addition")?bn`<p class="addition proposed"> + ${document.querySelector(".proposed-addition")?mn`<p class="addition proposed"> Proposed additions are marked in the document. </p>`:""} - ${document.querySelector(".proposed-correction")?bn`<p class="correction proposed"> + ${document.querySelector(".proposed-correction")?mn`<p class="correction proposed"> Proposed corrections are marked in the document. </p>`:""} - ${r?bn`<p> + ${r?mn`<p> The W3C Membership and other interested parties are invited to review the proposed ${r} and send comments through - ${Cn.format(t)}. Advisory Committee Representatives + ${_n.format(t)}. Advisory Committee Representatives should consult their <a href="https://www.w3.org/2002/09/wbs/myQuestionnaires" >WBS questionnaires</a >. </p>`:""} - `}(e):function(e){const t=document.querySelector("#sotd.updateable-rec");let n=null,r=null,s=bn`Publication as ${ys(e.textStatus)} does not - imply endorsement by W3C and its Members.`,o=bn`<p> + `}(e):function(e){const t=document.querySelector("#sotd.updateable-rec");let n=null,r=null,s=mn`Publication as ${vs(e.textStatus)} does not + imply endorsement by W3C and its Members.`,o=mn`<p> This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress. - ${t?bn`Future updates to this specification may incorporate - <a href="${bs}#allow-new-features">new features</a>.`:""} - </p>`;"DISC"===e.specStatus&&(o=bn`<p> + ${t?mn`Future updates to this specification may incorporate + <a href="${ws}#allow-new-features">new features</a>.`:""} + </p>`;"DISC"===e.specStatus&&(o=mn`<p> Publication as a Discontinued Draft implies that this document is no longer intended to advance or to be maintained. It is inappropriate to cite this document as other than abandoned work. - </p>`);const i=bn`<p> + </p>`);const i=mn`<p> This document is maintained and updated at any time. Some parts of this document are work in progress. - </p>`;switch(e.specStatus){case"STMT":s=bn`<p> + </p>`;switch(e.specStatus){case"STMT":s=mn`<p> A W3C Statement is a specification that, after extensive consensus-building, has received the endorsement of the <abbr title="World Wide Web Consortium">W3C</abbr> and its Members. - </p>`;break;case"RY":s=bn`<p>W3C recommends the wide usage of this registry.</p> + </p>`;break;case"RY":s=mn`<p>W3C recommends the wide usage of this registry.</p> <p> A W3C Registry is a specification that, after extensive consensus-building, has received the endorsement of the <abbr title="World Wide Web Consortium">W3C</abbr> and its Members. - </p>`;break;case"CRD":n=bn`A Candidate Recommendation Draft integrates + </p>`;break;case"CRD":n=mn`A Candidate Recommendation Draft integrates changes from the previous Candidate Recommendation that the Working Group - intends to include in a subsequent Candidate Recommendation Snapshot.`,"LS"===e.pubMode&&(o=i);break;case"CRYD":n=bn`A Candidate Registry Draft integrates changes + intends to include in a subsequent Candidate Recommendation Snapshot.`,"LS"===e.pubMode&&(o=i);break;case"CRYD":n=mn`A Candidate Registry Draft integrates changes from the previous Candidate Registry Snapshot that the Working Group - intends to include in a subsequent Candidate Registry Snapshot.`,"LS"===e.pubMode&&(o=i);break;case"CRY":n=bn`A Candidate Registry Snapshot has received - <a href="${bs}#dfn-wide-review">wide review</a>.`,r=bn`<p> + intends to include in a subsequent Candidate Registry Snapshot.`,"LS"===e.pubMode&&(o=i);break;case"CRY":n=mn`A Candidate Registry Snapshot has received + <a href="${ws}#dfn-wide-review">wide review</a>.`,r=mn`<p> The W3C Membership and other interested parties are invited to review the document and send comments through ${e.humanPREnd}. Advisory Committee Representatives should consult their @@ -537,37 +537,37 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} >WBS questionnaires</a >. Note that substantive technical comments were expected during the Candidate Recommendation review period that ended ${e.humanCREnd}. - </p>`;break;case"CR":n=bn`A Candidate Recommendation Snapshot has received - <a href="${bs}#dfn-wide-review">wide review</a>, is intended to + </p>`;break;case"CR":n=mn`A Candidate Recommendation Snapshot has received + <a href="${ws}#dfn-wide-review">wide review</a>, is intended to gather <a href="${e.implementationReportURI}">implementation experience</a>, and has commitments from Working Group members to <a href="https://www.w3.org/policies/patent-policy/#sec-Requirements" >royalty-free licensing</a > - for implementations.`,o=bn`${t?bn`Future updates to this specification may incorporate - <a href="${bs}#allow-new-features">new features</a>.`:""}`,r="LS"===e.pubMode?bn`<p> + for implementations.`,o=mn`${t?mn`Future updates to this specification may incorporate + <a href="${ws}#allow-new-features">new features</a>.`:""}`,r="LS"===e.pubMode?mn`<p> Comments are welcome at any time but most especially before - ${Cn.format(e.crEnd)}. - </p>`:bn`<p> + ${_n.format(e.crEnd)}. + </p>`:mn`<p> This Candidate Recommendation is not expected to advance to Proposed - Recommendation any earlier than ${Cn.format(e.crEnd)}. - </p>`;break;case"PR":r=bn`<p> + Recommendation any earlier than ${_n.format(e.crEnd)}. + </p>`;break;case"PR":r=mn`<p> The W3C Membership and other interested parties are invited to review - the document and send comments through ${Cn.format(e.prEnd)}. + the document and send comments through ${_n.format(e.prEnd)}. Advisory Committee Representatives should consult their <a href="https://www.w3.org/2002/09/wbs/myQuestionnaires" >WBS questionnaires</a >. Note that substantive technical comments were expected during the Candidate Recommendation review period that ended - ${Cn.format(e.crEnd)}. - </p>`;break;case"DNOTE":s=bn`${e.textStatus}s are not endorsed by - <abbr title="World Wide Web Consortium">W3C</abbr> nor its Members.`;break;case"NOTE":s=bn`This ${e.textStatus} is endorsed by - ${$s(e)}, but is not endorsed by + ${_n.format(e.crEnd)}. + </p>`;break;case"DNOTE":s=mn`${e.textStatus}s are not endorsed by + <abbr title="World Wide Web Consortium">W3C</abbr> nor its Members.`;break;case"NOTE":s=mn`This ${e.textStatus} is endorsed by + ${xs(e)}, but is not endorsed by <abbr title="World Wide Web Consortium">W3C</abbr> itself nor its - Members.`}return bn`<p>${s} ${n}</p> + Members.`}return mn`<p>${s} ${n}</p> ${o} ${r}`}(e)} - ${function(e){const{isNote:t,isRegistry:n,wgId:r,multipleWGs:s,wgPatentHTML:o,wgPatentURI:i,wgPatentPolicy:a}=e,c="PP2017"===a?"https://www.w3.org/Consortium/Patent-Policy-20170801/":"https://www.w3.org/policies/patent-policy/",l=t||n?bn` + ${function(e){const{isNote:t,isRegistry:n,wgId:r,multipleWGs:s,wgPatentHTML:o,wgPatentURI:i,wgPatentPolicy:a}=e,c="PP2017"===a?"https://www.w3.org/Consortium/Patent-Policy-20170801/":"https://www.w3.org/policies/patent-policy/",l=t||n?mn` The <a href="${c}" >${"PP2017"===a?"1 August 2017 ":""}W3C Patent @@ -575,17 +575,17 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} > does not carry any licensing requirements or commitments on this document. - `:bn` + `:mn` This document was produced by ${s?"groups":"a group"} operating under the <a href="${c}" >${"PP2017"===a?"1 August 2017 ":""}W3C Patent Policy</a >. - `;return bn`<p data-deliverer="${t||n?r:null}"> + `;return mn`<p data-deliverer="${t||n?r:null}"> ${l} - ${t||n?"":bn` - ${s?bn` W3C maintains ${o} `:bn` + ${t||n?"":mn` + ${s?mn` W3C maintains ${o} `:mn` W3C maintains a <a href="${[i]}" rel="disclosure" >public list of any patent disclosures</a @@ -604,17 +604,17 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} </p>`}(e)} <p> This document is governed by the - <a id="w3c_process_revision" href="${bs}" + <a id="w3c_process_revision" href="${ws}" >03 November 2023 W3C Process Document</a >. </p> `} `} ${t.additionalSections} - `;function vs(e){const{prUrl:t,prNumber:n,edDraftURI:r}=e;return bn`<details class="annoying-warning" open=""> + `;function ks(e){const{prUrl:t,prNumber:n,edDraftURI:r}=e;return mn`<details class="annoying-warning" open=""> <summary> This is a - preview${t&&n?bn` + preview${t&&n?mn` of pull request <a href="${t}">#${n}</a> `:""} @@ -622,25 +622,25 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} <p> Do not attempt to implement this version of the specification. Do not reference this version as authoritative in any way. - ${r?bn` + ${r?mn` Instead, see <a href="${r}">${r}</a> for the Editor's draft. `:""} </p> - </details>`}function $s(e){return Array.isArray(e.wg)?Fn(e.wg,((t,n)=>bn`the <a href="${e.wgURI[n]}">${t}</a>`)):e.wg?bn`the <a href="${e.wgURI}">${e.wg}</a>`:void 0}var ks=(e,t)=>bn` - <h2>${gs.sotd}</h2> - ${e.isPreview?vs(e):""} + </details>`}function xs(e){return Array.isArray(e.wg)?Un(e.wg,((t,n)=>mn`the <a href="${e.wgURI[n]}">${t}</a>`)):e.wg?mn`the <a href="${e.wgURI}">${e.wg}</a>`:void 0}var _s=(e,t)=>mn` + <h2>${ys.sotd}</h2> + ${e.isPreview?ks(e):""} <p> This specification was published by the <a href="${e.wgURI}">${e.wg}</a>. It is not a W3C Standard nor is it on the W3C Standards Track. - ${e.isCGFinal?bn` + ${e.isCGFinal?mn` Please note that under the <a href="https://www.w3.org/community/about/agreements/final/" >W3C Community Final Specification Agreement (FSA)</a > other conditions apply. - `:bn` + `:mn` Please note that under the <a href="https://www.w3.org/community/about/agreements/cla/" >W3C Community Contributor License Agreement (CLA)</a @@ -653,19 +653,19 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} >. </p> ${e.sotdAfterWGinfo?"":t.additionalContent} - ${!e.github&&e.wgPublicList?function(e,t){const{mailToWGPublicListWithSubject:n,mailToWGPublicListSubscription:r}=t,{wgPublicList:s,subjectPrefix:o}=e;return bn`<p> + ${!e.github&&e.wgPublicList?function(e,t){const{mailToWGPublicListWithSubject:n,mailToWGPublicListSubscription:r}=t,{wgPublicList:s,subjectPrefix:o}=e;return mn`<p> If you wish to make comments regarding this document, please send them to <a href="${n}">${s}@w3.org</a> (<a href="${r}">subscribe</a>, - <a href="${`https://lists.w3.org/Archives/Public/${s}/`}">archives</a>)${o?bn` with <code>${o}</code> at the start of your email's + <a href="${`https://lists.w3.org/Archives/Public/${s}/`}">archives</a>)${o?mn` with <code>${o}</code> at the start of your email's subject`:""}. </p>`}(e,t):""} - ${e.github?function(e,t){if(e.github||e.wgPublicList)return bn`<p> - ${e.github?bn` + ${e.github?function(e,t){if(e.github||e.wgPublicList)return mn`<p> + ${e.github?mn` <a href="${e.issueBase}">GitHub Issues</a> are preferred for discussion of this specification. `:""} - ${e.wgPublicList?bn` + ${e.wgPublicList?mn` ${e.github&&e.wgPublicList?"Alternatively, you can send comments to our mailing list.":"Comments regarding this document are welcome."} Please send them to <a href="${t.mailToWGPublicListWithSubject}" @@ -675,23 +675,23 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} <a href="${`https://lists.w3.org/Archives/Public/${e.wgPublicList}/`}" >archives</a - >)${e.subjectPrefix?bn` with <code>${e.subjectPrefix}</code> at the start of your + >)${e.subjectPrefix?mn` with <code>${e.subjectPrefix}</code> at the start of your email's subject`:""}. `:""} </p>`}(e,t):""} ${e.sotdAfterWGinfo?t.additionalContent:""} ${t.additionalSections} - `;const xs="w3c/headers";function _s(e){return new URL(e,"https://www.w3.org/").href}const Ss={LS:"WD",LD:"WD",FPWD:"WD","Member-SUBM":"SUBM"},Cs={DNOTE:"Group Draft Note",NOTE:"Group Note",STMT:"Statement","Member-SUBM":"Member Submission",MO:"Member-Only Document",ED:"Editor's Draft",LS:"Living Standard",LD:"Living Document",FPWD:"First Public Working Draft",WD:"Working Draft",CR:"Candidate Recommendation",CRD:"Candidate Recommendation",PR:"Proposed Recommendation",REC:"Recommendation",DISC:"Discontinued Draft",RSCND:"Rescinded Recommendation",DRY:"Draft Registry",CRYD:"Candidate Registry",CRY:"Candidate Registry",RY:"Registry",unofficial:"Unofficial Draft",UD:"Unofficial Draft",base:"",finding:"TAG Finding","draft-finding":"Draft TAG Finding","editor-draft-finding":"Draft TAG Finding","CG-DRAFT":"Draft Community Group Report","CG-FINAL":"Final Community Group Report","BG-DRAFT":"Draft Business Group Report","BG-FINAL":"Final Business Group Report"},Rs={...Cs,CR:"Candidate Recommendation Snapshot",CRD:"Candidate Recommendation Draft",CRY:"Candidate Registry Snapshot",CRYD:"Candidate Registry Draft"},Es={DNOTE:"Note",NOTE:"Note",STMT:"Note","WG-NOTE":"Note","IG-NOTE":"Note",FPWD:"Recommendation",WD:"Recommendation",CR:"Recommendation",CRD:"Recommendation",PR:"Recommendation",REC:"Recommendation",DISC:"Recommendation",RSCND:"Recommendation",DRY:"Registry",CRYD:"Registry",CRY:"Registry",RY:"Registry"},As=["DNOTE","NOTE","STMT"],Ts=["CR","CRD","DISC","FPWD","PR","REC","RSCND","WD"],Ls=["DRY","CRY","CRYD","RY"],Ps=["draft-finding","finding","editor-draft-finding"],Is=["CG-DRAFT","CG-FINAL"],Ds=["BG-DRAFT","BG-FINAL"],Ns=[...Is,...Ds],js=[...As,...Ts,...Ls],Os=["base",...Is,...Ds,"editor-draft-finding","draft-finding","finding","MO","unofficial"],Ms=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["w3c-software",{name:"W3C Software Notice and License",short:"W3C Software",url:"https://www.w3.org/copyright/software-license-2002/"}],["w3c-software-doc",{name:"W3C Software and Document Notice and License",short:"permissive document license",url:"https://www.w3.org/copyright/software-license-2023/"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["document",{name:"W3C Document License",short:"document use",url:"https://www.w3.org/copyright/document-license/"}],["dual",{name:"W3C Dual License",short:"dual license",url:"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html"}],[void 0,{name:"unlicensed",url:null,short:"UNLICENSED"}]]),qs=["PP2017","PP2020"];function zs(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=_n.format(r);return new Date(e)}return or(pr`${t} is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,xs),new Date(_n.format(new Date))}function Us(e,{isTagFinding:t=!1}){const n=e.cloneNode(!0),r=document.createDocumentFragment();for(;n.hasChildNodes()&&(n.nodeType!==Node.ELEMENT_NODE||"section"!==n.firstChild.localName);)r.appendChild(n.firstChild);if(t&&!r.hasChildNodes()){ir(pr`ReSpec does not support automated SotD generation for TAG findings.`,xs,{hint:"Please add the prerequisite content in the 'sotd' section."})}return{additionalContent:r,additionalSections:n.childNodes}}var Ws=Object.freeze({__proto__:null,W3CNotes:As,bgStatus:Ds,cgStatus:Is,cgbgStatus:Ns,licenses:Ms,name:xs,noTrackStatus:Os,recTrackStatus:Ts,registryTrackStatus:Ls,run:async function(e){if(e.isBasic="base"===e.specStatus,e.isCGBG=Ns.includes(e.specStatus),e.isCGFinal=e.isCGBG&&e.specStatus.endsWith("G-FINAL"),e.isCR="CR"===e.specStatus||"CRD"===e.specStatus,e.isCRDraft="CRD"===e.specStatus,e.isCRY="CRY"===e.specStatus||"CRYD"===e.specStatus,e.isEd="ED"===e.specStatus,e.isMemberSubmission="Member-SUBM"===e.specStatus,e.isMO="MO"===e.specStatus,e.isNote=As.includes(e.specStatus),e.isNoTrack=Os.includes(e.specStatus),e.isPR="PR"===e.specStatus,e.isRecTrack=Ts.includes(e.specStatus),e.isRec=e.isRecTrack&&"REC"===e.specStatus,e.isRegistry=Ls.includes(e.specStatus),e.isRegular=!e.isCGBG&&!e.isBasic,e.isTagEditorFinding="editor-draft-finding"===e.specStatus,e.isTagFinding=Ps.includes(e.specStatus),e.isUnofficial="unofficial"===e.specStatus,e.licenseInfo=function(e){let t;if("string"==typeof e.license){const n=e.license.toLowerCase();if(Ms.has(n))t=n;else{const t=`The license "\`${e.license}\`" is not supported.`,n=pr`Please set - ${"[license]"} to one of: ${lr([...Ms.keys()].filter((e=>e)),{quotes:!0})}. If in doubt, remove \`license\` and let ReSpec pick one for you.`;or(t,xs,{hint:n})}}if(e.isUnofficial&&!t&&(t="cc-by"),!e.isUnofficial&&["cc-by","cc0"].includes(t)){const t=pr`Please set ${"[license]"} to \`"w3c-software-doc"\` instead.`;or(pr`License "\`${e.license}\`" is not allowed for W3C Specifications.`,xs,{hint:t})}return Ms.get(t)}(e),e.prependW3C=!e.isBasic&&!e.isUnofficial,e.longStatus=Rs[e.specStatus],e.textStatus=Cs[e.specStatus],e.showPreviousVersion=!1,e.isRegular&&!e.shortName){const e=pr`Please set ${"[shortName]"} to a short name for the specification.`;or(pr`The ${"[shortName]"} configuration option is required for this kind of document.`,xs,{hint:e})}if(e.publishDate=zs(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.modificationDate&&(e.modificationDate=zs(e,"modificationDate",document.lastModified)),e.isRecTrack&&!e.github&&!e.wgPublicList){const e=pr`Use the ${"[github]"} configuration option to add a link to a repository. Alternatively use ${"[wgPublicList]"} to link to a mailing list.`;or("W3C Process requires a either a link to a public repository or mailing list.",xs,{hint:e})}if(e.isEd&&!e.edDraftURI){const e=pr`Please set ${"[edDraftURI]"} to the URL of the Editor's Draft. Alternatively, use the set ${"[github]"} option, which automatically sets it for you.`;ir(pr`Editor's Drafts should set ${"[edDraftURI]"} configuration option.`,xs,{hint:e})}const t=function(e){const{specStatus:t,group:n}=e;if(js.includes(t)||"wg"===e.groupType)return"/TR";switch(t){case"CG-FINAL":case"BG-FINAL":return`/community/reports/${n}`;case"finding":case"draft-finding":return"/2001/tag/doc";case"Member-SUBM":return"/Submission"}return""}(e);if(t&&!e.thisVersion){const n=Ss[e.specStatus]||e.specStatus,{shortName:r,publishDate:s}=e,o=`${n}-${r}-${qn(s)}`,i=[...js,"Member-SUBM"].includes(e.specStatus)?`${s.getUTCFullYear()}/`:"";e.thisVersion=_s(`${t}/${i}${o}/`)}e.isEd&&(e.thisVersion=e.edDraftURI),e.isCGBG&&function(e){const t=Cs[e.specStatus],n=e.latestVersion?new URL(_s(e.latestVersion)):null;if(!e.wg){return void or(pr`The ${"[group]"} configuration option is required for this kind of document (${t}).`,xs)}if(e.isCGFinal){if(!1===("https://www.w3.org"===n?.origin||"https://w3.org/"===n?.origin)){or(pr`For ${t}, the ${"[latestVersion]"} URL must point to somewhere at https://www.w3.org/.`,xs,{hint:"Ask a W3C Team Member for a W3C URL where the report can be published."})}}}(e),null!==e.latestVersion&&(e.latestVersion=e.latestVersion?_s(e.latestVersion):_s(`${t}/${e.shortName}/`)),e.latestVersion&&function(e){const t=new URL(e.latestVersion);if(("https://www.w3.org"===t.origin||"https://w3.org/"===t.origin)&&t.pathname.startsWith("/TR/")&&!1===["ED",...js].includes(e.specStatus)){const t=pr`Ask a W3C Team Member for a W3C URL where the report can be published and change ${"[latestVersion]"} to something else.`;or(pr`Documents with a status of \`"${e.specStatus}"\` can't be published on the W3C's /TR/ (Technical Report) space.`,xs,{hint:t})}}(e);const n=`${t}/${e.shortName}`;if(e.previousPublishDate){if(!e.previousMaturity&&!e.isTagFinding){or(pr`${"[`previousPublishDate`]"} is set, but missing ${"[`previousMaturity`]"}.`,xs)}e.previousPublishDate=zs(e,"previousPublishDate");const r=Ss[e.previousMaturity]??e.previousMaturity;if(e.isTagFinding&&e.latestVersion){const t=_n.format(e.publishDate);e.thisVersion=_s(`${n}-${t}`);const r=_n.format(e.previousPublishDate);e.prevVersion=_s(`${n}-${r}}`)}else if(e.isCGBG||e.isBasic)e.prevVersion=e.prevVersion||"";else{const n=e.previousPublishDate.getUTCFullYear(),{shortName:s}=e,o=qn(e.previousPublishDate);e.prevVersion=_s(`${t}/${n}/${r}-${s}-${o}/`)}}e.prevRecShortname&&!e.prevRecURI&&(e.prevRecURI=_s(`${t}/${e.prevRecShortname}`));for(let t=0;t<e.editors.length;t++){const n=e.editors[t];"retiredDate"in n&&(e.formerEditors.push(n),e.editors.splice(t--,1))}if(0===e.editors.length){const e=pr`Add one or more editors using the ${"[editors]"} configuration option.`;or("At least one editor is required.",xs,{hint:e})}else e.editors.length&&e.isRecTrack&&e.editors.forEach(((e,t)=>{if(e.w3cid)return;const n=pr`See ${"[w3cid]"} for instructions for how to retrieve it and add it.`;or(pr`Editor ${e.name?`"${e.name}"`:`number ${t+1}`} is missing their ${"[w3cid]"}.`,xs,{hint:n})}));if(e.alternateFormats?.some((({uri:e,label:t})=>!e||!t))){or(pr`Every ${"[`alternateFormats`]"} entry must have a \`uri\` and a \`label\`.`,xs)}e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.dashDate=_n.format(e.publishDate),e.publishISODate=e.publishDate.toISOString(),e.shortISODate=_n.format(e.publishDate),function(e){if(!e.wgPatentPolicy)return;const t=new Set([].concat(e.wgPatentPolicy));if(t.size&&![...t].every((e=>qs.includes(e)))){const e=pr`Invalid ${"[wgPatentPolicy]"} value(s): ${ur([...t].filter((e=>!qs.includes(e))))}.`,n=`Please use one of: ${lr(qs)}.`;or(e,xs,{hint:n})}if(1!==t.size){const e="When collaborating across multiple groups, they must use the same patent policy.",n=pr`For ${"[wgPatentPolicy]"}, please check the patent policies of each group. The patent policies were: ${[...t].join(", ")}.`;or(e,xs,{hint:n})}e.wgPatentPolicy=[...t][0]}(e),await async function(e){if(!e.shortName||null===e.historyURI||!e.latestVersion)return;const t=e.isEd||js.includes(e.specStatus);if(e.historyURI&&!t){const t=pr`Please remove ${"[historyURI]"}.`;return or(pr`The ${"[historyURI]"} can't be used with non /TR/ documents.`,xs,{hint:t}),void(e.historyURI=null)}const n=new URL(e.historyURI??`${e.shortName}/`,"https://www.w3.org/standards/history/");if(e.historyURI&&t||["FPWD","DNOTE","NOTE","DRY"].includes(e.specStatus))return void(e.historyURI=n.href);try{const t=await fetch(n,{method:"HEAD"});t.ok&&(e.historyURI=t.url)}catch{}}(e),e.isTagEditorFinding&&(delete e.thisVersion,delete e.latestVersion),e.isTagFinding&&(e.showPreviousVersion=!!e.previousPublishDate);const r={get multipleAlternates(){return e.alternateFormats&&e.alternateFormats.length>1},get alternatesHTML(){return e.alternateFormats&&Fn(e.alternateFormats.map((({label:e})=>e)),((t,n)=>{const r=e.alternateFormats[n];return bn`<a + `;const Ss="w3c/headers";function Cs(e){return new URL(e,"https://www.w3.org/").href}const Rs={LS:"WD",LD:"WD",FPWD:"WD","Member-SUBM":"SUBM"},Es={DNOTE:"Group Draft Note",NOTE:"Group Note",STMT:"Statement","Member-SUBM":"Member Submission",MO:"Member-Only Document",ED:"Editor's Draft",LS:"Living Standard",LD:"Living Document",FPWD:"First Public Working Draft",WD:"Working Draft",CR:"Candidate Recommendation",CRD:"Candidate Recommendation",PR:"Proposed Recommendation",REC:"Recommendation",DISC:"Discontinued Draft",RSCND:"Rescinded Recommendation",DRY:"Draft Registry",CRYD:"Candidate Registry",CRY:"Candidate Registry",RY:"Registry",unofficial:"Unofficial Draft",UD:"Unofficial Draft",base:"",finding:"TAG Finding","draft-finding":"Draft TAG Finding","editor-draft-finding":"Draft TAG Finding","CG-DRAFT":"Draft Community Group Report","CG-FINAL":"Final Community Group Report","BG-DRAFT":"Draft Business Group Report","BG-FINAL":"Final Business Group Report"},As={...Es,CR:"Candidate Recommendation Snapshot",CRD:"Candidate Recommendation Draft",CRY:"Candidate Registry Snapshot",CRYD:"Candidate Registry Draft"},Ts={DNOTE:"Note",NOTE:"Note",STMT:"Note","WG-NOTE":"Note","IG-NOTE":"Note",FPWD:"Recommendation",WD:"Recommendation",CR:"Recommendation",CRD:"Recommendation",PR:"Recommendation",REC:"Recommendation",DISC:"Recommendation",RSCND:"Recommendation",DRY:"Registry",CRYD:"Registry",CRY:"Registry",RY:"Registry"},Ls=["DNOTE","NOTE","STMT"],Ps=["CR","CRD","DISC","FPWD","PR","REC","RSCND","WD"],Is=["DRY","CRY","CRYD","RY"],Ds=["draft-finding","finding","editor-draft-finding"],Ns=["CG-DRAFT","CG-FINAL"],js=["BG-DRAFT","BG-FINAL"],Os=[...Ns,...js],Ms=[...Ls,...Ps,...Is],qs=["base",...Ns,...js,"editor-draft-finding","draft-finding","finding","MO","unofficial"],zs=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["w3c-software",{name:"W3C Software Notice and License",short:"W3C Software",url:"https://www.w3.org/copyright/software-license-2002/"}],["w3c-software-doc",{name:"W3C Software and Document Notice and License",short:"permissive document license",url:"https://www.w3.org/copyright/software-license-2023/"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["document",{name:"W3C Document License",short:"document use",url:"https://www.w3.org/copyright/document-license/"}],["dual",{name:"W3C Dual License",short:"dual license",url:"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html"}],[void 0,{name:"unlicensed",url:null,short:"UNLICENSED"}]]),Us=["PP2017","PP2020"];function Ws(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=kn.format(r);return new Date(e)}return rr(ur`${t} is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,Ss),new Date(kn.format(new Date))}function Fs(e,{isTagFinding:t=!1}){const n=e.cloneNode(!0),r=document.createDocumentFragment();for(;n.hasChildNodes()&&(n.nodeType!==Node.ELEMENT_NODE||"section"!==n.firstChild.localName);)r.appendChild(n.firstChild);if(t&&!r.hasChildNodes()){sr(ur`ReSpec does not support automated SotD generation for TAG findings.`,Ss,{hint:"Please add the prerequisite content in the 'sotd' section."})}return{additionalContent:r,additionalSections:n.childNodes}}var Bs=Object.freeze({__proto__:null,W3CNotes:Ls,bgStatus:js,cgStatus:Ns,cgbgStatus:Os,licenses:zs,name:Ss,noTrackStatus:qs,recTrackStatus:Ps,registryTrackStatus:Is,run:async function(e){if(e.isBasic="base"===e.specStatus,e.isCGBG=Os.includes(e.specStatus),e.isCGFinal=e.isCGBG&&e.specStatus.endsWith("G-FINAL"),e.isCR="CR"===e.specStatus||"CRD"===e.specStatus,e.isCRDraft="CRD"===e.specStatus,e.isCRY="CRY"===e.specStatus||"CRYD"===e.specStatus,e.isEd="ED"===e.specStatus,e.isMemberSubmission="Member-SUBM"===e.specStatus,e.isMO="MO"===e.specStatus,e.isNote=Ls.includes(e.specStatus),e.isNoTrack=qs.includes(e.specStatus),e.isPR="PR"===e.specStatus,e.isRecTrack=Ps.includes(e.specStatus),e.isRec=e.isRecTrack&&"REC"===e.specStatus,e.isRegistry=Is.includes(e.specStatus),e.isRegular=!e.isCGBG&&!e.isBasic,e.isTagEditorFinding="editor-draft-finding"===e.specStatus,e.isTagFinding=Ds.includes(e.specStatus),e.isUnofficial="unofficial"===e.specStatus,e.licenseInfo=function(e){let t;if("string"==typeof e.license){const n=e.license.toLowerCase();if(zs.has(n))t=n;else{const t=`The license "\`${e.license}\`" is not supported.`,n=ur`Please set + ${"[license]"} to one of: ${ar([...zs.keys()].filter((e=>e)),{quotes:!0})}. If in doubt, remove \`license\` and let ReSpec pick one for you.`;rr(t,Ss,{hint:n})}}if(e.isUnofficial&&!t&&(t="cc-by"),!e.isUnofficial&&["cc-by","cc0"].includes(t)){const t=ur`Please set ${"[license]"} to \`"w3c-software-doc"\` instead.`;rr(ur`License "\`${e.license}\`" is not allowed for W3C Specifications.`,Ss,{hint:t})}return zs.get(t)}(e),e.prependW3C=!e.isBasic&&!e.isUnofficial,e.longStatus=As[e.specStatus],e.textStatus=Es[e.specStatus],e.showPreviousVersion=!1,e.isRegular&&!e.shortName){const e=ur`Please set ${"[shortName]"} to a short name for the specification.`;rr(ur`The ${"[shortName]"} configuration option is required for this kind of document.`,Ss,{hint:e})}if(e.publishDate=Ws(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.modificationDate&&(e.modificationDate=Ws(e,"modificationDate",document.lastModified)),e.isRecTrack&&!e.github&&!e.wgPublicList){const e=ur`Use the ${"[github]"} configuration option to add a link to a repository. Alternatively use ${"[wgPublicList]"} to link to a mailing list.`;rr("W3C Process requires a either a link to a public repository or mailing list.",Ss,{hint:e})}if(e.isEd&&!e.edDraftURI){const e=ur`Please set ${"[edDraftURI]"} to the URL of the Editor's Draft. Alternatively, use the set ${"[github]"} option, which automatically sets it for you.`;sr(ur`Editor's Drafts should set ${"[edDraftURI]"} configuration option.`,Ss,{hint:e})}const t=function(e){const{specStatus:t,group:n}=e;if(Ms.includes(t)||"wg"===e.groupType)return"/TR";switch(t){case"CG-FINAL":case"BG-FINAL":return`/community/reports/${n}`;case"finding":case"draft-finding":return"/2001/tag/doc";case"Member-SUBM":return"/Submission"}return""}(e);if(t&&!e.thisVersion){const n=Rs[e.specStatus]||e.specStatus,{shortName:r,publishDate:s}=e,o=`${n}-${r}-${On(s)}`,i=[...Ms,"Member-SUBM"].includes(e.specStatus)?`${s.getUTCFullYear()}/`:"";e.thisVersion=Cs(`${t}/${i}${o}/`)}e.isEd&&(e.thisVersion=e.edDraftURI),e.isCGBG&&function(e){const t=Es[e.specStatus],n=e.latestVersion?new URL(Cs(e.latestVersion)):null;if(!e.wg){return void rr(ur`The ${"[group]"} configuration option is required for this kind of document (${t}).`,Ss)}if(e.isCGFinal){if(!1===("https://www.w3.org"===n?.origin||"https://w3.org/"===n?.origin)){rr(ur`For ${t}, the ${"[latestVersion]"} URL must point to somewhere at https://www.w3.org/.`,Ss,{hint:"Ask a W3C Team Member for a W3C URL where the report can be published."})}}}(e),null!==e.latestVersion&&(e.latestVersion=e.latestVersion?Cs(e.latestVersion):Cs(`${t}/${e.shortName}/`)),e.latestVersion&&function(e){const t=new URL(e.latestVersion);if(("https://www.w3.org"===t.origin||"https://w3.org/"===t.origin)&&t.pathname.startsWith("/TR/")&&!1===["ED",...Ms].includes(e.specStatus)){const t=ur`Ask a W3C Team Member for a W3C URL where the report can be published and change ${"[latestVersion]"} to something else.`;rr(ur`Documents with a status of \`"${e.specStatus}"\` can't be published on the W3C's /TR/ (Technical Report) space.`,Ss,{hint:t})}}(e);const n=`${t}/${e.shortName}`;if(e.previousPublishDate){if(!e.previousMaturity&&!e.isTagFinding){rr(ur`${"[`previousPublishDate`]"} is set, but missing ${"[`previousMaturity`]"}.`,Ss)}e.previousPublishDate=Ws(e,"previousPublishDate");const r=Rs[e.previousMaturity]??e.previousMaturity;if(e.isTagFinding&&e.latestVersion){const t=kn.format(e.publishDate);e.thisVersion=Cs(`${n}-${t}`);const r=kn.format(e.previousPublishDate);e.prevVersion=Cs(`${n}-${r}}`)}else if(e.isCGBG||e.isBasic)e.prevVersion=e.prevVersion||"";else{const n=e.previousPublishDate.getUTCFullYear(),{shortName:s}=e,o=On(e.previousPublishDate);e.prevVersion=Cs(`${t}/${n}/${r}-${s}-${o}/`)}}e.prevRecShortname&&!e.prevRecURI&&(e.prevRecURI=Cs(`${t}/${e.prevRecShortname}`));for(let t=0;t<e.editors.length;t++){const n=e.editors[t];"retiredDate"in n&&(e.formerEditors.push(n),e.editors.splice(t--,1))}if(0===e.editors.length){const e=ur`Add one or more editors using the ${"[editors]"} configuration option.`;rr("At least one editor is required.",Ss,{hint:e})}else e.editors.length&&e.isRecTrack&&e.editors.forEach(((e,t)=>{if(e.w3cid)return;const n=ur`See ${"[w3cid]"} for instructions for how to retrieve it and add it.`;rr(ur`Editor ${e.name?`"${e.name}"`:`number ${t+1}`} is missing their ${"[w3cid]"}.`,Ss,{hint:n})}));if(e.alternateFormats?.some((({uri:e,label:t})=>!e||!t))){rr(ur`Every ${"[`alternateFormats`]"} entry must have a \`uri\` and a \`label\`.`,Ss)}e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.dashDate=kn.format(e.publishDate),e.publishISODate=e.publishDate.toISOString(),e.shortISODate=kn.format(e.publishDate),function(e){if(!e.wgPatentPolicy)return;const t=new Set([].concat(e.wgPatentPolicy));if(t.size&&![...t].every((e=>Us.includes(e)))){const e=ur`Invalid ${"[wgPatentPolicy]"} value(s): ${cr([...t].filter((e=>!Us.includes(e))))}.`,n=`Please use one of: ${ar(Us)}.`;rr(e,Ss,{hint:n})}if(1!==t.size){const e="When collaborating across multiple groups, they must use the same patent policy.",n=ur`For ${"[wgPatentPolicy]"}, please check the patent policies of each group. The patent policies were: ${[...t].join(", ")}.`;rr(e,Ss,{hint:n})}e.wgPatentPolicy=[...t][0]}(e),await async function(e){if(!e.shortName||null===e.historyURI||!e.latestVersion)return;const t=e.isEd||Ms.includes(e.specStatus);if(e.historyURI&&!t){const t=ur`Please remove ${"[historyURI]"}.`;return rr(ur`The ${"[historyURI]"} can't be used with non /TR/ documents.`,Ss,{hint:t}),void(e.historyURI=null)}const n=new URL(e.historyURI??`${e.shortName}/`,"https://www.w3.org/standards/history/");if(e.historyURI&&t||["FPWD","DNOTE","NOTE","DRY"].includes(e.specStatus))return void(e.historyURI=n.href);try{const t=await fetch(n,{method:"HEAD"});t.ok&&(e.historyURI=t.url)}catch{}}(e),e.isTagEditorFinding&&(delete e.thisVersion,delete e.latestVersion),e.isTagFinding&&(e.showPreviousVersion=!!e.previousPublishDate);const r={get multipleAlternates(){return e.alternateFormats&&e.alternateFormats.length>1},get alternatesHTML(){return e.alternateFormats&&Un(e.alternateFormats.map((({label:e})=>e)),((t,n)=>{const r=e.alternateFormats[n];return mn`<a rel="alternate" href="${r.uri}" hreflang="${r?.lang??null}" type="${r?.type??null}" >${r.label}</a - >`}))}},o=(e.isCGBG?ms:fs)(e,r);document.body.prepend(o),document.body.classList.add("h-entry");const i=document.getElementById("sotd")||document.createElement("section");if((e.isCGBG||!e.isNoTrack||e.isTagFinding)&&!i.id){or("A Status of This Document must include at least on custom paragraph.",xs,{elements:[i],hint:"Add a `<p>` in the 'sotd' section that reflects the status of this specification."})}i.id=i.id||"sotd",i.classList.add("introductory");const a=[e.wg,e.wgURI,e.wgPatentURI];if(a.some((e=>Array.isArray(e)))&&!a.every((e=>Array.isArray(e)))){const e=pr`Use the ${"[group]"} option with an array instead.`;or(pr`If one of ${"[wg]"}, ${"[wgURI]"}, or ${"[wgPatentURI]"} is an array, they all have to be.`,xs,{hint:e})}if(Array.isArray(e.wg)?(e.multipleWGs=e.wg.length>1,e.wgPatentHTML=Fn(e.wg,((t,n)=>bn`a + >`}))}},s=(e.isCGBG?bs:ms)(e,r);document.body.prepend(s),document.body.classList.add("h-entry");const o=document.getElementById("sotd")||document.createElement("section");if((e.isCGBG||!e.isNoTrack||e.isTagFinding)&&!o.id){rr("A Status of This Document must include at least on custom paragraph.",Ss,{elements:[o],hint:"Add a `<p>` in the 'sotd' section that reflects the status of this specification."})}o.id=o.id||"sotd",o.classList.add("introductory");const i=[e.wg,e.wgURI,e.wgPatentURI];if(i.some((e=>Array.isArray(e)))&&!i.every((e=>Array.isArray(e)))){const e=ur`Use the ${"[group]"} option with an array instead.`;rr(ur`If one of ${"[wg]"}, ${"[wgURI]"}, or ${"[wgPatentURI]"} is an array, they all have to be.`,Ss,{hint:e})}if(Array.isArray(e.wg)?(e.multipleWGs=e.wg.length>1,e.wgPatentHTML=Un(e.wg,((t,n)=>mn`a <a href="${e.wgPatentURI[n]}" rel="disclosure" >public list of any patent disclosures (${t})</a - >`))):e.multipleWGs=!1,e.isPR&&!e.crEnd){or(pr`${"[specStatus]"} is "PR" but no ${"[crEnd]"} is specified in the ${"[respecConfig]"} (needed to indicate end of previous CR).`,xs)}if(e.isCR&&!e.crEnd){or(pr`${"[specStatus]"} is "CR", but no ${"[crEnd]"} is specified in the ${"[respecConfig]"}.`,xs)}if(e.crEnd=zs(e,"crEnd"),e.isPr&&!e.prEnd){or(pr`${"[specStatus]"} is "PR" but no ${"[prEnd]"} is specified in the ${"[respecConfig]"}.`,xs)}e.prEnd=zs(e,"prEnd");const c=i.classList.contains("updateable-rec"),l=null!==document.querySelector(".correction"),u=null!==document.querySelector(".proposed-correction"),d=null!==document.querySelector(".addition"),p=null!==document.querySelector(".proposed-addition"),f=l||d||p||u;if(e.isRec&&!e.errata&&!f){const e=pr`Add an ${"[errata]"} URL to your ${"[respecConfig]"}.`;or("Recommendations must have an errata link.",xs,{hint:e})}if(!c&&(d||l)){or(pr`${"[specStatus]"} is "REC" with proposed additions but the Recommendation is not marked as allowing new features.`,xs)}if(e.isRec&&c&&(p||u)&&!e.revisedRecEnd){or(pr`${"[specStatus]"} is "REC" with proposed corrections or additions but no ${"[revisedRecEnd]"} is specified in the ${"[respecConfig]"}.`,xs)}if(e.revisedRecEnd=zs(e,"revisedRecEnd"),e.noRecTrack&&Ts.includes(e.specStatus)){const t=pr`Document configured as ${"[noRecTrack]"}, but its status ("${e.specStatus}") puts it on the W3C Rec Track.`,n=lr(Ts,{quotes:!0});or(t,xs,{hint:`Status **can't** be any of: ${n}.`})}if(i.classList.contains("override")||bn.bind(i)`${function(e,t){const n={...Us(t,e),get mailToWGPublicList(){return`mailto:${e.wgPublicList}@w3.org`},get mailToWGPublicListWithSubject(){const t=e.subjectPrefix?`?subject=${encodeURIComponent(e.subjectPrefix)}`:"";return this.mailToWGPublicList+t},get mailToWGPublicListSubscription(){return`mailto:${e.wgPublicList}-request@w3.org?subject=subscribe`}},r=e.isCGBG?ks:ws;return r(e,n)}(e,i)}`,!e.implementationReportURI&&e.isCR){const e=pr`CR documents must have an ${"[implementationReportURI]"} that describes the [implementation experience](https://www.w3.org/policies/process/#implementation-experience).`;or(pr`Missing ${"[implementationReportURI]"} configuration option in ${"[respecConfig]"}.`,xs,{hint:e})}if(!e.implementationReportURI&&e.isPR){ir(pr`PR documents should include an ${"[implementationReportURI]"}, which needs to link to a document that describes the [implementation experience](https://www.w3.org/policies/process-20190301/#implementation-experience).`,xs)}s("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:jn(document.getElementById("w3c-state")?.textContent??"")})},status2text:Cs,status2track:Es,tagStatus:Ps,trStatus:js});const Fs={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},Bs="w3c/defaults",Hs={src:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",alt:"W3C",height:48,width:72,url:"https://www.w3.org/"},Gs={alt:"W3C Member Submission",href:"https://www.w3.org/Submission/",src:"https://www.w3.org/Icons/member_subm-v.svg",width:"211",height:"48"},Vs={lint:{"privsec-section":!1,"required-sections":!0,"wpt-tests-exist":!1,"informative-dfn":"warn","no-unused-dfns":"warn",a11y:!1},doJsonLd:!1,logos:[],xref:!0,wgId:"",otherLinks:[],excludeGithubLinks:!0,subtitle:"",prevVersion:"",formerEditors:[],editors:[],authors:[]};var Ys=Object.freeze({__proto__:null,name:Bs,run:function(e){const t=!1!==e.lint&&{...Fs.lint,...Vs.lint,...e.lint};Object.assign(e,{...Fs,...Vs,...e,lint:t}),"unofficial"===e.specStatus||e.hasOwnProperty("license")||(e.license="w3c-software-doc"),function(e){const{specStatus:t,groupType:n,group:r}=e;if(!t){const t=pr`Select an appropriate status from ${"[specStatus]"} based on your W3C group. If in doubt, use \`"unofficial"\`.`;return or(pr`The ${"[specStatus]"} configuration option is required.`,Bs,{hint:t}),void(e.specStatus="base")}if(void 0===Cs[t]){const n=pr`The ${"[specStatus]"} "\`${t}\`" is not supported at for this type of document.`,r=pr`set ${"[specStatus]"} to one of: ${lr(Object.keys(Cs),{quotes:!0})}.`;return or(n,Bs,{hint:r}),void(e.specStatus="base")}switch(n){case"cg":if(![...Is,"unofficial","UD"].includes(t)){const n=pr`W3C Community Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=lr(Is,{quotes:!0});or(n,Bs,{hint:`Please use one of: ${r}. Automatically falling back to \`"CG-DRAFT"\`.`}),e.specStatus="CG-DRAFT"}break;case"bg":if(![...Ds,"unofficial","UD"].includes(t)){const n=pr`W3C Business Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=lr(Ds,{quotes:!0});or(n,Bs,{hint:`Please use one of: ${r}. Automatically falling back to \`"BG-DRAFT"\`.`}),e.specStatus="BG-DRAFT"}break;case"wg":if(![...js,"unofficial","UD","ED"].includes(t)){const e=pr`Pleas see ${"[specStatus]"} for appropriate status for W3C Working Group documents.`;or(pr`W3C Working Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,Bs,{hint:e})}break;case"other":if("tag"===r&&!["ED",...js,...Ps].includes(t)){const n=pr`The W3C Technical Architecture Group's documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=lr(["ED",...js,...Ps],{quotes:!0});or(n,Bs,{hint:`Please use one of: ${r}. Automatically falling back to \`"unofficial"\`.`}),e.specStatus="unofficial"}break;default:if(!e.wgId&&!["unofficial","base","UD","Member-SUBM"].includes(e.specStatus)){const t="Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.",n=pr`Use the ${"[group]"} configuration option to associated this document with a W3C group.`;e.specStatus="base",or(t,Bs,{hint:n})}}}(e),function(e){const{specStatus:t,wg:n}=e,r=[...Ts,...Ls,...As,...Ps,"ED"].includes(t),s=n&&n.length&&r,o=["Member-SUBM"].includes(t);(s||o)&&(e.logos.unshift(Hs),"Member-SUBM"===t&&e.logos.push(Gs))}(e)}});var Ks=String.raw`@keyframes pop{ + >`))):e.multipleWGs=!1,e.isPR&&!e.crEnd){rr(ur`${"[specStatus]"} is "PR" but no ${"[crEnd]"} is specified in the ${"[respecConfig]"} (needed to indicate end of previous CR).`,Ss)}if(e.isCR&&!e.crEnd){rr(ur`${"[specStatus]"} is "CR", but no ${"[crEnd]"} is specified in the ${"[respecConfig]"}.`,Ss)}if(e.crEnd=Ws(e,"crEnd"),e.isPr&&!e.prEnd){rr(ur`${"[specStatus]"} is "PR" but no ${"[prEnd]"} is specified in the ${"[respecConfig]"}.`,Ss)}e.prEnd=Ws(e,"prEnd");const a=o.classList.contains("updateable-rec"),c=null!==document.querySelector(".correction"),l=null!==document.querySelector(".proposed-correction"),u=null!==document.querySelector(".addition"),d=null!==document.querySelector(".proposed-addition"),p=c||u||d||l;if(e.isRec&&!e.errata&&!p){const e=ur`Add an ${"[errata]"} URL to your ${"[respecConfig]"}.`;rr("Recommendations must have an errata link.",Ss,{hint:e})}if(!a&&(u||c)){rr(ur`${"[specStatus]"} is "REC" with proposed additions but the Recommendation is not marked as allowing new features.`,Ss)}if(e.isRec&&a&&(d||l)&&!e.revisedRecEnd){rr(ur`${"[specStatus]"} is "REC" with proposed corrections or additions but no ${"[revisedRecEnd]"} is specified in the ${"[respecConfig]"}.`,Ss)}if(e.revisedRecEnd=Ws(e,"revisedRecEnd"),e.noRecTrack&&Ps.includes(e.specStatus)){const t=ur`Document configured as ${"[noRecTrack]"}, but its status ("${e.specStatus}") puts it on the W3C Rec Track.`,n=ar(Ps,{quotes:!0});rr(t,Ss,{hint:`Status **can't** be any of: ${n}.`})}if(o.classList.contains("override")||mn.bind(o)`${function(e,t){const n={...Fs(t,e),get mailToWGPublicList(){return`mailto:${e.wgPublicList}@w3.org`},get mailToWGPublicListWithSubject(){const t=e.subjectPrefix?`?subject=${encodeURIComponent(e.subjectPrefix)}`:"";return this.mailToWGPublicList+t},get mailToWGPublicListSubscription(){return`mailto:${e.wgPublicList}-request@w3.org?subject=subscribe`}},r=e.isCGBG?_s:$s;return r(e,n)}(e,o)}`,!e.implementationReportURI&&e.isCR){const e=ur`CR documents must have an ${"[implementationReportURI]"} that describes the [implementation experience](https://www.w3.org/policies/process/#implementation-experience).`;rr(ur`Missing ${"[implementationReportURI]"} configuration option in ${"[respecConfig]"}.`,Ss,{hint:e})}if(!e.implementationReportURI&&e.isPR){sr(ur`PR documents should include an ${"[implementationReportURI]"}, which needs to link to a document that describes the [implementation experience](https://www.w3.org/policies/process-20190301/#implementation-experience).`,Ss)}fr("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:Dn(document.getElementById("w3c-state")?.textContent??"")})},status2text:Es,status2track:Ts,tagStatus:Ds,trStatus:Ms});const Hs={lint:{"no-headingless-sections":!0,"no-http-props":!0,"no-unused-vars":!1,"check-punctuation":!1,"local-refs-exist":!0,"check-internal-slots":!1,"check-charset":!1,"privsec-section":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0},Gs="w3c/defaults",Vs={src:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",alt:"W3C",height:48,width:72,url:"https://www.w3.org/"},Ys={alt:"W3C Member Submission",href:"https://www.w3.org/Submission/",src:"https://www.w3.org/Icons/member_subm-v.svg",width:"211",height:"48"},Ks={lint:{"privsec-section":!1,"required-sections":!0,"wpt-tests-exist":!1,"informative-dfn":"warn","no-unused-dfns":"warn",a11y:!1},doJsonLd:!1,logos:[],xref:!0,wgId:"",otherLinks:[],excludeGithubLinks:!0,subtitle:"",prevVersion:"",formerEditors:[],editors:[],authors:[]};var Zs=Object.freeze({__proto__:null,name:Gs,run:function(e){const t=!1!==e.lint&&{...Hs.lint,...Ks.lint,...e.lint};Object.assign(e,{...Hs,...Ks,...e,lint:t}),"unofficial"===e.specStatus||e.hasOwnProperty("license")||(e.license="w3c-software-doc"),function(e){const{specStatus:t,groupType:n,group:r}=e;if(!t){const t=ur`Select an appropriate status from ${"[specStatus]"} based on your W3C group. If in doubt, use \`"unofficial"\`.`;return rr(ur`The ${"[specStatus]"} configuration option is required.`,Gs,{hint:t}),void(e.specStatus="base")}if(void 0===Es[t]){const n=ur`The ${"[specStatus]"} "\`${t}\`" is not supported at for this type of document.`,r=ur`set ${"[specStatus]"} to one of: ${ar(Object.keys(Es),{quotes:!0})}.`;return rr(n,Gs,{hint:r}),void(e.specStatus="base")}switch(n){case"cg":if(![...Ns,"unofficial","UD"].includes(t)){const n=ur`W3C Community Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=ar(Ns,{quotes:!0});rr(n,Gs,{hint:`Please use one of: ${r}. Automatically falling back to \`"CG-DRAFT"\`.`}),e.specStatus="CG-DRAFT"}break;case"bg":if(![...js,"unofficial","UD"].includes(t)){const n=ur`W3C Business Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=ar(js,{quotes:!0});rr(n,Gs,{hint:`Please use one of: ${r}. Automatically falling back to \`"BG-DRAFT"\`.`}),e.specStatus="BG-DRAFT"}break;case"wg":if(![...Ms,"unofficial","UD","ED"].includes(t)){const e=ur`Pleas see ${"[specStatus]"} for appropriate status for W3C Working Group documents.`;rr(ur`W3C Working Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,Gs,{hint:e})}break;case"other":if("tag"===r&&!["ED",...Ms,...Ds].includes(t)){const n=ur`The W3C Technical Architecture Group's documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=ar(["ED",...Ms,...Ds],{quotes:!0});rr(n,Gs,{hint:`Please use one of: ${r}. Automatically falling back to \`"unofficial"\`.`}),e.specStatus="unofficial"}break;default:if(!e.wgId&&!["unofficial","base","UD","Member-SUBM"].includes(e.specStatus)){const t="Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.",n=ur`Use the ${"[group]"} configuration option to associated this document with a W3C group.`;e.specStatus="base",rr(t,Gs,{hint:n})}}}(e),function(e){const{specStatus:t,wg:n}=e,r=[...Ps,...Is,...Ls,...Ds,"ED"].includes(t),s=n&&n.length&&r,o=["Member-SUBM"].includes(t);(s||o)&&(e.logos.unshift(Vs),"Member-SUBM"===t&&e.logos.push(Ys))}(e)}});var Js=String.raw`@keyframes pop{ 0%{transform:scale(1,1)} 25%{transform:scale(1.25,1.25);opacity:.75} 100%{transform:scale(1,1)} @@ -732,75 +732,75 @@ dd{margin-left:0} } @media print{ .removeOnSave{display:none} -}`;const Zs=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Ks,document.head.appendChild(e),e}();var Js=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Zs.remove()}});function Qs(){const e=document.createElement("script");e.src="https://www.w3.org/scripts/TR/2021/fixup.js",location.hash&&e.addEventListener("load",(()=>{window.location.href=location.hash}),{once:!0}),document.body.appendChild(e)}const Xs=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2021/fixup.js",as:"script"},{hint:"preload",href:to("base.css").href,as:"style"},{hint:"preload",href:to("dark.css").href,as:"style"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",as:"image",corsMode:"anonymous"}],t=document.createDocumentFragment();for(const n of e.map(En))t.appendChild(n);return t}();function eo(e){return t=>{const n=t.querySelector(`head link[href="${e}"]`);t.querySelector("head").append(n)}}function to(e="base.css"){return new URL(`/StyleSheets/TR/2021/${e}`,"https://www.w3.org/")}Xs.appendChild(bn`<link +}`;const Qs=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Js,document.head.appendChild(e),e}();var Xs=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Qs.remove()}});function eo(){const e=document.createElement("script");e.src="https://www.w3.org/scripts/TR/2021/fixup.js",location.hash&&e.addEventListener("load",(()=>{window.location.href=location.hash}),{once:!0}),document.body.appendChild(e)}const to=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2021/fixup.js",as:"script"},{hint:"preload",href:ro("base.css").href,as:"style"},{hint:"preload",href:ro("dark.css").href,as:"style"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",as:"image",corsMode:"anonymous"}],t=document.createDocumentFragment();for(const n of e.map(Cn))t.appendChild(n);return t}();function no(e){return t=>{const n=t.querySelector(`head link[href="${e}"]`);t.querySelector("head").append(n)}}function ro(e="base.css"){return new URL(`/StyleSheets/TR/2021/${e}`,"https://www.w3.org/")}to.appendChild(mn`<link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2021/base.css" class="removeOnSave" - />`),document.head.querySelector("meta[name=viewport]")||Xs.prepend(bn`<meta + />`),document.head.querySelector("meta[name=viewport]")||to.prepend(mn`<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" - />`),document.head.prepend(Xs);var no=Object.freeze({__proto__:null,name:"w3c/style",run:function(e){e.noToc||o("end-all",Qs,{once:!0});const t=to(function(e){const t=e.specStatus?.toUpperCase()??"";let n="";const r=[...Ts,...Ls,...As,"ED","MEMBER-SUBM"].includes(t)&&e.wgId;switch(t){case"WD":case"FPWD":n=r?"W3C-WD":"base.css";break;case"CG-DRAFT":case"CG-FINAL":case"BG-DRAFT":case"BG-FINAL":n=t.toLowerCase();break;case"UD":case"UNOFFICIAL":n="W3C-UD";break;case"FINDING":case"DRAFT-FINDING":case"EDITOR-DRAFT-FINDING":case"BASE":n="base.css";break;case"MEMBER-SUBM":n="W3C-Member-SUBM";break;default:n=r?`W3C-${e.specStatus}`:"base.css"}return n}(e));document.head.appendChild(bn`<link rel="stylesheet" href="${t.href}" />`),o("beforesave",eo(t));let n=document.querySelector("head meta[name=color-scheme]");if(n||(n=bn`<meta name="color-scheme" content="light" />`,document.head.appendChild(n)),n.content.includes("dark")){const e=to("dark.css");document.head.appendChild(bn`<link + />`),document.head.prepend(to);var so=Object.freeze({__proto__:null,name:"w3c/style",run:function(e){e.noToc||hr("end-all",eo,{once:!0});const t=ro(function(e){const t=e.specStatus?.toUpperCase()??"";let n="";const r=[...Ps,...Is,...Ls,"ED","MEMBER-SUBM"].includes(t)&&e.wgId;switch(t){case"WD":case"FPWD":n=r?"W3C-WD":"base.css";break;case"CG-DRAFT":case"CG-FINAL":case"BG-DRAFT":case"BG-FINAL":n=t.toLowerCase();break;case"UD":case"UNOFFICIAL":n="W3C-UD";break;case"FINDING":case"DRAFT-FINDING":case"EDITOR-DRAFT-FINDING":case"BASE":n="base.css";break;case"MEMBER-SUBM":n="W3C-Member-SUBM";break;default:n=r?`W3C-${e.specStatus}`:"base.css"}return n}(e));document.head.appendChild(mn`<link rel="stylesheet" href="${t.href}" />`),hr("beforesave",no(t));let n=document.querySelector("head meta[name=color-scheme]");if(n||(n=mn`<meta name="color-scheme" content="light" />`,document.head.appendChild(n)),n.content.includes("dark")){const e=ro("dark.css");document.head.appendChild(mn`<link rel="stylesheet" href="${e.href}" media="(prefers-color-scheme: dark)" - />`),o("beforesave",eo(e))}}});const ro="core/github";let so,oo;const io=new Promise(((e,t)=>{so=e,oo=e=>{or(e,ro),t(new Error(e))}})),ao=On({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"ģ°øģ—¬"},zh:{file_a_bug:"反馈错čÆÆ",participate:"参äøŽļ¼š"},ja:{commit_history:"å¤‰ę›“å±„ę­“",file_a_bug:"問锌報告",participate:"å‚åŠ ę–¹ę³•ļ¼š"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});var co=Object.freeze({__proto__:null,github:io,name:ro,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void so(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=pr`Config option ${"[github]"} is missing property \`repoURL\`.`;return void oo(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=pr`${"[github]"} configuration option is not a valid URL? (${n}).`;return void oo(e)}if("https://github.com"!==t.origin){const e=pr`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void oo(e)}const[r,s]=t.pathname.split("/").filter((e=>e));if(!r||!s){const e=pr`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void oo(e)}const o=e.github.branch||"gh-pages",i=new URL("./issues/",t).href,a=new URL(`./commits/${e.github.branch??""}`,t.href),c={edDraftURI:`https://${r.toLowerCase()}.github.io/${s}/`,githubToken:void 0,githubUser:void 0,issueBase:i,atRiskBase:i,otherLinks:[],pullBase:new URL("./pulls/",t).href,shortName:s};let l="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)l=e.githubAPI;else{ir("The `githubAPI` configuration option is private and should not be added manually.",ro)}if(!e.excludeGithubLinks){const n={key:ao.participate,data:[{value:`GitHub ${r}/${s}`,href:t},{value:ao.file_a_bug,href:c.issueBase},{value:ao.commit_history,href:a.href},{value:"Pull requests",href:c.pullBase}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(n)}const u={branch:o,repoURL:t.href,apiBase:l,fullName:`${r}/${s}`,issuesURL:i,pullsURL:c.pullBase,newIssuesURL:new URL("./new/choose",i).href,commitHistoryURL:a.href};so(u);const d={...c,...e,github:u,githubAPI:l};Object.assign(e,d)}});class lo{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(uo(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function uo(e){const t=new lo(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function po(e){const t=uo(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var fo=Object.freeze({__proto__:null,name:"core/sections",restructure:po,run:function(){po(document.body)}});const ho="core/data-include";function mo(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),s=zn(e,r.dataset.oninclude,n),o="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let s=t;"markdown"===r&&(s=Rr(s)),"text"===r?e.textContent=s:e.innerHTML=s,"markdown"===r&&po(e),n&&e.replaceWith(...e.childNodes)}(r,s,{replace:o}),o||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function go(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const s=await fetch(n);mo(await s.text(),r,n),t<3&&await go(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),or(r,ho,{elements:[e]})}}));await Promise.all(r)}var bo=Object.freeze({__proto__:null,name:ho,run:async function(){await go(document,1)}});var yo=Object.freeze({__proto__:null,name:"core/reindent",run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=fr(e.innerHTML)}});const wo="core/title",vo=On({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"ę— ę ‡é¢˜"}});var $o=Object.freeze({__proto__:null,name:wo,run:function(e){const t=document.querySelector("h1#title")||bn`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){or('The document is missing a title, so using a default title. To fix this, please give your document a `<title>`. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',wo,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||`${vo.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=jn(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:s}=bn` + />`),hr("beforesave",no(e))}}});const oo="core/github";let io,ao;const co=new Promise(((e,t)=>{io=e,ao=e=>{rr(e,oo),t(new Error(e))}})),lo=Nn({en:{file_a_bug:"File an issue",participate:"Participate:",commit_history:"Commit history"},ko:{participate:"ģ°øģ—¬"},zh:{file_a_bug:"反馈错čÆÆ",participate:"参äøŽļ¼š"},ja:{commit_history:"å¤‰ę›“å±„ę­“",file_a_bug:"問锌報告",participate:"å‚åŠ ę–¹ę³•ļ¼š"},nl:{commit_history:"Revisiehistorie",file_a_bug:"Dien een melding in",participate:"Doe mee:"},es:{commit_history:"Historia de cambios",file_a_bug:"Nota un bug",participate:"Participe:"},de:{commit_history:"Revisionen",file_a_bug:"Fehler melden",participate:"Mitmachen:"}});var uo=Object.freeze({__proto__:null,github:co,name:oo,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void io(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=ur`Config option ${"[github]"} is missing property \`repoURL\`.`;return void ao(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=ur`${"[github]"} configuration option is not a valid URL? (${n}).`;return void ao(e)}if("https://github.com"!==t.origin){const e=ur`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void ao(e)}const[r,s]=t.pathname.split("/").filter((e=>e));if(!r||!s){const e=ur`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void ao(e)}const o=e.github.branch||"gh-pages",i=new URL("./issues/",t).href,a=new URL(`./commits/${e.github.branch??""}`,t.href),c={edDraftURI:`https://${r.toLowerCase()}.github.io/${s}/`,githubToken:void 0,githubUser:void 0,issueBase:i,atRiskBase:i,otherLinks:[],pullBase:new URL("./pulls/",t).href,shortName:s};let l="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)l=e.githubAPI;else{sr("The `githubAPI` configuration option is private and should not be added manually.",oo)}if(!e.excludeGithubLinks){const n={key:lo.participate,data:[{value:`GitHub ${r}/${s}`,href:t},{value:lo.file_a_bug,href:c.issueBase},{value:lo.commit_history,href:a.href},{value:"Pull requests",href:c.pullBase}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(n)}const u={branch:o,repoURL:t.href,apiBase:l,fullName:`${r}/${s}`,issuesURL:i,pullsURL:c.pullBase,newIssuesURL:new URL("./new/choose",i).href,commitHistoryURL:a.href};io(u);const d={...c,...e,github:u,githubAPI:l};Object.assign(e,d)}});class po{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}findPosition(e){return parseInt(e.tagName.charAt(1),10)}findParent(e){let t;for(;e>0;)if(e--,t=this.stack[e],t)return t}findHeader({firstChild:e}){for(;e;){if(/H[1-6]/.test(e.tagName))return e;e=e.nextSibling}return null}addHeader(e){const t=this.doc.createElement("section"),n=this.findPosition(e);t.appendChild(e),this.findParent(n).appendChild(t),this.stack[n]=t,this.stack.length=n+1,this.current=t}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(fo(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function fo(e){const t=new po(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function ho(e){const t=fo(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var mo=Object.freeze({__proto__:null,name:"core/sections",restructure:ho,run:function(){ho(document.body)}});const go="core/data-include";function bo(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),s=Mn(e,r.dataset.oninclude,n),o="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let s=t;"markdown"===r&&(s=Ar(s)),"text"===r?e.textContent=s:e.innerHTML=s,"markdown"===r&&ho(e),n&&e.replaceWith(...e.childNodes)}(r,s,{replace:o}),o||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}async function yo(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const s=await fetch(n);bo(await s.text(),r,n),t<3&&await yo(e,t+1)}catch(t){rr(`\`data-include\` failed: \`${n}\` (${t.message}).`,go,{elements:[e],cause:t})}}));await Promise.all(r)}var wo=Object.freeze({__proto__:null,name:go,run:async function(){await yo(document,1)}});var vo=Object.freeze({__proto__:null,name:"core/reindent",run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=dr(e.innerHTML)}});const $o="core/title",ko=Nn({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"ę— ę ‡é¢˜"}});var xo=Object.freeze({__proto__:null,name:$o,run:function(e){const t=document.querySelector("h1#title")||mn`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){rr('The document is missing a title, so using a default title. To fix this, please give your document a `<title>`. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',$o,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||`${ko.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=Dn(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:s}=mn` Preview of PR <a href="${n}">#${e.prNumber}</a>: - `;t.prepend(...s),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});const ko="w3c/level",xo=On({en:{level:"Level"},ja:{level:"ćƒ¬ćƒ™ćƒ«"},nl:{level:"Niveau"},de:{level:"Stufe"},zh:{level:"ēŗ§åˆ«"}});var _o=Object.freeze({__proto__:null,name:ko,run:function(e){if(!e.hasOwnProperty("level"))return;const t=document.querySelector("h1#title"),n=parseInt(e.level);if(!Number.isInteger(n)||n<0){or(`The \`level\` configuration option must be a number greater or equal to 0. It is currently set to \`${n}\``,ko,{title:"Invalid level config.",elements:[t]})}else t.append(` ${xo.level} ${n}`),document.title=`${document.title} ${xo.level} ${n}`,e.shortName=`${e.shortName}-${n}`,e.level=n}});const So="w3c/abstract",Co=On({en:{abstract:"Abstract"},ko:{abstract:"ģš”ģ•½"},zh:{abstract:"ę‘˜č¦"},ja:{abstract:"要ē“„"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"}});var Ro=Object.freeze({__proto__:null,name:So,run:async function(){const e=function(){const e=document.getElementById("abstract");if(e)switch(e.localName){case"section":return e;case"div":return Vn(e,"section");default:return or("The abstract should be a `<section>` element.",So,{elements:[e]}),e}const t=Co.abstract.toLocaleLowerCase(l);for(const e of document.querySelectorAll("h2, h3, h4, h5, h6"))if(jn(e.textContent).toLocaleLowerCase(l)===t)return e.closest("section");return e}();e?(e.classList.add("introductory"),e.id="abstract",e.querySelector("h2")||e.prepend(bn`<h2>${Co.abstract}</h2>`)):or('Document must have one `<section id="abstract">`.',So)}});var Eo=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=zn(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const Ao="core/dfn-abbr";function To(e){const t=(n=e).dataset.abbr?n.dataset.abbr:n.textContent.match(/\b([a-z])/gi).join("").toUpperCase();var n;const r=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${r}">${t}</abbr>)`);const s=e.dataset.lt||"";e.dataset.lt=s.split("|").filter((e=>e.trim())).concat(t).join("|")}var Lo=Object.freeze({__proto__:null,name:Ao,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)To(t);else{or(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,Ao,{elements:[t],title:"Error: unsupported."})}}}});const Po=/^[a-z]+(\s+[a-z]+)+\??$/,Io=/\B"([^"]*)"\B/,Do=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,No=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,jo=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Oo=/^(?:\w+)\??$/,Mo=/^(\w+)\["([\w- ]*)"\]$/,qo=/\.?(\w+\(.*\)$)/,zo=/\/(.+)/,Uo=/\[\[.+\]\]/;function Wo(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return bn`<a + `;t.prepend(...s),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});const _o="w3c/level",So=Nn({en:{level:"Level"},ja:{level:"ćƒ¬ćƒ™ćƒ«"},nl:{level:"Niveau"},de:{level:"Stufe"},zh:{level:"ēŗ§åˆ«"}});var Co=Object.freeze({__proto__:null,name:_o,run:function(e){if(!e.hasOwnProperty("level"))return;const t=document.querySelector("h1#title"),n=parseInt(e.level);if(!Number.isInteger(n)||n<0){rr(`The \`level\` configuration option must be a number greater or equal to 0. It is currently set to \`${n}\``,_o,{title:"Invalid level config.",elements:[t]})}else t.append(` ${So.level} ${n}`),document.title=`${document.title} ${So.level} ${n}`,e.shortName=`${e.shortName}-${n}`,e.level=n}});const Ro="w3c/abstract",Eo=Nn({en:{abstract:"Abstract"},ko:{abstract:"ģš”ģ•½"},zh:{abstract:"ę‘˜č¦"},ja:{abstract:"要ē“„"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"}});var Ao=Object.freeze({__proto__:null,name:Ro,run:async function(){const e=function(){const e=document.getElementById("abstract");if(e)switch(e.localName){case"section":return e;case"div":return Hn(e,"section");default:return rr("The abstract should be a `<section>` element.",Ro,{elements:[e]}),e}const t=Eo.abstract.toLocaleLowerCase(o);for(const e of document.querySelectorAll("h2, h3, h4, h5, h6"))if(Dn(e.textContent).toLocaleLowerCase(o)===t)return e.closest("section");return e}();e?(e.classList.add("introductory"),e.id="abstract",e.querySelector("h2")||e.prepend(mn`<h2>${Eo.abstract}</h2>`)):rr('Document must have one `<section id="abstract">`.',Ro)}});var To=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=Mn(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const Lo="core/dfn-abbr";function Po(e){const t=(n=e).dataset.abbr?n.dataset.abbr:n.textContent.match(/\b([a-z])/gi).join("").toUpperCase();var n;const r=e.textContent.replace(/\s\s+/g," ").trim();e.insertAdjacentHTML("afterend",` (<abbr title="${r}">${t}</abbr>)`);const s=e.dataset.lt||"";e.dataset.lt=s.split("|").filter((e=>e.trim())).concat(t).join("|")}var Io=Object.freeze({__proto__:null,name:Lo,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)Po(t);else{rr(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,Lo,{elements:[t],title:"Error: unsupported."})}}}});const Do=/^[a-z]+(\s+[a-z]+)+\??$/,No=/\B"([^"]*)"\B/,jo=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,Oo=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,Mo=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,qo=/^(?:\w+)\??$/,zo=/^(\w+)\["([\w- ]*)"\]$/,Uo=/\.?(\w+\(.*\)$)/,Wo=/\/(.+)/,Fo=/\[\[.+\]\]/;function Bo(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return mn`<a data-xref-type="_IDL_" data-link-type="idl" data-lt="${t}" ><code>${t+(r?"?":"")}</code></a - >`}function Fo(e){const{identifier:t,parent:n,slotType:r,renderParent:s,args:o}=e,{identifier:i}=n||{},a="method"===r,c=a?bn`(${Wn(o,Bo)})`:null,l=a?`(${o.join(", ")})`:"";return bn`${n&&s?".":""}<a + >`}function Ho(e){const{identifier:t,parent:n,slotType:r,renderParent:s,args:o}=e,{identifier:i}=n||{},a="method"===r,c=a?mn`(${zn(o,Go)})`:null,l=a?`(${o.join(", ")})`:"";return mn`${n&&s?".":""}<a data-xref-type="${r}" data-link-type="${r}" data-link-for="${i}" data-xref-for="${i}" data-lt="${`[[${t}]]${l}`}" ><code>[[${t}]]${c}</code></a - >`}function Bo(e,t,n){if(t<n.length-1)return bn`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),s=r.length>1,o=s?r[2]:r[0];return bn`${s?"...":null}<var>${o}</var>`}function Ho(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:s}=t||{};return bn`${r?".":""}<a + >`}function Go(e,t,n){if(t<n.length-1)return mn`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),s=r.length>1,o=s?r[2]:r[0];return mn`${s?"...":null}<var>${o}</var>`}function Vo(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:s}=t||{};return mn`${r?".":""}<a data-link-type="idl" data-xref-type="attribute|dict-member|const" data-link-for="${s}" data-xref-for="${s}" ><code>${n}</code></a - >`}function Go(e){const{args:t,identifier:n,type:r,parent:s,renderParent:o}=e,{renderText:i,renderArgs:a}=e,{identifier:c}=s||{},l=Wn(a||t,Bo),u=`${n}(${t.join(", ")})`;return bn`${s&&o?".":""}<a + >`}function Yo(e){const{args:t,identifier:n,type:r,parent:s,renderParent:o}=e,{renderText:i,renderArgs:a}=e,{identifier:c}=s||{},l=zn(a||t,Go),u=`${n}(${t.join(", ")})`;return mn`${s&&o?".":""}<a data-link-type="idl" data-xref-type="${r}" data-link-for="${c}" data-xref-for="${c}" data-lt="${u}" ><code>${i||n}</code></a - >${!i||a?bn`<code>(${l})</code>`:""}`}function Vo(e){const{identifier:t,enumValue:n,parent:r}=e,s=r?r.identifier:t;return bn`"<a + >${!i||a?mn`<code>(${l})</code>`:""}`}function Ko(e){const{identifier:t,enumValue:n,parent:r}=e,s=r?r.identifier:t;return mn`"<a data-link-type="idl" data-xref-type="enum-value" data-link-for="${s}" data-xref-for="${s}" data-lt="${n?null:"the-empty-string"}" ><code>${n}</code></a - >"`}function Yo(e){const{identifier:t}=e;return bn`"<a + >"`}function Zo(e){const{identifier:t}=e;return mn`"<a data-link-type="idl" data-cite="webidl" data-xref-type="exception" ><code>${t}</code></a - >"`}function Ko(e){const{identifier:t,nullable:n}=e;return bn`<a + >"`}function Jo(e){const{identifier:t,nullable:n}=e;return mn`<a data-link-type="idl" data-cite="webidl" data-xref-type="interface" data-lt="${t}" ><code>${t+(n?"?":"")}</code></a - >`}function Zo(e){let t;try{t=function(e){const t=Uo.test(e),n=t?zo:qo,[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(Do.test(t)){const[,e,n,r,s]=t.match(Do),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(Mo.test(t)){const[,e,n]=t.match(Mo);a.push({type:"enum",identifier:e,enumValue:n,renderParent:i})}else if(Io.test(t)){const[,e]=t.match(Io);i?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:i})}else if(No.test(t)){const[,e,n]=t.match(No),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(jo.test(t)&&o.length){const[,e]=t.match(jo);a.push({type:"attribute",identifier:e,renderParent:i})}else if(Po.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(!Oo.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=bn`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return or(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=bn(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Wo(e);t&&r.push(t);break}case"attribute":r.push(Ho(e));break;case"internal-slot":r.push(Fo(e));break;case"method":r.push(Go(e));break;case"enum":r.push(Vo(e));break;case"exception":r.push(Yo(e));break;case"idl-primitive":r.push(Ko(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Jo=new Set(["alias","reference"]),Qo=async function(){const e=await yn.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[...Jo]){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<t)&&await r.delete(e.id),o=await o.continue()}}return e}();const Xo={get ready(){return Qo},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!Jo.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:r},async get(e,t){if(!Jo.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),s=await n.openCursor(r);return s?s.value:s},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const s={id:r,...e[r],expires:t};s.aliasOf?n.alias.push(s):n.reference.push(s)}const r=[...Jo].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!Jo.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){const s=await this.get(e,t.id);if(s?.expires<Date.now()){const{store:s}=n.transaction(e,"readwrite");await s.delete(t.id),r=!1}}const{store:s}=n.transaction(e,"readwrite");return r?await s.put(t):await s.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Jo],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},ei={},ti=new URL("https://api.specref.org/bibrefs?refs="),ni=En({hint:"dns-prefetch",href:ti.origin});let ri;document.head.appendChild(ni);const si=new Promise((e=>{ri=e}));async function oi(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter((e=>e.trim()));if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(ti.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const s=await r.json(),o=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),o):o;await Xo.addAll(s,e)}catch(e){console.error(e)}return s}async function ii(e){const t=await si;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await ii(n.aliasOf):n}var ai=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map((e=>e.toLowerCase())));Array.from(this.conf.informativeReferences).filter((t=>e.has(t.toLowerCase()))).forEach((e=>this.conf.informativeReferences.delete(e)))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=ei;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio[e].aliasOf)).filter((e=>!this.conf.localBiblio.hasOwnProperty(e)));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter((e=>!this.conf.localBiblio.hasOwnProperty(e))).concat(e).sort())),r=n.length?await async function(e){const t=[];try{await Xo.ready;const n=e.map((async e=>({id:e,data:await Xo.find(e)})));t.push(...await Promise.all(n))}catch(n){t.push(...e.map((e=>({id:e,data:null})))),console.warn(n)}return t}(n):[],s={hasData:[],noData:[]};r.forEach((e=>{(e.data?s.hasData:s.noData).push(e)})),s.hasData.forEach((e=>{ei[e.id]=e.data}));const o=s.noData.map((e=>e.id));if(o.length){const e=await oi(o,{forceUpdate:!0});Object.assign(ei,e)}Object.assign(ei,this.conf.localBiblio),(()=>{ri(this.conf.biblio)})()}},biblio:ei,name:"core/biblio",resolveRef:ii,updateFromNetwork:oi});const ci="core/render-biblio",li=On({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"ģ°øģ”°"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},ja:{info_references:"参ē…§ē”Øå‚č€ƒę–‡ēŒ®",norm_references:"č¦ēƄēš„å‚č€ƒę–‡ēŒ®",references:"å‚č€ƒę–‡ēŒ®"},de:{info_references:"WeiterfĆ¼hrende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"éžč§„čŒƒę€§å¼•ē”Ø",norm_references:"č§„čŒƒę€§å¼•ē”Ø",references:"å‚č€ƒę–‡ēŒ®"}}),ui=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]),di=(pi=".",e=>{const t=e.trim();return!t||t.endsWith(pi)?t:t+pi});var pi;function fi(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(hi)),s=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),o=s.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),i=bn`<section> + >`}function Qo(e){let t;try{t=function(e){const t=Fo.test(e),n=t?Wo:Uo,[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(jo.test(t)){const[,e,n,r,s]=t.match(jo),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(zo.test(t)){const[,e,n]=t.match(zo);a.push({type:"enum",identifier:e,enumValue:n,renderParent:i})}else if(No.test(t)){const[,e]=t.match(No);i?a.push({type:"exception",identifier:e}):a.push({type:"enum",enumValue:e,renderParent:i})}else if(Oo.test(t)){const[,e,n]=t.match(Oo),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(Mo.test(t)&&o.length){const[,e]=t.match(Mo);a.push({type:"attribute",identifier:e,renderParent:i})}else if(Do.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(!qo.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=mn`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return rr(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=mn(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Bo(e);t&&r.push(t);break}case"attribute":r.push(Vo(e));break;case"internal-slot":r.push(Ho(e));break;case"method":r.push(Yo(e));break;case"enum":r.push(Ko(e));break;case"exception":r.push(Zo(e));break;case"idl-primitive":r.push(Jo(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Xo=new Set(["alias","reference"]),ei=async function(){const e=await gn.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[...Xo]){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<t)&&await r.delete(e.id),o=await o.continue()}}return e}();const ti={get ready(){return ei},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)),await this.get("reference",e)},async has(e,t){if(!Xo.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:r},async get(e,t){if(!Xo.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),s=await n.openCursor(r);return s?s.value:s},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const s={id:r,...e[r],expires:t};s.aliasOf?n.alias.push(s):n.reference.push(s)}const r=[...Xo].flatMap((e=>n[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!Xo.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){const s=await this.get(e,t.id);if(s?.expires<Date.now()){const{store:s}=n.transaction(e,"readwrite");await s.delete(t.id),r=!1}}const{store:s}=n.transaction(e,"readwrite");return r?await s.put(t):await s.add(t)},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Xo],n=e.transaction(t,"readwrite"),r=t.map((e=>n.objectStore(e).clear()));await Promise.all(r)}},ni={},ri=new URL("https://api.specref.org/bibrefs?refs="),si=Cn({hint:"dns-prefetch",href:ri.origin});let oi;document.head.appendChild(si);const ii=new Promise((e=>{oi=e}));async function ai(e,t={forceUpdate:!1}){const n=[...new Set(e)].filter((e=>e.trim()));if(!n.length||!1===navigator.onLine)return null;let r;try{r=await fetch(ri.href+n.join(","))}catch(e){return console.error(e),null}if(!t.forceUpdate&&!r.ok||200!==r.status)return null;const s=await r.json(),o=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),o):o;await ti.addAll(s,e)}catch(e){console.error(e)}return s}async function ci(e){const t=await ii;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await ci(n.aliasOf):n}var li=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map((e=>e.toLowerCase())));Array.from(this.conf.informativeReferences).filter((t=>e.has(t.toLowerCase()))).forEach((e=>this.conf.informativeReferences.delete(e)))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=ni;const e=Object.keys(this.conf.localBiblio).filter((e=>this.conf.localBiblio[e].hasOwnProperty("aliasOf"))).map((e=>this.conf.localBiblio[e].aliasOf)).filter((e=>!this.conf.localBiblio.hasOwnProperty(e)));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter((e=>!this.conf.localBiblio.hasOwnProperty(e))).concat(e).sort())),r=n.length?await async function(e){const t=[];try{await ti.ready;const n=e.map((async e=>({id:e,data:await ti.find(e)})));t.push(...await Promise.all(n))}catch(n){t.push(...e.map((e=>({id:e,data:null})))),console.warn(n)}return t}(n):[],s={hasData:[],noData:[]};r.forEach((e=>{(e.data?s.hasData:s.noData).push(e)})),s.hasData.forEach((e=>{ni[e.id]=e.data}));const o=s.noData.map((e=>e.id));if(o.length){const e=await ai(o,{forceUpdate:!0});Object.assign(ni,e)}Object.assign(ni,this.conf.localBiblio),(()=>{oi(this.conf.biblio)})()}},biblio:ni,name:"core/biblio",resolveRef:ci,updateFromNetwork:ai});const ui="core/render-biblio",di=Nn({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"ģ°øģ”°"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},ja:{info_references:"参ē…§ē”Øå‚č€ƒę–‡ēŒ®",norm_references:"č¦ēƄēš„å‚č€ƒę–‡ēŒ®",references:"å‚č€ƒę–‡ēŒ®"},de:{info_references:"WeiterfĆ¼hrende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"éžč§„čŒƒę€§å¼•ē”Ø",norm_references:"č§„čŒƒę€§å¼•ē”Ø",references:"å‚č€ƒę–‡ēŒ®"}}),pi=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]),fi=(hi=".",e=>{const t=e.trim();return!t||t.endsWith(hi)?t:t+hi});var hi;function mi(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(gi)),s=function(e){const t=new Map;for(const n of e)t.has(n.refcontent.id)||t.set(n.refcontent.id,n);return[...t.values()]}(n),o=s.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),i=mn`<section> <h3>${t}</h3> - <dl class="bibliography">${o.map(gi)}</dl> - </section>`;Hn(i,"",t);const a=function(e){return e.reduce(((e,t)=>{const n=t.refcontent.id;return(e.has(n)?e.get(n):e.set(n,[]).get(n)).push(t.ref),e}),new Map)}(n);return function(e,t){e.map((({ref:e,refcontent:n})=>{const r=`#bib-${e.toLowerCase()}`,s=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(s),refcontent:n}})).forEach((({refUrl:e,elems:t,refcontent:n})=>{t.forEach((t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"}))}))}(s,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#bib-${t.toLowerCase()}"]`)].filter((({textContent:e})=>e.toLowerCase()===t.toLowerCase()));or(`Reference "[${t}]" not found.`,ci,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),i}function hi(e){let t=ei[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;or(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,ci)}else n=t.aliasOf,t=ei[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function mi(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,s=bn`<cite + <dl class="bibliography">${o.map(yi)}</dl> + </section>`;Fn(i,"",t);const a=function(e){return e.reduce(((e,t)=>{const n=t.refcontent.id;return(e.has(n)?e.get(n):e.set(n,[]).get(n)).push(t.ref),e}),new Map)}(n);return function(e,t){e.map((({ref:e,refcontent:n})=>{const r=`#bib-${e.toLowerCase()}`,s=t.get(n.id).map((e=>`a.bibref[href="#bib-${e.toLowerCase()}"]`)).join(",");return{refUrl:r,elems:document.querySelectorAll(s),refcontent:n}})).forEach((({refUrl:e,elems:t,refcontent:n})=>{t.forEach((t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"}))}))}(s,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#bib-${t.toLowerCase()}"]`)].filter((({textContent:e})=>e.toLowerCase()===t.toLowerCase()));rr(`Reference "[${t}]" not found.`,ui,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),i}function gi(e){let t=ni[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;rr(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,ui)}else n=t.aliasOf,t=ni[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function bi(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,s=mn`<cite ><a class="bibref" href="${r}" data-link-type="biblio">${t||n}</a></cite - >`;return t?s:bn`[${s}]`}function gi(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return bn` + >`;return t?s:mn`[${s}]`}function yi(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return mn` <dt id="${r}">[${t}]</dt> <dd> - ${n?{html:bi(n)}:bn`<em class="respec-offending-element" - >${li.reference_not_found}</em + ${n?{html:wi(n)}:mn`<em class="respec-offending-element" + >${di.reference_not_found}</em >`} </dd> - `}function bi(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${di(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${ui.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var yi=Object.freeze({__proto__:null,name:ci,renderInlineCitation:mi,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")||bn`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(bn`<h1>${li.references}</h1>`),r.classList.add("appendix"),n.length){const e=fi(n,li.norm_references);r.appendChild(e)}if(t.length){const e=fi(t,li.info_references);r.appendChild(e)}document.body.appendChild(r)}});const wi="core/inlines",vi={},$i=e=>new RegExp(e.map((e=>e.source)).join("|")),ki=On({en:{rfc2119Keywords:()=>$i([/\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:()=>$i([/\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/])}}),xi=/(?:`[^`]+`)(?!`)/,_i=/(?:{{[^}]+\?*}})/,Si=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,Ci=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,Ri=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Ei=/(?:\[=[^=]+=\])/,Ai=/(?:\[\^[^^]+\^\])/;function Ti(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 bn`<code + `}function wi(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t.endsWith(".")||(t+=". ")),e.publisher&&(t=`${t} ${fi(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${pi.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var vi=Object.freeze({__proto__:null,name:ui,renderInlineCitation:bi,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")||mn`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(mn`<h1>${di.references}</h1>`),r.classList.add("appendix"),n.length){const e=mi(n,di.norm_references);r.appendChild(e)}if(t.length){const e=mi(t,di.info_references);r.appendChild(e)}document.body.appendChild(r)}});const $i="core/inlines",ki={},xi=e=>new RegExp(e.map((e=>e.source)).join("|")),_i=Nn({en:{rfc2119Keywords:()=>xi([/\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:()=>xi([/\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/])}}),Si=/(?:`[^`]+`)(?!`)/,Ci=/(?:{{[^}]+\?*}})/,Ri=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,Ei=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,Ai=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Ti=/(?:\[=[^=]+=\])/,Li=/(?:\[\^[^^]+\^\])/;function Pi(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 mn`<code ><a data-xref-type="${o}" data-xref-for="${i}" @@ -808,45 +808,45 @@ dd{margin-left:0} data-link-for="${i}" >${a}</a ></code - >`}function Li(e){const t=jn(e),n=bn`<em class="rfc2119">${t}</em>`;return vi[t]=!0,n}function Pi(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?bn`<a href="${t}" data-matched-text="${e}"></a>`:bn`<a data-cite="${t}" data-matched-text="${e}"></a>`}function Ii(e,t){const n=jn(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=Zo(n);return!!t.parentElement.closest("dfn,a")?Mi(`\`${r.textContent}\``):r}function Di(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[s,o]=r.split("|").map(jn),{type:i,illegal:a}=Yn(s,t.parentElement),c=mi(s,o),l=s.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;ir("Normative references in informative sections are not allowed. ",wi,{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 Ni(e,t,n){return"ABBR"===t.parentElement.tagName?e:bn`<abbr title="${n.get(e)}">${e}</abbr>`}function ji(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return bn`<var data-type="${r}">${n}</var>`}function Oi(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(jn).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=qi(o),a=n?jn(n):null;return bn`<a + >`}function Ii(e){const t=Dn(e),n=mn`<em class="rfc2119">${t}</em>`;return ki[t]=!0,n}function Di(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?mn`<a href="${t}" data-matched-text="${e}"></a>`:mn`<a data-cite="${t}" data-matched-text="${e}"></a>`}function Ni(e,t){const n=Dn(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=Qo(n);return!!t.parentElement.closest("dfn,a")?zi(`\`${r.textContent}\``):r}function ji(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[s,o]=r.split("|").map(Dn),{type:i,illegal:a}=Gn(s,t.parentElement),c=bi(s,o),l=s.replace(/^(!|\?)/,"");if(a&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;sr("Normative references in informative sections are not allowed. ",$i,{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 Oi(e,t,n){return"ABBR"===t.parentElement.tagName?e:mn`<abbr title="${n.get(e)}">${e}</abbr>`}function Mi(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return mn`<var data-type="${r}">${n}</var>`}function qi(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(Dn).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=Ui(o),a=n?Dn(n):null;return mn`<a data-link-type="dfn|abstract-op" data-link-for="${a}" data-xref-for="${a}" data-lt="${s}" >${i}</a - >`}function Mi(e){const t=e.slice(1,-1);return bn`<code>${t}</code>`}function qi(e){return xi.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?Mi(e):qi(e))):document.createTextNode(e)}var zi=Object.freeze({__proto__:null,name:wi,rfc2119Usage:vi,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new Xn,e.informativeReferences=new Xn,e.respecRFC2119||(e.respecRFC2119=vi);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=jn(e),s=jn(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"],{wsNodes:!1}),o=ki.rfc2119Keywords(),i=new RegExp(`(${$i([o,_i,Si,Ci,Ri,Ei,xi,Ai,...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(Ii(i,n));break;case i.startsWith("[[["):s.append(Pi(i));break;case i.startsWith("[["):s.append(...Di(i,n,e));break;case i.startsWith("|"):s.append(ji(i));break;case i.startsWith("[="):s.append(Oi(i));break;case i.startsWith("`"):s.append(Mi(i));break;case i.startsWith("[^"):s.append(Ti(i));break;case t.has(i):s.append(Ni(i,n,t));break;case o.test(i):s.append(Li(i))}else s.append(i);n.replaceWith(s)}}});const Ui="w3c/conformance",Wi=On({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)=>bn`<p> + >`}function zi(e){const t=e.slice(1,-1);return mn`<code>${t}</code>`}function Ui(e){return Si.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?zi(e):Ui(e))):document.createTextNode(e)}var Wi=Object.freeze({__proto__:null,name:$i,rfc2119Usage:ki,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new Jn,e.informativeReferences=new Jn,e.respecRFC2119||(e.respecRFC2119=ki);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=Dn(e),s=Dn(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"],{wsNodes:!1}),o=_i.rfc2119Keywords(),i=new RegExp(`(${xi([o,Ci,Ri,Ei,Ai,Ti,Si,Li,...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(Ni(i,n));break;case i.startsWith("[[["):s.append(Di(i));break;case i.startsWith("[["):s.append(...ji(i,n,e));break;case i.startsWith("|"):s.append(Mi(i));break;case i.startsWith("[="):s.append(qi(i));break;case i.startsWith("`"):s.append(zi(i));break;case i.startsWith("[^"):s.append(Pi(i));break;case t.has(i):s.append(Oi(i,n,t));break;case o.test(i):s.append(Ii(i))}else s.append(i);n.replaceWith(s)}}});const Fi="w3c/conformance",Bi=Nn({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)=>mn`<p> The key word${t?"s":""} ${e} in this document ${t?"are":"is"} to be interpreted as described in <a href="https://datatracker.ietf.org/doc/html/bcp14">BCP 14</a> - ${mi("RFC2119")} ${mi("RFC8174")} + ${bi("RFC2119")} ${bi("RFC8174")} when, and only when, they appear in all capitals, as shown here. - </p>`},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)=>bn`<p> + </p>`},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)=>mn`<p> ${t?"Die SchlĆ¼sselwƶrter":"Das SchlĆ¼sselwort"} ${e} in diesem Dokument ${t?"sind":"ist"} gemƤƟ <a href="https://datatracker.ietf.org/doc/html/bcp14">BCP 14</a> - ${mi("RFC2119")} ${mi("RFC8174")} + ${bi("RFC2119")} ${bi("RFC8174")} und unter BerĆ¼cksichtigung von <a href="https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst" >2119de</a > zu interpretieren, wenn und nur wenn ${t?"sie":"es"} wie hier gezeigt durchgehend groƟ geschrieben wurde${t?"n":""}. - </p>`}});var Fi=Object.freeze({__proto__:null,name:Ui,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&function(e,t){const n=[...Object.keys(vi)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=Fn(n.sort(),(e=>bn`<em class="rfc2119">${e}</em>`)),s=n.length>1,o=bn` - <h1>${Wi.conformance}</h1> - <p>${Wi.normativity}</p> - ${n.length?Wi.keywordInterpretation(r,s):null} - `;e.prepend(...o.childNodes)}(t,e),!t&&Object.keys(vi).length){ir("Document uses RFC2119 keywords but lacks a conformance section.",Ui,{hint:'Please add a `<section id="conformance">`.'})}}});function Bi(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(s){or(`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 Hi(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return or(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const Gi=new rr;function Vi(e,t){for(const n of t)Gi.has(n)||Gi.set(n,new Set),Gi.get(n).add(e)}const Yi="core/dfn",Ki=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Hi}],["element",{requiresFor:!1,validator:Bi}],["element-attr",{requiresFor:!1,validator:Bi}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Hi}],["event",{requiresFor:!1,validator:Hi}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new vn(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(s){return or(`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:Hi}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Hi(e.slice(1,-1),t,n,r):(or(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Zi=[...Ki.keys()];function Ji(e,t){let n="";switch(!0){case Zi.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>Ki.has(e))),function(e,t,n){const r=Ki.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=pr`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:s}=r,o=pr`Use a ${"[data-dfn-for]"} attribute to associate this with ${s}.`;or(e,Yi,{hint:o,elements:[n]})}r.validator&&r.validator(e,t,n,Yi)}(t,n,e);break;case No.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=pr`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;or(`Internal slot "${e}" must be associated with a WebIDL interface.`,Yi,{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=pr`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,o=`The only allowed types are: ${lr(s,{quotes:!0})}. The slot "${e}" seems to be a "${cr(r)}"?`;return or(n,Yi,{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 Qi(e){switch(!0){case e.matches(".export.no-export"):or(pr`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Yi,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){or(pr`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Yi,{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 Xi=Object.freeze({__proto__:null,name:Yi,run:function(){for(const e of document.querySelectorAll("dfn")){const t=Gn(e);if(Vi(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;Ji(e,n),Qi(e),1===t.length&&n===jn(e.textContent)||(e.dataset.lt=t.join("|"))}}});var ea=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=jn(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=jn(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=jn(n).toLowerCase(),s=$n.isSingular(r)?$n.plural(r):$n.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("|"),Vi(e,n)}}))}});var ta=String.raw`span.example-title{text-transform:none} + </p>`}});var Hi=Object.freeze({__proto__:null,name:Fi,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&function(e,t){const n=[...Object.keys(ki)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=Un(n.sort(),(e=>mn`<em class="rfc2119">${e}</em>`)),s=n.length>1,o=mn` + <h1>${Bi.conformance}</h1> + <p>${Bi.normativity}</p> + ${n.length?Bi.keywordInterpretation(r,s):null} + `;e.prepend(...o.childNodes)}(t,e),!t&&Object.keys(ki).length){sr("Document uses RFC2119 keywords but lacks a conformance section.",Fi,{hint:'Please add a `<section id="conformance">`.'})}}});function Gi(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(s){rr(`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 Vi(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return rr(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const Yi=new tr;function Ki(e,t){for(const n of t)Yi.has(n)||Yi.set(n,new Set),Yi.get(n).add(e)}const Zi="core/dfn",Ji=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Vi}],["element",{requiresFor:!1,validator:Gi}],["element-attr",{requiresFor:!1,validator:Gi}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Vi}],["event",{requiresFor:!1,validator:Vi}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new yn(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(s){return rr(`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:Vi}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Vi(e.slice(1,-1),t,n,r):(rr(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Qi=[...Ji.keys()];function Xi(e,t){let n="";switch(!0){case Qi.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>Ji.has(e))),function(e,t,n){const r=Ji.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=ur`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:s}=r,o=ur`Use a ${"[data-dfn-for]"} attribute to associate this with ${s}.`;rr(e,Zi,{hint:o,elements:[n]})}r.validator&&r.validator(e,t,n,Zi)}(t,n,e);break;case Oo.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=ur`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;rr(`Internal slot "${e}" must be associated with a WebIDL interface.`,Zi,{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=ur`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,o=`The only allowed types are: ${ar(s,{quotes:!0})}. The slot "${e}" seems to be a "${ir(r)}"?`;return rr(n,Zi,{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 ea(e){switch(!0){case e.matches(".export.no-export"):rr(ur`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Zi,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){rr(ur`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Zi,{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 ta=Object.freeze({__proto__:null,name:Zi,run:function(){for(const e of document.querySelectorAll("dfn")){const t=Bn(e);if(Ki(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;Xi(e,n),ea(e),1===t.length&&n===Dn(e.textContent)||(e.dataset.lt=t.join("|"))}}});var na=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=Dn(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=Dn(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=Dn(n).toLowerCase(),s=wn.isSingular(r)?wn.plural(r):wn.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("|"),Ki(e,n)}}))}});var ra=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 na=On({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"ģ˜ˆģ‹œ"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function ra(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",s=n.title?bn`<span class="example-title">: ${n.title}</span>`:"";return bn`<div class="marker"> - <a class="self-link">${na.example}<bdi>${r}</bdi></a +aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff}`;const sa=Nn({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"ģ˜ˆģ‹œ"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function oa(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",s=n.title?mn`<span class="example-title">: ${n.title}</span>`:"";return mn`<div class="marker"> + <a class="self-link">${sa.example}<bdi>${r}</bdi></a >${s} - </div>`}var sa=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(bn`<style> - ${ta} - </style>`,document.querySelector("link"));let t=0;e.forEach((e=>{const n=e.classList.contains("illegal-example"),r={number:t,illegal:n},{title:s}=e;if("aside"===e.localName){++t;const n=ra(e,t,r);e.prepend(n);const o=Hn(e,"example",s||String(t));n.querySelector("a.self-link").href=`#${o}`}else{const n=!!e.closest("aside");n||++t,r.content=e.innerHTML,e.classList.remove("example","illegal-example");const o=e.id?e.id:null;o&&e.removeAttribute("id");const i=ra(e,n?0:t,r),a=bn`<div class="example" id="${o}"> + </div>`}var ia=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(mn`<style> + ${ra} + </style>`,document.querySelector("link"));let t=0;e.forEach((e=>{const n=e.classList.contains("illegal-example"),r={number:t,illegal:n},{title:s}=e;if("aside"===e.localName){++t;const n=oa(e,t,r);e.prepend(n);const o=Fn(e,"example",s||String(t));n.querySelector("a.self-link").href=`#${o}`}else{const n=!!e.closest("aside");n||++t,r.content=e.innerHTML,e.classList.remove("example","illegal-example");const o=e.id?e.id:null;o&&e.removeAttribute("id");const i=oa(e,n?0:t,r),a=mn`<div class="example" id="${o}"> ${i} ${e.cloneNode(!0)} - </div>`;Hn(a,"example",s||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var oa=String.raw`.issue-label{text-transform:initial} + </div>`;Fn(a,"example",s||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}}))}});var aa=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} @@ -856,31 +856,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 ia="core/issues-notes",aa=On({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:"č­¦å‘Š"}});function ca(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?aa.feature_at_risk:aa.issue:n?aa.warning:r?aa.editors_note:aa.note;return{type:o,displayType:i,isFeatureAtRisk:s}}(e),c="issue"===o,l="span"===e.localName,{number:u}=e.dataset,d={type:o,inline:l,title:e.title,number:r(e)};if(!l){const r=bn`<div class="${a?`${o} atrisk`:o}" role="${"note"===o?"note":null}"></div>`,l=document.createElement("span"),p=bn`<div role="heading" class="${`${o}-title marker`}">${l}</div>`;Hn(p,"h",o);let f,h=i;if(e.id?(r.id=e.id,e.removeAttribute("id")):Hn(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 bn`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return bn`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),f=t.get(u),!f){ir(`Failed to fetch issue number ${u}.`,ia)}f&&!d.title&&(d.title=f.title)}s.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,s=t.title?bn`<span style="text-transform: none">: ${t.title}</span>`:"";return bn`<li><a href="${`#${n}`}">${r}</a>${s}</li>`}(aa.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 bn` <a +.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 ca="core/issues-notes",la=Nn({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:"č­¦å‘Š"}});function ua(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?la.feature_at_risk:la.issue:n?la.warning:r?la.editors_note:la.note;return{type:o,displayType:i,isFeatureAtRisk:s}}(e),c="issue"===o,l="span"===e.localName,{number:u}=e.dataset,d={type:o,inline:l,title:e.title,number:r(e)};if(!l){const r=mn`<div class="${a?`${o} atrisk`:o}" role="${"note"===o?"note":null}"></div>`,l=document.createElement("span"),p=mn`<div role="heading" class="${`${o}-title marker`}">${l}</div>`;Fn(p,"h",o);let f,h=i;if(e.id?(r.id=e.id,e.removeAttribute("id")):Fn(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 mn`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return mn`<a href="${t.atRiskBase+e}" />`}(u,n,{isFeatureAtRisk:a});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),f=t.get(u),!f){sr(`Failed to fetch issue number ${u}.`,ca)}f&&!d.title&&(d.title=f.title)}s.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,s=t.title?mn`<span style="text-transform: none">: ${t.title}</span>`:"";return mn`<li><a href="${`#${n}`}">${r}</a>${s}</li>`}(la.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 mn` <a class="respec-gh-label" style="${i}" href="${s.href}" aria-label="${a}" >${r}</a - >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return bn`<span class="issue-label">: ${t}${r}</span>`}(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=Jn(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(bn`<p>${aa.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${aa.issue_summary}</h1>`)}(s)}var la=Object.freeze({__proto__:null,name:ia,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 or(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,ia),new Map;const s=await r.json();return new Map(Object.entries(s))}(e.github),{head:s}=document;s.insertBefore(bn`<style> - ${oa} - </style>`,s.querySelector("link")),ca(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const ua="core/best-practices",da={en:{best_practice:"Best Practice "},ja:{best_practice:"꜀č‰Æå®Ÿę–½ä¾‹ "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"ęœ€ä½³å®žč·µ "}},pa=On(da),fa=l in da?l:"en";var ha=Object.freeze({__proto__:null,name:ua,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=Hn(e,"bp"),s=bn`<a class="marker self-link" href="${`#${r}`}" - ><bdi lang="${fa}">${pa.best_practice}${t+1}</bdi></a - >`;if(n){const t=bn`<li>${s}: ${er(e)}</li>`;n.appendChild(t)}const o=e.closest("div");if(!o)return void e.classList.add("advisement");o.classList.add("advisement");const i=bn`${s.cloneNode(!0)}: ${e}`;o.prepend(...i.childNodes)})),e.length)t&&(t.appendChild(bn`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){ir("Using best practices summary (#bp-summary) but no best practices found.",ua),t.remove()}}});const ma="core/figures",ga=On({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 ba=Object.freeze({__proto__:null,name:ma,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;Hn(e,"fig",r),Kn(t,bn`<span class="fig-title"></span>`),t.prepend(bn`<a class="self-link" href="#${e.id}" - >${ga.fig}<bdi class="figno">${n+1}</bdi></a - >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{Vn(e,"span").removeAttribute("href")})),bn`<li class="tofline"> + >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return mn`<span class="issue-label">: ${t}${r}</span>`}(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=Kn(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(mn`<p>${la.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`<h1>${la.issue_summary}</h1>`)}(s)}var da=Object.freeze({__proto__:null,name:ca,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 rr(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,ca),new Map;const s=await r.json();return new Map(Object.entries(s))}(e.github),{head:s}=document;s.insertBefore(mn`<style> + ${aa} + </style>`,s.querySelector("link")),ua(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const pa="core/best-practices",fa={en:{best_practice:"Best Practice "},ja:{best_practice:"꜀č‰Æå®Ÿę–½ä¾‹ "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"ęœ€ä½³å®žč·µ "}},ha=Nn(fa),ma=o in fa?o:"en";var ga=Object.freeze({__proto__:null,name:pa,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=Fn(e,"bp"),s=mn`<a class="marker self-link" href="${`#${r}`}" + ><bdi lang="${ma}">${ha.best_practice}${t+1}</bdi></a + >`;if(n){const t=mn`<li>${s}: ${Qn(e)}</li>`;n.appendChild(t)}const o=e.closest("div");if(!o)return void e.classList.add("advisement");o.classList.add("advisement");const i=mn`${s.cloneNode(!0)}: ${e}`;o.prepend(...i.childNodes)})),e.length)t&&(t.appendChild(mn`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){sr("Using best practices summary (#bp-summary) but no best practices found.",pa),t.remove()}}});const ba="core/figures",ya=Nn({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 wa=Object.freeze({__proto__:null,name:ba,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;Fn(e,"fig",r),Vn(t,mn`<span class="fig-title"></span>`),t.prepend(mn`<a class="self-link" href="#${e.id}" + >${ya.fig}<bdi class="figno">${n+1}</bdi></a + >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{Hn(e,"span").removeAttribute("href")})),mn`<li class="tofline"> <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a> - </li>`}(t.id,r));else{ir("Found a `<figure>` without a `<figcaption>`.",ma,{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=Zn(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(bn`<h1>${ga.list_of_figures}</h1>`,bn`<ul class="tof"> + </li>`}(t.id,r));else{sr("Found a `<figure>` without a `<figcaption>`.",ba,{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=Yn(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(mn`<h1>${ya.list_of_figures}</h1>`,mn`<ul class="tof"> ${e} - </ul>`))}});const ya=On({en:{list_of_tables:"List of Tables",table:"Table "}});var wa=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;Hn(e,"table",r),Kn(t,bn`<span class="table-title"></span>`),t.prepend(bn`<a class="self-link" href="#${e.id}" - >${ya.table}<bdi class="tableno">${n+1}</bdi></a - >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);for(const e of n.querySelectorAll("a"))Vn(e,"span",{copyAttributes:!1});return bn`<li> + </ul>`))}});const va=Nn({en:{list_of_tables:"List of Tables",table:"Table "}});var $a=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;Fn(e,"table",r),Vn(t,mn`<span class="table-title"></span>`),t.prepend(mn`<a class="self-link" href="#${e.id}" + >${va.table}<bdi class="tableno">${n+1}</bdi></a + >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);for(const e of n.querySelectorAll("a"))Hn(e,"span",{copyAttributes:!1});return mn`<li> <a class="tocxref" href="${`#${e}`}" >${n.childNodes}</a > - </li>`}(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=Zn(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(bn`<h1>${ya.list_of_tables}</h1>`,bn`<ul class="list-of-tables"> + </li>`}(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=Yn(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(mn`<h1>${va.list_of_tables}</h1>`,mn`<ul class="list-of-tables"> ${e} - </ul>`))}});const va=new Set(["callback interface","callback","dictionary","enum","interface mixin","interface","typedef"]);function $a(e,t,{parent:n=""}={}){switch(e.type){case"constructor":case"operation":return function(e,t,n){if(n.includes("!overload"))return ka(e,t,n);const r=`${n}()`;return ka(e,t,r,n)}(e,n,t);default:return ka(e,n,t)}}function ka(e,t,...n){const{type:r}=e;for(const e of n){let n="enum-value"===r&&""===e?"the-empty-string":e,s=_a(n,t,e,r);if(0===s.length&&""!==t){n=`${t}.${n}`;const e=Gi.get(n);e&&1===e.size&&(s=[...e],Vi(s[0],[n]))}else n=e;if(s.length>1){or(`WebIDL identifier \`${e}\` ${t?`for \`${t}\``:""} is defined multiple times`,e,{title:"Duplicate definition.",elements:s})}if(s.length)return s[0]}}function xa(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=Sa(t)}switch(e.querySelector("code")||e.closest("code")||!e.children||Kn(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("|"),Vi(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 _a(e,t,n,r){const s=Gi.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(va.has(r)&&o.length){const e=o.find((e=>e.textContent.trim()===n));if(e)return[e]}return i}function Sa(e={}){const{idlType:t,generic:n,union:r}=e;return void 0===t?"":"string"==typeof t?t:n||(r?t.map(Sa).join("|"):Sa(t))}const Ca=function(){const e=document.createElement("button");return e.innerHTML='<svg height="16" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"/></svg>',e.title="Copy IDL to clipboard",e.classList.add("respec-button-copy-paste","removeOnSave"),e}();function Ra(e){const t=e.closest("pre.idl").cloneNode(!0);t.querySelector(".idlHeader").remove();const{textContent:n}=t,r=Ca.cloneNode(!0);r.addEventListener("click",(()=>{navigator.clipboard.writeText(n)})),e.append(r)}var Ea=Object.freeze({__proto__:null,addCopyIDLButton:Ra,name:"core/webidl-clipboard"});var Aa=String.raw`pre.idl{padding:1em;position:relative} + </ul>`))}});const ka=new Set(["callback interface","callback","dictionary","enum","interface mixin","interface","typedef"]);function xa(e,t,{parent:n=""}={}){switch(e.type){case"constructor":case"operation":return function(e,t,n){if(n.includes("!overload"))return _a(e,t,n);const r=`${n}()`;return _a(e,t,r,n)}(e,n,t);default:return _a(e,n,t)}}function _a(e,t,...n){const{type:r}=e;for(const e of n){let n="enum-value"===r&&""===e?"the-empty-string":e,s=Ca(n,t,e,r);if(0===s.length&&""!==t){n=`${t}.${n}`;const e=Yi.get(n);e&&1===e.size&&(s=[...e],Ki(s[0],[n]))}else n=e;if(s.length>1){rr(`WebIDL identifier \`${e}\` ${t?`for \`${t}\``:""} is defined multiple times`,e,{title:"Duplicate definition.",elements:s})}if(s.length)return s[0]}}function Sa(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=Ra(t)}switch(e.querySelector("code")||e.closest("code")||!e.children||Vn(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("|"),Ki(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 Ca(e,t,n,r){const s=Yi.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(ka.has(r)&&o.length){const e=o.find((e=>e.textContent.trim()===n));if(e)return[e]}return i}function Ra(e={}){const{idlType:t,generic:n,union:r}=e;return void 0===t?"":"string"==typeof t?t:n||(r?t.map(Ra).join("|"):Ra(t))}const Ea=function(){const e=document.createElement("button");return e.innerHTML='<svg height="16" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"/></svg>',e.title="Copy IDL to clipboard",e.classList.add("respec-button-copy-paste","removeOnSave"),e}();function Aa(e){const t=e.closest("pre.idl").cloneNode(!0);t.querySelector(".idlHeader").remove();const{textContent:n}=t,r=Ea.cloneNode(!0);r.addEventListener("click",(()=>{navigator.clipboard.writeText(n)})),e.append(r)}var Ta=Object.freeze({__proto__:null,addCopyIDLButton:Aa,name:"core/webidl-clipboard"});var La=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} @@ -905,37 +905,37 @@ 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 Ta="core/webidl",La=Ta,Pa={},Ia={},Da={wrap:e=>e.flat().filter((e=>""!==e)).map((e=>"string"==typeof e?new Text(e):e)),trivia:e=>e.trim()?bn`<span class="idlSectionComment">${e}</span>`:e,generic:e=>/^[A-Z]/.test(e)?bn`<a data-xref-type="interface" data-cite="WEBIDL">${e}</a>`:bn`<a data-xref-type="dfn" data-cite="WEBIDL">${e}</a>`,reference(e,t,n){if("extended-attribute"===n.type)return e;let r="_IDL_",s=null;if("object"===t)r="interface",s="WEBIDL";return bn`<a +}`;const Pa="core/webidl",Ia=Pa,Da={},Na={},ja={wrap:e=>e.flat().filter((e=>""!==e)).map((e=>"string"==typeof e?new Text(e):e)),trivia:e=>e.trim()?mn`<span class="idlSectionComment">${e}</span>`:e,generic:e=>/^[A-Z]/.test(e)?mn`<a data-xref-type="interface" data-cite="WEBIDL">${e}</a>`:mn`<a data-xref-type="dfn" data-cite="WEBIDL">${e}</a>`,reference(e,t,n){if("extended-attribute"===n.type)return e;let r="_IDL_",s=null;if("object"===t)r="interface",s="WEBIDL";return mn`<a data-link-type="${"_IDL_"===r?"idl":r}" data-xref-type="${r}" data-cite="${s}" data-lt="${undefined}" >${e}</a - >`},name(e,{data:t,parent:n}){if(t.idlType&&"argument-type"===t.idlType.type)return bn`<span class="idlParamName">${e}</span>`;const r=Na(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 Na(e,t,n);default:return e}},type:e=>bn`<span class="idlType">${e}</span>`,inheritance:e=>bn`<span class="idlSuperclass">${e}</span>`,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 bn`<span class="${r}">${e}</span>`}const s=n?n.name:"",{name:o,idlId:i}=Oa(t,s);return bn`<span + >`},name(e,{data:t,parent:n}){if(t.idlType&&"argument-type"===t.idlType.type)return mn`<span class="idlParamName">${e}</span>`;const r=Oa(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 Oa(e,t,n);default:return e}},type:e=>mn`<span class="idlType">${e}</span>`,inheritance:e=>mn`<span class="idlSuperclass">${e}</span>`,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 mn`<span class="${r}">${e}</span>`}const s=n?n.name:"",{name:o,idlId:i}=qa(t,s);return mn`<span class="${r}" id="${i}" data-idl data-title="${o}" >${e}</span - >`},extendedAttribute:e=>bn`<span class="extAttr">${e}</span>`,extendedAttributeReference:e=>bn`<a data-xref-type="extended-attribute">${e}</a>`};function Na(e,t,n){const r=n?n.name:"",{name:s}=Oa(t,r),o=$a(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),xa(o,t,r,s);const n=`#${o.id}`;return bn`<a + >`},extendedAttribute:e=>mn`<span class="extAttr">${e}</span>`,extendedAttributeReference:e=>mn`<a data-xref-type="extended-attribute">${e}</a>`};function Oa(e,t,n){const r=n?n.name:"",{name:s}=qa(t,r),o=xa(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),Sa(o,t,r,s);const n=`#${o.id}`;return mn`<a data-link-for="${r}" data-link-type="${i}" href="${n}" class="internalDFN" ><code>${e}</code></a - >`}const a="operation"===t.type&&"toJSON"===t.name&&t.extAttrs.some((({name:e})=>"Default"===e));if(a)return bn`<a data-link-type="dfn" data-lt="default toJSON steps" + >`}const a="operation"===t.type&&"toJSON"===t.name&&t.extAttrs.some((({name:e})=>"Default"===e));if(a)return mn`<a data-link-type="dfn" data-lt="default toJSON steps" >${e}</a - >`;if(!t.partial){const n=bn`<dfn data-export data-dfn-type="${i}" + >`;if(!t.partial){const n=mn`<dfn data-export data-dfn-type="${i}" >${e}</dfn - >`;return Vi(n,[s]),xa(n,t,r,s),n}const c=bn`<a + >`;return Ki(n,[s]),Sa(n,t,r,s),n}const c=mn`<a data-idl="${t.partial?"partial":null}" data-link-type="${i}" data-title="${t.name}" data-xref-type="${i}" >${e}</a - >`;if(s&&"typedef"!==t.type&&!(t.partial&&!o)){const e=pr`See ${"using `data-dfn-for`|#data-dfn-for"} in ReSpec's documentation.`;ir(`Missing \`<dfn>\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?`${s}()`:s}\` ${t.type}.`,La,{elements:[c],hint:e})}return c}const ja=new WeakMap;function Oa(e,t=""){if(ja.has(e))return ja.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"";Ia[e.name]||(Ia[e.name]=0);return Ia[e.name]+=1,`-partial-${Ia[e.name]}`}(e);break;case"constructor":case"operation":{const r=function(e,t){const n=`${t}.${e}`,r=`${n}()`;let s;Pa[r]||(Pa[r]=0);Pa[n]?s=`!overload-${Pa[n]}`:Pa[n]=0;return Pa[r]+=1,Pa[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 ja.set(e,n),n}const Ma=["interface","interface mixin","dictionary","namespace","enum","typedef","callback"];function qa(e,t){let n;try{n=kn.parse(e.textContent,{sourceName:String(t)})}catch(t){return or(`Failed to parse WebIDL: ${t.bareMessage}.`,La,{title:t.bareMessage,details:`<pre>${t.context}</pre>`,elements:[e]}),[]}e.classList.add("def","idl");const r=kn.write(n,{templates:Da});bn.bind(e)`${r}`,Kn(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&&!Ma.includes(n)&&(e.dataset.dfnFor=r.dataset.title),"dfn"===e.localName&&Vi(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){Bn(e,"webidl");const t=bn`<span class="idlHeader" + >`;if(s&&"typedef"!==t.type&&!(t.partial&&!o)){const e=ur`See ${"using `data-dfn-for`|#data-dfn-for"} in ReSpec's documentation.`;sr(`Missing \`<dfn>\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?`${s}()`:s}\` ${t.type}.`,Ia,{elements:[c],hint:e})}return c}const Ma=new WeakMap;function qa(e,t=""){if(Ma.has(e))return Ma.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"";Na[e.name]||(Na[e.name]=0);return Na[e.name]+=1,`-partial-${Na[e.name]}`}(e);break;case"constructor":case"operation":{const r=function(e,t){const n=`${t}.${e}`,r=`${n}()`;let s;Da[r]||(Da[r]=0);Da[n]?s=`!overload-${Da[n]}`:Da[n]=0;return Da[r]+=1,Da[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 Ma.set(e,n),n}const za=["interface","interface mixin","dictionary","namespace","enum","typedef","callback"];function Ua(e,t){let n;try{n=vn.parse(e.textContent,{sourceName:String(t)})}catch(t){return rr(`Failed to parse WebIDL: ${t.bareMessage}.`,Ia,{title:t.bareMessage,details:`<pre>${t.context}</pre>`,elements:[e]}),[]}e.classList.add("def","idl");const r=vn.write(n,{templates:ja});mn.bind(e)`${r}`,Vn(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&&!za.includes(n)&&(e.dataset.dfnFor=r.dataset.title),"dfn"===e.localName&&Ki(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 Wa(e),n}function Wa(e){Wn(e,"webidl");const t=mn`<span class="idlHeader" ><a class="self-link" href="${`#${e.id}`}">WebIDL</a></span - >`;e.prepend(t),Ra(t)}var Ua=Object.freeze({__proto__:null,addIDLHeader:za,name:Ta,run:async function(){const e=document.querySelectorAll("pre.idl, pre.webidl");if(!e.length)return;const t=document.createElement("style");t.textContent=Aa,document.querySelector("head link, head > *:last-child").before(t);const n=[...e].map(qa),r=kn.validate(n);for(const t of r){let r=`<pre>${Nn(t.context)}</pre>`;if(t.autofix){t.autofix();r+=`Try fixing as:\n <pre>${Nn(kn.write(n[t.sourceName]))}</pre>`}or(`WebIDL validation error: ${t.bareMessage}`,La,{details:r,elements:[e[t.sourceName]],title:t.bareMessage})}document.normalize()}});const Wa="core/data-cite",Fa="__SPEC__";async function Ba(e){const{key:t,frag:n,path:r,href:s}=e;let o="",i="";if(t===Fa)o=document.location.href;else{const e=await ii(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 Ha(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?Kn(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){or("Exporting a linked external definition is not allowed.",Wa,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function Ga(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const Va=Ga("#"),Ya=Ga("/");function Ka(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?Ka(r):{key:Fa,isNormative:!1};return t.cite=o?s:`?${s}`,t.citeFrag=n.replace("#",""),Ka(e)}const i=r?`#${r}`:Va(n),a=s||Ya(n).split("#")[0],{type:c}=Yn(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 Za(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 Ja=Object.freeze({__proto__:null,THIS_SPEC:Fa,name:Wa,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(Ka).map((async e=>({entry:e,result:await ii(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await oi(n);r&&Object.assign(ei,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=Ka(t),r=await Ba(n);if(r)Ha(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),ir(n,Wa,{elements:[t]})}}o("beforesave",Za)},toCiteDetails:Ka});const Qa="core/link-to-dfn",Xa=[],ec={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:"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚"}},tc=On(ec);function nc(e){const t=new Map,n=[];for(const r of Gi.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),Hn(r,"dfn",e)}}return{result:t,duplicates:n}}function rc(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=Gn(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 sc(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=oc(e)&&oc(t,n);r&&!s||Kn(e,document.createElement("code"))}(e,t),!r}function oc(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 ic(e){e.forEach((e=>{ir(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,Qa,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var ac=Object.freeze({__proto__:null,name:Qa,possibleExternalLinks:Xa,run:async function(e){const t=function(){const e=new rr;for(const t of Gi.keys()){const{result:n,duplicates:r}=nc(t);e.set(t,n),r.length>0&&or(tc.duplicateMsg(t),Qa,{title:tc.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){Xa.push(e);continue}const r=rc(e,t);if(r){sc(e,r,t)||Xa.push(e)}else""===e.dataset.cite?n.push(e):Xa.push(e)}ic(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${Fa}$2`);const{key:r,isNormative:s}=Ka(t);r!==Fa&&(s||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||ic(Xa)}});const cc="xrefs",lc=3e5;async function uc(){return await yn.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach((t=>e.deleteObjectStore(t)));e.createObjectStore(cc,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function dc(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-t<lc)return!1;const r=new URL("meta/version",hc).href,s=await fetch(r);if(!s.ok)return!1;const o=await s.text();return localStorage.setItem(e,n.toString()),parseInt(o,10)>t}())return await async function(){try{await uc().then((e=>e.clear(cc)))}catch(e){console.error(e)}}(),t;const n=new Set(e.map((e=>e.id)));try{const e=await uc();let r=await e.transaction(cc).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 pc="core/xref",fc={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},hc="https://respec.org/xref/",mc=[];if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=En({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function gc(e){const t="xrefType"in e.dataset;let n=bc(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 jn(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return jn(t.dataset.xrefFor)}return null}(e,t);return{id:"",term:n,types:s,...r.length&&{specs:r},..."string"==typeof o&&{for:o}}}function bc(e){const{lt:t}=e.dataset;let n=t?t.split("|",1)[0]:e.textContent;return n=jn(n),"the-empty-string"===n?"":n}function yc(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),type: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(Rn);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)}mc.push({term:r,spec:t,element:e})}(e,p,l,s,r)}function wc(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(vc)}function vc(e){return[...new Uint8Array(e)].map((e=>e.toString(16).padStart(2,"0"))).join("")}function $c(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 kc=Object.freeze({__proto__:null,API_URL:hc,getTermFromElement:bc,informativeRefsInNormative:mc,name:pc,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:new URL("search/",hc).href,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":e.toLowerCase()in fc?Object.assign(n,{specs:fc[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 fc){const r=(e.specs??[]).concat(fc[t]);Object.assign(n,{specs:r})}else r(e.profile)}break;default:or(`Invalid value for \`xref\` configuration option. Received: "${e}".`,pc)}return n;function r(e){or(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${Dn(Object.keys(fc),(e=>`"${e}"`))}.`,pc)}}(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=Xa.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=gc(e);t.id=await wc(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 dc(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 uc()).transaction(cc,"readwrite");for(const r of e){const e=t.get(r.id);n.objectStore(cc).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<i;o++){if(e[o].closest("[data-no-xref]"))continue;const i=e[o],a=t[o],{id:c}=a,l=n.get(c);if(1===l.length)yc(i,a,l[0],r);else{const e=s[0===l.length?"notFound":"ambiguous"];e.has(c)||e.set(c,{elems:[],results:l,query:a}),e.get(c).elems.push(i)}}!function({ambiguous:e,notFound:t}){const n=(e,t,n=[])=>{const r=new URL(hc);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)=>pr`[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=bc(s[0]),i=n(o,e),a=In(t,(e=>`**[${e}]**`)),c=r(i,o);or(`Couldn't find "**${o}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,pc,{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=In(e,(e=>`**[${e}]**`)),a=bc(s[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",u=r(c,a),d=pr`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification.`+String.raw` ${u}`;or(`The term "**${a}**"${l} is ambiguous because it's defined in ${i}.`,pc,{title:"Definition is ambiguous.",elements:s,hint:d})}}(s)}(n,r,s,e),o("beforesave",$c)}});var xc=String.raw`ul.index{columns:30ch;column-gap:1.5em} + >`;e.prepend(t),Aa(t)}var Fa=Object.freeze({__proto__:null,addIDLHeader:Wa,name:Pa,run:async function(){const e=document.querySelectorAll("pre.idl, pre.webidl");if(!e.length)return;const t=document.createElement("style");t.textContent=La,document.querySelector("head link, head > *:last-child").before(t);const n=[...e].map(Ua),r=vn.validate(n);for(const t of r){let r=`<pre>${In(t.context)}</pre>`;if(t.autofix){t.autofix();r+=`Try fixing as:\n <pre>${In(vn.write(n[t.sourceName]))}</pre>`}rr(`WebIDL validation error: ${t.bareMessage}`,Ia,{details:r,elements:[e[t.sourceName]],title:t.bareMessage})}document.normalize()}});const Ba="core/data-cite",Ha="__SPEC__";async function Ga(e){const{key:t,frag:n,path:r,href:s}=e;let o="",i="";if(t===Ha)o=document.location.href;else{const e=await ci(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 Va(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?Vn(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){rr("Exporting a linked external definition is not allowed.",Ba,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function Ya(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const Ka=Ya("#"),Za=Ya("/");function Ja(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?Ja(r):{key:Ha,isNormative:!1};return t.cite=o?s:`?${s}`,t.citeFrag=n.replace("#",""),Ja(e)}const i=r?`#${r}`:Ka(n),a=s||Za(n).split("#")[0],{type:c}=Gn(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 Qa(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 Xa=Object.freeze({__proto__:null,THIS_SPEC:Ha,name:Ba,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(Ja).map((async e=>({entry:e,result:await ci(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await ai(n);r&&Object.assign(ni,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=Ja(t),r=await Ga(n);if(r)Va(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),sr(n,Ba,{elements:[t]})}}hr("beforesave",Qa)},toCiteDetails:Ja});const ec="core/link-to-dfn",tc=[],nc={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:"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚"}},rc=Nn(nc);function sc(e){const t=new Map,n=[];for(const r of Yi.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),Fn(r,"dfn",e)}}return{result:t,duplicates:n}}function oc(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=Bn(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 ic(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=ac(e)&&ac(t,n);r&&!s||Vn(e,document.createElement("code"))}(e,t),!r}function ac(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 cc(e){e.forEach((e=>{sr(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,ec,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var lc=Object.freeze({__proto__:null,name:ec,possibleExternalLinks:tc,run:async function(e){const t=function(){const e=new tr;for(const t of Yi.keys()){const{result:n,duplicates:r}=sc(t);e.set(t,n),r.length>0&&rr(rc.duplicateMsg(t),ec,{title:rc.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){tc.push(e);continue}const r=oc(e,t);if(r){ic(e,r,t)||tc.push(e)}else""===e.dataset.cite?n.push(e):tc.push(e)}cc(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${Ha}$2`);const{key:r,isNormative:s}=Ja(t);r!==Ha&&(s||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||cc(tc)}});const uc="xrefs",dc=3e5;async function pc(){return await gn.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach((t=>e.deleteObjectStore(t)));e.createObjectStore(uc,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function fc(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-t<dc)return!1;const r=new URL("meta/version",gc).href,s=await fetch(r);if(!s.ok)return!1;const o=await s.text();return localStorage.setItem(e,n.toString()),parseInt(o,10)>t}())return await async function(){try{await pc().then((e=>e.clear(uc)))}catch(e){console.error(e)}}(),t;const n=new Set(e.map((e=>e.id)));try{const e=await pc();let r=await e.transaction(uc).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 hc="core/xref",mc={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},gc="https://respec.org/xref/",bc=[];if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=Cn({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function yc(e){const t="xrefType"in e.dataset;let n=wc(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 Dn(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return Dn(t.dataset.xrefFor)}return null}(e,t);return{id:"",term:n,types:s,...r.length&&{specs:r},..."string"==typeof o&&{for:o}}}function wc(e){const{lt:t}=e.dataset;let n=t?t.split("|",1)[0]:e.textContent;return n=Dn(n),"the-empty-string"===n?"":n}function vc(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(Sn);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)}bc.push({term:r,spec:t,element:e})}(e,p,l,s,r)}function $c(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(kc)}function kc(e){return[...new Uint8Array(e)].map((e=>e.toString(16).padStart(2,"0"))).join("")}function xc(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 _c=Object.freeze({__proto__:null,API_URL:gc,getTermFromElement:wc,informativeRefsInNormative:bc,name:hc,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:new URL("search/",gc).href,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":e.toLowerCase()in mc?Object.assign(n,{specs:mc[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 mc){const r=(e.specs??[]).concat(mc[t]);Object.assign(n,{specs:r})}else r(e.profile)}break;default:rr(`Invalid value for \`xref\` configuration option. Received: "${e}".`,hc)}return n;function r(e){rr(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${Pn(Object.keys(mc),(e=>`"${e}"`))}.`,hc)}}(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=tc.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=yc(e);t.id=await $c(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 fc(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 pc()).transaction(uc,"readwrite");for(const r of e){const e=t.get(r.id);n.objectStore(uc).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<i;o++){if(e[o].closest("[data-no-xref]"))continue;const i=e[o],a=t[o],{id:c}=a,l=n.get(c);if(1===l.length)vc(i,a,l[0],r);else{const e=s[0===l.length?"notFound":"ambiguous"];e.has(c)||e.set(c,{elems:[],results:l,query:a}),e.get(c).elems.push(i)}}!function({ambiguous:e,notFound:t}){const n=(e,t,n=[])=>{const r=new URL(gc);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)=>ur`[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=wc(s[0]),i=n(o,e),a=Ln(t,(e=>`**[${e}]**`)),c=r(i,o);rr(`Couldn't find "**${o}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,hc,{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=Ln(e,(e=>`**[${e}]**`)),a=wc(s[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",u=r(c,a),d=ur`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification.`+String.raw` ${u}`;rr(`The term "**${a}**"${l} is ambiguous because it's defined in ${i}.`,hc,{title:"Definition is ambiguous.",elements:s,hint:d})}}(s)}(n,r,s,e),hr("beforesave",xc)}});var Sc=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} @@ -943,37 +943,37 @@ ul.index code{color:inherit} #index-defined-here .print-only{display:none} @media print{ #index-defined-here .print-only{display:initial} -}`;const _c=On({en:{heading:"Index",headingExternal:"Terms defined by reference",headlingLocal:"Terms defined by this specification",dfnOf:"definition of"}}),Sc=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function Cc(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function Rc(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?t.dataset.dfnFor:""}function Ec(e,t,n=""){if(n.startsWith("[[")){return`internal slot for <code>${Rc(e)}</code>`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for <code>${Rc(e)}</code>`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for <code>${Rc(e)}</code>`;default:return""}}function Ac(){document.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.append((e=>{const t=`Ā§${document.getElementById(e).closest("section").querySelector(".secno").textContent.trim()}`;return bn`<span class="print-only">${t}</span>`})(e.dataset.id))))}function Tc(){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{type:c,linkFor:l}=r.dataset,u=bc(r);if(!u)continue;const d=Ka(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 Lc(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let s=Nn(t);Sc.has(n)&&("extended-attribute"===n&&(s=`[${s}]`),s=`<code>${s}</code>`);const o=Ic.has(t)?"type":Pc.get(n);o&&(s+=` ${o}`);if(r){let e=r;/\s/.test(r)||(e=`<code>${e}</code>`),"element-attr"===n&&(e+=" element"),s+=` (for ${e})`}return s}(e);return bn`<li> +}`;const Cc=Nn({en:{heading:"Index",headingExternal:"Terms defined by reference",headlingLocal:"Terms defined by this specification",dfnOf:"definition of"}}),Rc=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function Ec(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function Ac(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?t.dataset.dfnFor:""}function Tc(e,t,n=""){if(n.startsWith("[[")){return`internal slot for <code>${Ac(e)}</code>`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for <code>${Ac(e)}</code>`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for <code>${Ac(e)}</code>`;default:return""}}function Lc(){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 mn`<span class="print-only">${t}</span>`})(e.dataset.id))))}function Pc(){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=wc(r);if(!u)continue;const d=Ja(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 Ic(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let s=In(t);Rc.has(n)&&("extended-attribute"===n&&(s=`[${s}]`),s=`<code>${s}</code>`);const o=Nc.has(t)?"type":Dc.get(n);o&&(s+=` ${o}`);if(r){let e=r;/\s/.test(r)||(e=`<code>${e}</code>`),"element-attr"===n&&(e+=" element"),s+=` (for ${e})`}return s}(e);return mn`<li> <span class="index-term" data-href="${t.href}">${{html:n}}</span> - </li>`}const Pc=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),Ic=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 Dc(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 Nc=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return void o("toc",(()=>{}),{once:!0});const t=document.createElement("style");t.textContent=xc,document.head.appendChild(t),e.classList.add("appendix"),e.querySelector("h2, h1")||e.prepend(bn`<h1>${_c.heading}</h1>`);const n=bn`<section id="index-defined-here"> - <h3>${_c.headlingLocal}</h3> - ${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=jn(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 bn`<ul class="index"> - ${e.map((([e,t])=>function(e,t){const n=(e,t,n)=>{const r=`#${e.id}`;return bn`<li data-id=${e.id}> + </li>`}const Dc=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),Nc=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 jc(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 Oc=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return void hr("toc",(()=>{}),{once:!0});const t=document.createElement("style");t.textContent=Sc,document.head.appendChild(t),e.classList.add("appendix"),e.querySelector("h2, h1")||e.prepend(mn`<h1>${Cc.heading}</h1>`);const n=mn`<section id="index-defined-here"> + <h3>${Cc.headlingLocal}</h3> + ${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=Dn(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 mn`<ul class="index"> + ${e.map((([e,t])=>function(e,t){const n=(e,t,n)=>{const r=`#${e.id}`;return mn`<li data-id=${e.id}> <a class="index-term" href="${r}">${{html:t}}</a> ${n?{html:n}:""} - </li>`};if(1===t.length){const r=t[0],s=Cc(r),o=function(e,t,n){let r=n;"enum-value"===t&&(r=`"${r}"`);(Sc.has(t)||e.dataset.idl||e.closest("code"))&&(r=`<code>${r}</code>`);return r}(r,s,e),i=Ec(r,s,e);return n(r,o,i)}return bn`<li> + </li>`};if(1===t.length){const r=t[0],s=Ec(r),o=function(e,t,n){let r=n;"enum-value"===t&&(r=`"${r}"`);(Rc.has(t)||e.dataset.idl||e.closest("code"))&&(r=`<code>${r}</code>`);return r}(r,s,e),i=Tc(r,s,e);return n(r,o,i)}return mn`<li> ${e} <ul> - ${t.map((t=>{const r=Ec(t,Cc(t),e)||_c.dfnOf;return n(t,r)}))} + ${t.map((t=>{const r=Tc(t,Ec(t),e)||Cc.dfnOf;return n(t,r)}))} </ul> </li>`}(e,t)))} </ul>`}()} - </section>`;e.append(n);const r=bn`<section id="index-defined-elsewhere"> - <h3>${_c.headingExternal}</h3> - ${function(){const e=[...Tc().entries()].sort((([e],[t])=>e.localeCompare(t)));return bn`<ul class="index"> - ${e.map((([e,t])=>bn`<li data-spec="${e}"> - ${mi(e)} defines the following: + </section>`;e.append(n);const r=mn`<section id="index-defined-elsewhere"> + <h3>${Cc.headingExternal}</h3> + ${function(){const e=[...Pc().entries()].sort((([e],[t])=>e.localeCompare(t)));return mn`<ul class="index"> + ${e.map((([e,t])=>mn`<li data-spec="${e}"> + ${bi(e)} defines the following: <ul> - ${t.sort(((e,t)=>e.term.localeCompare(t.term))).map(Lc)} + ${t.sort(((e,t)=>e.term.localeCompare(t.term))).map(Ic)} </ul> </li>`))} </ul>`}()} - </section>`;e.append(r);for(const e of r.querySelectorAll(".index-term"))Hn(e,"index-term");o("toc",Ac,{once:!0}),o("beforesave",Dc)}});const jc="core/contrib";var Oc=Object.freeze({__proto__:null,name:jc,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void or(pr`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,jc)}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 bn(t)`${n.map((({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`))}`;const r=n.map((e=>e.name||e.login));t.textContent=In(r)}(r,n):n.textContent="Failed to fetch contributors.";async function s(){const{href:n}=new URL("contributors",t);try{const t=await Un(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 or("Error loading contributors from GitHub.",jc),console.error(e),null}}}(t,n)}});var Mc=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);Vn(e,`h${t}`)}))}});var qc=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(Rn)));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),Kn(r,document.createElement("code")),za(r)}});const zc=["h2","h3","h4","h5","h6"],Uc="core/structure",Wc=On({en:{toc:"Table of Contents"},zh:{toc:"内容大ēŗ²"},ko:{toc:"ėŖ©ģ°Ø"},ja:{toc:"ē›®ę¬”"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Fc(e,t,{prefix:n=""}={}){let r=!1,s=0,o=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const i=bn`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(s=o,r=!0);let e=a.isIntro?"":r?Bc(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(bn`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=Gc(a.header,n),s=Fc(a.subsections,t,{prefix:e});s&&r.append(s),i.append(r)}}return i}function Bc(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Hc(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;Hn(e,null,s),n.push({element:e,header:r,title:s,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Hc(e)})}return n}function Gc(e,t){const n=bn`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=Vn(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{Vn(e,"span").removeAttribute("id")})),bn`<li class="tocline">${n}</li>`}var Vc=Object.freeze({__proto__:null,name:Uc,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(Jn(e,"section").length+1,6)}`;e.localName!==t&&Vn(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)){or("`data-max-toc` must have a value between 0-6 (inclusive).",Uc,{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=Fc(Hc(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=bn`<nav id="toc"></nav>`,n=bn`<h2 class="introductory">${Wc.toc}</h2>`;Hn(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=bn`<p role="navigation" id="back-to-top"> + </section>`;e.append(r);for(const e of r.querySelectorAll(".index-term"))Fn(e,"index-term");hr("toc",Lc,{once:!0}),hr("beforesave",jc)}});const Mc="core/contrib";var qc=Object.freeze({__proto__:null,name:Mc,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void rr(ur`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Mc)}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 mn(t)`${n.map((({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`))}`;const r=n.map((e=>e.name||e.login));t.textContent=Ln(r)}(r,n):n.textContent="Failed to fetch contributors.";async function s(){const{href:n}=new URL("contributors",t);try{const t=await qn(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 rr("Error loading contributors from GitHub.",Mc,{cause:e}),null}}}(t,n)}});var zc=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);Hn(e,`h${t}`)}))}});var Uc=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(Sn)));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),Vn(r,document.createElement("code")),Wa(r)}});const Wc=["h2","h3","h4","h5","h6"],Fc="core/structure",Bc=Nn({en:{toc:"Table of Contents"},zh:{toc:"内容大ēŗ²"},ko:{toc:"ėŖ©ģ°Ø"},ja:{toc:"ē›®ę¬”"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function Hc(e,t,{prefix:n=""}={}){let r=!1,s=0,o=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const i=mn`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(s=o,r=!0);let e=a.isIntro?"":r?Gc(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(mn`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=Yc(a.header,n),s=Hc(a.subsections,t,{prefix:e});s&&r.append(s),i.append(r)}}return i}function Gc(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Vc(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(!Wc.includes(r.localName))continue;const s=r.textContent;Fn(e,null,s),n.push({element:e,header:r,title:s,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Vc(e)})}return n}function Yc(e,t){const n=mn`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach((e=>{const t=Hn(e,"span");t.className="formerLink",t.removeAttribute("href")})),r.querySelectorAll("dfn").forEach((e=>{Hn(e,"span").removeAttribute("id")})),mn`<li class="tocline">${n}</li>`}var Kc=Object.freeze({__proto__:null,name:Fc,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(Kn(e,"section").length+1,6)}`;e.localName!==t&&Hn(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)){rr("`data-max-toc` must have a value between 0-6 (inclusive).",Fc,{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=Hc(Vc(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=mn`<nav id="toc"></nav>`,n=mn`<h2 class="introductory">${Bc.toc}</h2>`;Fn(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=mn`<p role="navigation" id="back-to-top"> <a href="#title"><abbr title="Back to Top">↑</abbr></a> - </p>`;document.body.append(s)}(t)}s("toc")}});const Yc=On({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:"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚"}});var Kc=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(bn`<p><em>${Yc.informative}</em></p>`)}))}});const Zc=On({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${jn(t.textContent)}`),n}}});var Jc=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||(Hn(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=Zc.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),s=bn`<div class="header-wrapper"></div>`;n.replaceWith(s);const o=bn`<a + </p>`;document.body.append(s)}(t)}fr("toc")}});const Zc=Nn({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:"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚"}});var Jc=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(mn`<p><em>${Zc.informative}</em></p>`)}))}});const Qc=Nn({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${Dn(t.textContent)}`),n}}});var Xc=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||(Fn(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=Qc.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),s=mn`<div class="header-wrapper"></div>`;n.replaceWith(s);const o=mn`<a href="#${t}" class="self-link" aria-label="${r}" - ></a>`;s.append(n,o)}}});var Qc=String.raw`.caniuse-stats{display:flex;column-gap:2em} + ></a>`;s.append(n,o)}}});var el=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} @@ -991,12 +991,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 Xc="core/caniuse",el="https://respec.org/caniuse/",tl=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"}]]),nl=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 rl=Object.freeze({__proto__:null,BROWSERS:tl,name:Xc,prepare:function(e){if(!e.caniuse)return;!function(e){const t=new Set(tl.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=>!tl.has(e)));if(n.length){ir(pr`Invalid browser(s): (${ur(n,{quotes:!0})}) in the \`browser\` property of ${"[caniuse]"}.`,Xc)}}(e);const t=e.caniuse;t.feature&&document.head.appendChild(bn`<style +}`;const tl="core/caniuse",nl="https://respec.org/caniuse/",rl=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"}]]),sl=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 ol=Object.freeze({__proto__:null,BROWSERS:rl,name:tl,prepare:function(e){if(!e.caniuse)return;!function(e){const t=new Set(rl.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=>!rl.has(e)));if(n.length){sr(ur`Invalid browser(s): (${cr(n,{quotes:!0})}) in the \`browser\` property of ${"[caniuse]"}.`,tl)}}(e);const t=e.caniuse;t.feature&&document.head.appendChild(mn`<style id="caniuse-stylesheet" class="${t.removeOnSave?"removeOnSave":""}" > - ${Qc} - </style>`)},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"),i=async function(e){const{feature:t,browsers:n,apiURL:r}=e,s=new URL(r||`./${t}`,el);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}=tl.get(n),a=`${o}${r?` version ${r}`:""}`,c=nl.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=tl.get(e).path??e;return`https://www.w3.org/assets/logos/browser-logos/${t}/${t}.svg`}(n),m=bn` + ${el} + </style>`)},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}`,nl);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}=rl.get(n),a=`${o}${r?` version ${r}`:""}`,c=sl.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=rl.get(e).path??e;return`https://www.w3.org/assets/logos/browser-logos/${t}/${t}.svg`}(n),m=mn` <div class="${u}" title="${d}" aria-label="${l}"> <img class="caniuse-browser" @@ -1006,16 +1006,16 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0} alt="${o} logo" /><span class="browser-version">${f}</span> </div> - `;return t.get(i).push(m),t}}(t);n.reduce(s,r);const o=[...r].filter((([,e])=>e.length)).map((([e,t])=>bn`<div class="caniuse-group"> + `;return t.get(i).push(m),t}}(t);n.reduce(s,r);const o=[...r].filter((([,e])=>e.length)).map((([e,t])=>mn`<div class="caniuse-group"> <div class="caniuse-browsers">${t}</div> <div class="caniuse-type"><span>${e}</div> - </div>`));return o.push(bn`<a class="caniuse-cell" href="https://caniuse.com/${t}" + </div>`));return o.push(mn`<a class="caniuse-cell" href="https://caniuse.com/${t}" >More info</a - >`),o}(e,t))).catch((e=>function(e,t,n){const r=`Failed to retrieve feature "${t.feature}".`,s=pr`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${"[caniuse]"}.`;return or(r,Xc,{hint:s}),console.error(e),bn`<a href="${n}">caniuse.com</a>`}(e,t,n))),a=bn`<dt class="caniuse-title">Browser support:</dt> + >`),o}(e,t))).catch((e=>function(e,t,n){const r=`Failed to retrieve feature "${t.feature}".`,s=ur`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${"[caniuse]"}.`;return rr(r,tl,{hint:s,cause:e}),mn`<a href="${n}">caniuse.com</a>`}(e,t,n))),o=mn`<dt class="caniuse-title">Browser support:</dt> <dd class="caniuse-stats"> - ${{any:i,placeholder:"Fetching data from caniuse.com..."}} - </dd>`;r.append(...a.childNodes),await i,s("amend-user-config",{caniuse:t.feature}),t.removeOnSave&&(r.querySelectorAll(".caniuse-browser").forEach((e=>e.classList.add("removeOnSave"))),o("beforesave",(e=>{bn.bind(e.querySelector(".caniuse-stats"))` - <a href="${n}">caniuse.com</a>`})))}});var sl=String.raw`.mdn{font-size:.75em;position:absolute;right:.3em;min-width:0;margin-top:3rem} + ${{any:s,placeholder:"Fetching data from caniuse.com..."}} + </dd>`;r.append(...o.childNodes),await s,fr("amend-user-config",{caniuse:t.feature}),t.removeOnSave&&(r.querySelectorAll(".caniuse-browser").forEach((e=>e.classList.add("removeOnSave"))),hr("beforesave",(e=>{mn.bind(e.querySelector(".caniuse-stats"))` + <a href="${n}">caniuse.com</a>`})))}});var il=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} @@ -1038,33 +1038,33 @@ 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 ol="core/mdn-annotation",il="https://w3c.github.io/mdn-spec-links/",al="https://developer.mozilla.org/en-US/docs/Web/",cl={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"},ll=On({en:{inAllEngines:"This feature is in all major engines.",inSomeEngines:"This feature has limited support."},zh:{inAllEngines:"ꉀ꜉äø»č¦å¼•ę“Žå‡ę”Æꌁꭤē‰¹ę€§ć€‚",inSomeEngines:"ę­¤åŠŸčƒ½ę”Æꌁ꜉限怂"}});function ul(e){const t=e.closest("section");if(!t)return;const{previousElementSibling:n}=t;if(n&&n.classList.contains("mdn"))return n;const r=bn`<aside class="mdn"></aside>`;return t.before(r),r}function dl(e){const{name:t,slug:n,summary:r,support:s,engines:o}=e,i=n.slice(n.indexOf("/")+1),a=`${al}${n}`,c=`Expand MDN details for ${t}`,l=function(e){if(3===e.length)return bn`<span title="${ll.inAllEngines}">āœ…</span>`;if(e.length<2)return bn`<span title="${ll.inSomeEngines}">šŸš«</span>`;return bn`<span> </span>`}(o);return bn`<details> +.mdn .webview_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/android-webview/android-webview.png)}`;const al="core/mdn-annotation",cl="https://w3c.github.io/mdn-spec-links/",ll="https://developer.mozilla.org/en-US/docs/Web/",ul={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"},dl=Nn({en:{inAllEngines:"This feature is in all major engines.",inSomeEngines:"This feature has limited support."},zh:{inAllEngines:"ꉀ꜉äø»č¦å¼•ę“Žå‡ę”Æꌁꭤē‰¹ę€§ć€‚",inSomeEngines:"ę­¤åŠŸčƒ½ę”Æꌁ꜉限怂"}});function pl(e){const t=e.closest("section");if(!t)return;const{previousElementSibling:n}=t;if(n&&n.classList.contains("mdn"))return n;const r=mn`<aside class="mdn"></aside>`;return t.before(r),r}function fl(e){const{name:t,slug:n,summary:r,support:s,engines:o}=e,i=n.slice(n.indexOf("/")+1),a=`${ll}${n}`,c=`Expand MDN details for ${t}`,l=function(e){if(3===e.length)return mn`<span title="${dl.inAllEngines}">āœ…</span>`;if(e.length<2)return mn`<span title="${dl.inSomeEngines}">šŸš«</span>`;return mn`<span> </span>`}(o);return mn`<details> <summary aria-label="${c}"><span>MDN</span>${l}</summary> <a title="${r}" href="${a}">${i}</a> - ${function(e){if(3===e.length)return bn`<p class="engines-all">${ll.inAllEngines}</p>`;if(e.length<2)return bn`<p class="engines-some">${ll.inSomeEngines}</p>`}(o)} - ${s?function(e){function t(e,t,n){const r="Unknown"===t?"?":t,s=`${e} ${t.toLowerCase()}`;return bn`<tr class="${s}"> - <td>${cl[e]}</td> + ${function(e){if(3===e.length)return mn`<p class="engines-all">${dl.inAllEngines}</p>`;if(e.length<2)return mn`<p class="engines-some">${dl.inSomeEngines}</p>`}(o)} + ${s?function(e){function t(e,t,n){const r="Unknown"===t?"?":t,s=`${e} ${t.toLowerCase()}`;return mn`<tr class="${s}"> + <td>${ul[e]}</td> <td>${n||r}</td> - </tr>`}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 bn`<table> - ${Object.keys(cl).map((r=>e[r]?n(r,e[r]):t(r,"Unknown","")))} - </table>`}(s):bn`<p class="nosupportdata">No support data.</p>`} - </details>`}var pl=Object.freeze({__proto__:null,name:ol,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=il,maxAge:r=864e5}=t,s=new URL(`${e}.json`,n).href,o=await Un(s,r);if(404===o.status){return void or(`Could not find MDN data associated with key "${e}".`,ol,{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=sl,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=ul(e);if(r)for(const e of t)r.append(dl(e))}}});const fl="ui/save-html",hl=On({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"äæå­˜ć™ć‚‹"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"åƼå‡ŗ"}}),ml=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return mr(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return mr(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 gl=Object.freeze({__proto__:null,exportDocument:function(e,t){return ir("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",fl,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),mr(t)},name:fl,run:function(e){const t={async show(t){await document.respec.ready;const n=bn`<div class="respec-save-buttons"> - ${ml.map((t=>function(e,t){const{id:n,href:r,ext:s,title:o,type:i}=e,a=qn(t.publishDate||new Date),c=[t.specStatus,t.shortName||"spec",a].join("-");return bn`<a + </tr>`}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 mn`<table> + ${Object.keys(ul).map((r=>e[r]?n(r,e[r]):t(r,"Unknown","")))} + </table>`}(s):mn`<p class="nosupportdata">No support data.</p>`} + </details>`}var hl=Object.freeze({__proto__:null,name:al,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=cl,maxAge:r=864e5}=t,s=new URL(`${e}.json`,n).href,o=await qn(s,r);if(404===o.status){return void rr(`Could not find MDN data associated with key "${e}".`,al,{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=il,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=pl(e);if(r)for(const e of t)r.append(fl(e))}}});const ml="ui/save-html",gl=Nn({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"äæå­˜ć™ć‚‹"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"åƼå‡ŗ"}}),bl=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return br(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return br(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 yl=Object.freeze({__proto__:null,exportDocument:function(e,t){return sr("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",ml,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),br(t)},name:ml,run:function(e){const t={async show(t){await document.respec.ready;const n=mn`<div class="respec-save-buttons"> + ${bl.map((t=>function(e,t){const{id:n,href:r,ext:s,title:o,type:i}=e,a=On(t.publishDate||new Date),c=[t.specStatus,t.shortName||"spec",a].join("-");return mn`<a href="${r}" id="${n}" download="${c}.${s}" type="${i}" class="respec-save-button" - onclick=${()=>Gr.closeModal()} + onclick=${()=>Yr.closeModal()} >${o}</a >`}(t,e)))} - </div>`;Gr.freshModal(hl.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=Gr.addCommand(hl.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","šŸ’¾"))}});const bl="https://respec.org/specref/",yl=On({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"ä»•ę§˜ę¤œē“¢"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"ꐜē“¢ Specref"}}),wl=Gr.addCommand(yl.search_specref,(function(){const e=bn` - <iframe class="respec-iframe" src="${bl}" onload=${e=>e.target.classList.add("ready")}></iframe> - <a href="${bl}" target="_blank">Open Search UI in a new tab</a> - `;Gr.freshModal(yl.search_specref,e,wl)}),"Ctrl+Shift+Alt+space","šŸ”Ž");var vl=Object.freeze({__proto__:null});const $l="https://respec.org/xref/",kl=On({en:{title:"Search definitions"},ja:{title:"定ē¾©ę¤œē“¢"},de:{title:"Definitionen durchsuchen"},zh:{title:"ꐜē“¢å®šä¹‰"}}),xl=Gr.addCommand(kl.title,(function(){const e=bn` - <iframe class="respec-iframe" src="${$l}" onload="${e=>e.target.classList.add("ready")}"></iframe> - <a href="${$l}" target="_blank">Open Search UI in a new tab</a> - `;Gr.freshModal(kl.title,e,xl)}),"Ctrl+Shift+Alt+x","šŸ“š");var _l=Object.freeze({__proto__:null});const Sl=On({en:{about_respec:"About"},zh:{about_respec:"关äŗŽ"},nl:{about_respec:"Over"},ja:{about_respec:"ć“ć‚Œć«ć¤ć„ć¦"},de:{about_respec:"Ɯber"}});window.respecVersion=window.respecVersion||"Developer Edition";const Cl=document.createElement("div"),Rl=bn.bind(Cl),El=Gr.addCommand(`${Sl.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(Al).forEach((t=>{e.push(t)}));Rl` + </div>`;Yr.freshModal(gl.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=Yr.addCommand(gl.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","šŸ’¾"))}});const wl="https://respec.org/specref/",vl=Nn({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"ä»•ę§˜ę¤œē“¢"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"ꐜē“¢ Specref"}}),$l=Yr.addCommand(vl.search_specref,(function(){const e=mn` + <iframe class="respec-iframe" src="${wl}" onload=${e=>e.target.classList.add("ready")}></iframe> + <a href="${wl}" target="_blank">Open Search UI in a new tab</a> + `;Yr.freshModal(vl.search_specref,e,$l)}),"Ctrl+Shift+Alt+space","šŸ”Ž");var kl=Object.freeze({__proto__:null});const xl="https://respec.org/xref/",_l=Nn({en:{title:"Search definitions"},ja:{title:"定ē¾©ę¤œē“¢"},de:{title:"Definitionen durchsuchen"},zh:{title:"ꐜē“¢å®šä¹‰"}}),Sl=Yr.addCommand(_l.title,(function(){const e=mn` + <iframe class="respec-iframe" src="${xl}" onload="${e=>e.target.classList.add("ready")}"></iframe> + <a href="${xl}" target="_blank">Open Search UI in a new tab</a> + `;Yr.freshModal(_l.title,e,Sl)}),"Ctrl+Shift+Alt+x","šŸ“š");var Cl=Object.freeze({__proto__:null});const Rl=Nn({en:{about_respec:"About"},zh:{about_respec:"关äŗŽ"},nl:{about_respec:"Over"},ja:{about_respec:"ć“ć‚Œć«ć¤ć„ć¦"},de:{about_respec:"Ɯber"}});window.respecVersion=window.respecVersion||"Developer Edition";const El=document.createElement("div"),Al=mn.bind(El),Tl=Yr.addCommand(`${Rl.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(Ll).forEach((t=>{e.push(t)}));Al` <p> ReSpec is a document production toolchain, with a notable focus on W3C specifications. </p> @@ -1088,15 +1088,15 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0} </thead> <tbody>${e}</tbody> </table> -`,Gr.freshModal(`${Sl.about_respec} - ${window.respecVersion}`,Cl,El)}),"Ctrl+Shift+Alt+A","ā„¹ļø");function Al({name:e,duration:t}){return bn` +`,Yr.freshModal(`${Rl.about_respec} - ${window.respecVersion}`,El,Tl)}),"Ctrl+Shift+Alt+A","ā„¹ļø");function Ll({name:e,duration:t}){return mn` <tr> <td><a href="${`https://github.com/speced/respec/blob/develop/src/${e}.js`}">${e}</a></td> <td>${t}</td> </tr> - `}var Tl=Object.freeze({__proto__:null});var Ll=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=bn`<meta + `}var Pl=Object.freeze({__proto__:null});var Il=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=mn`<meta name="revision" content="${e.gitRevision}" - />`;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 Pl="w3c/seo",Il={NOTE:"w3p:NOTE",WD:"w3p:WD",LC:"w3p:LastCall",CR:"w3p:CR",CRD:"w3p:CRD",PR:"w3p:PR",REC:"w3p:REC",RSCND:"w3p:RSCND"},Dl=new Set([...As,...Ts,...Ls,"BG-FINAL","CG-FINAL","CRY","DRY","draft-finding","finding"]);function Nl({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 jl(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 Ol=Object.freeze({__proto__:null,name:Pl,requiresCanonicalLink:Dl,run:async function(e){if((e.canonicalURI||Dl.has(e.specStatus))&&e.shortName){switch(e.canonicalURI){case"edDraft":if(e.edDraftURI)e.canonicalURI=new URL(e.edDraftURI,document.location.href).href;else{ir("Canonical URI set to edDraft, but no edDraftURI is set in configuration",Pl),e.canonicalURI=null}break;case"TR":if(e.latestVersion)e.canonicalURI=e.latestVersion;else{ir("Canonical URI set to TR, but no shortName is set in configuration",Pl),e.canonicalURI=null}break;default:e.latestVersion&&!e.canonicalURI&&(e.canonicalURI=e.latestVersion)}if(e.canonicalURI){const t=bn`<link rel="canonical" href="${e.canonicalURI}" />`;document.head.appendChild(t)}e.doJsonLd&&await async function(e,t){const n=Il[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(Nl));e.authors&&(s.contributor=e.authors.map(Nl));const i=[...e.normativeReferences,...e.informativeReferences],a=await Promise.all(i.map((e=>ii(e))));s.citation=a.filter((e=>"object"==typeof e)).map(jl);const c=t.createElement("script");c.type="application/ld+json",c.textContent=JSON.stringify(s,null,2),t.head.appendChild(c)}(e,document)}}});var Ml=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 Dl="w3c/seo",Nl={NOTE:"w3p:NOTE",WD:"w3p:WD",LC:"w3p:LastCall",CR:"w3p:CR",CRD:"w3p:CRD",PR:"w3p:PR",REC:"w3p:REC",RSCND:"w3p:RSCND"},jl=new Set([...Ls,...Ps,...Is,"BG-FINAL","CG-FINAL","CRY","DRY","draft-finding","finding"]);function Ol({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 Ml(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 ql=Object.freeze({__proto__:null,name:Dl,requiresCanonicalLink:jl,run:async function(e){if((e.canonicalURI||jl.has(e.specStatus))&&e.shortName){switch(e.canonicalURI){case"edDraft":if(e.edDraftURI)e.canonicalURI=new URL(e.edDraftURI,document.location.href).href;else{sr("Canonical URI set to edDraft, but no edDraftURI is set in configuration",Dl),e.canonicalURI=null}break;case"TR":if(e.latestVersion)e.canonicalURI=e.latestVersion;else{sr("Canonical URI set to TR, but no shortName is set in configuration",Dl),e.canonicalURI=null}break;default:e.latestVersion&&!e.canonicalURI&&(e.canonicalURI=e.latestVersion)}if(e.canonicalURI){const t=mn`<link rel="canonical" href="${e.canonicalURI}" />`;document.head.appendChild(t)}e.doJsonLd&&await async function(e,t){const n=Nl[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(Ol));e.authors&&(s.contributor=e.authors.map(Ol));const i=[...e.normativeReferences,...e.informativeReferences],a=await Promise.all(i.map((e=>ci(e))));s.citation=a.filter((e=>"object"==typeof e)).map(Ml);const c=t.createElement("script");c.type="application/ld+json",c.textContent=JSON.stringify(s,null,2),t.head.appendChild(c)}(e,document)}}});var zl=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} } @@ -1111,21 +1111,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 ql(t){const n=await fetch(new URL(`../../${t}`,e&&e.src||new URL("respec-w3c.js",document.baseURI).href));return await n.text()}const zl=En({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(zl);const Ul=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return Rd}))).default}catch{return ql("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();n("core/worker",Ul.then((e=>({worker:e}))));const Wl=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function Fl(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:Wl(),languages:t},r=await Ul;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=`<code class="hljs${s?` ${s}`:""}">${o}</code>`,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 Bl=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(Fl);document.head.appendChild(bn`<style> - ${Ml} - </style>`),await Promise.all(n)}});const Hl=On({en:{missing_test_suite_uri:pr`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:pr`ć“ć®ä»•ę§˜å†…ć«ćƒ†ć‚¹ćƒˆć®é …ē›®ć‚’ę¤œå‡ŗć—ć¾ć—ćŸćŒļ¼ŒReSpec 恮čØ­å®šć« ${"[testSuiteURI]"} ćŒč¦‹ć¤ć‹ć‚Šć¾ć›ć‚“ļ¼Ž`,tests:"ćƒ†ć‚¹ćƒˆ",test:"ćƒ†ć‚¹ćƒˆ"},de:{missing_test_suite_uri:pr`Die Spezifikation enthƤlt Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:pr`ęœ¬č§„čŒƒäø­åŒ…å«ęµ‹čƕļ¼Œä½†åœØ ReSpec 配ē½®äø­ē¼ŗ少 ${"[testSuiteURI]"}怂`,tests:"굋čƕ",test:"굋čƕ"}}),Gl="core/data-tests";function Vl(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 bn` +.hljs-link{text-decoration:underline}`;async function Ul(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 Wl=Cn({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(Wl);const Fl=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return Ad}))).default}catch{return Ul("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();n("core/worker",Fl.then((e=>({worker:e}))));const Bl=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function Hl(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:Bl(),languages:t},r=await Fl;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=`<code class="hljs${s?` ${s}`:""}">${o}</code>`,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 Gl=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(Hl);document.head.appendChild(mn`<style> + ${zl} + </style>`),await Promise.all(n)}});const Vl=Nn({en:{missing_test_suite_uri:ur`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:ur`ć“ć®ä»•ę§˜å†…ć«ćƒ†ć‚¹ćƒˆć®é …ē›®ć‚’ę¤œå‡ŗć—ć¾ć—ćŸćŒļ¼ŒReSpec 恮čØ­å®šć« ${"[testSuiteURI]"} ćŒč¦‹ć¤ć‹ć‚Šć¾ć›ć‚“ļ¼Ž`,tests:"ćƒ†ć‚¹ćƒˆ",test:"ćƒ†ć‚¹ćƒˆ"},de:{missing_test_suite_uri:ur`Die Spezifikation enthƤlt Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:ur`ęœ¬č§„čŒƒäø­åŒ…å«ęµ‹čƕļ¼Œä½†åœØ ReSpec 配ē½®äø­ē¼ŗ少 ${"[testSuiteURI]"}怂`,tests:"굋čƕ",test:"굋čƕ"}}),Yl="core/data-tests";function Kl(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 mn` <li> <a href="${e}">${s}</a> ${t} </li> - `}function Yl(e,t,n){return e.map((e=>{try{return new URL(e,t).href}catch{ir(pr`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,Gl,{elements:[n]})}})).filter((e=>e))}function Kl(e,t){const n=e.filter(((e,t,n)=>n.indexOf(e)!==t));if(n.length){const e=pr`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=pr`To fix, remove duplicates from ${"[data-tests]"}: ${ur(n,{quotes:!0})}.`;ir(e,Gl,{hint:r,elements:[t]})}}function Zl(e){const t=[...new Set(e)];return bn` + `}function Zl(e,t,n){return e.map((e=>{try{return new URL(e,t).href}catch{sr(ur`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,Yl,{elements:[n]})}})).filter((e=>e))}function Jl(e,t){const n=e.filter(((e,t,n)=>n.indexOf(e)!==t));if(n.length){const e=ur`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=ur`To fix, remove duplicates from ${"[data-tests]"}: ${cr(n,{quotes:!0})}.`;sr(e,Yl,{hint:r,elements:[t]})}}function Ql(e){const t=[...new Set(e)];return mn` <details class="respec-tests-details removeOnSave"> <summary>tests: ${t.length}</summary> <ul> - ${t.map(Vl)} + ${t.map(Kl)} </ul> </details> - `}var Jl=Object.freeze({__proto__:null,name:Gl,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=Yl(n.dataset.tests.split(/,/gm).map((e=>e.trim())),e.testSuiteURI,n);Kl(t,n);const r=Zl(t);n.append(r)}else or(Hl.missing_test_suite_uri,Gl)}});const Ql="core/list-sorter";function Xl(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function eu(e,t){return[...e.querySelectorAll(":scope > li")].sort(Xl(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function tu(e,t){return[...e.querySelectorAll(":scope > dt")].sort(Xl(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 nu=Object.freeze({__proto__:null,name:Ql,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=tu(t,n);break;case"ol":case"ul":e=eu(t,n);break;default:ir(`ReSpec can't sort ${t.localName} elements.`,Ql,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:tu,sortListItems:eu});var ru=String.raw`var:hover{text-decoration:underline;cursor:pointer} + `}var Xl=Object.freeze({__proto__:null,name:Yl,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=Zl(n.dataset.tests.split(/,/gm).map((e=>e.trim())),e.testSuiteURI,n);Jl(t,n);const r=Ql(t);n.append(r)}else rr(Vl.missing_test_suite_uri,Yl)}});const eu="core/list-sorter";function tu(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function nu(e,t){return[...e.querySelectorAll(":scope > li")].sort(tu(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function ru(e,t){return[...e.querySelectorAll(":scope > dt")].sort(tu(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 su=Object.freeze({__proto__:null,name:eu,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=ru(t,n);break;case"ol":case"ul":e=nu(t,n);break;default:sr(`ReSpec can't sort ${t.localName} elements.`,eu,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:ru,sortListItems:nu});var ou=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)} @@ -1139,15 +1139,15 @@ 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} -}`;function su(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=jn(e.textContent),n=e.closest(".algorithm, section"),r=iu(e),s=[...n.querySelectorAll("var")].filter((e=>jn(e.textContent)===t&&e.closest(".algorithm, section")===n)),o=s[0].classList.contains("respec-hl");if(ou.set(r,o),o)return s.forEach((e=>au(e,r))),[];s.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return s}(t),r=()=>{const e=iu(t);n.forEach((t=>au(t,e))),[...ou.keys()].forEach((e=>ou.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const ou=new Map([["respec-hl-c1",!0],["respec-hl-c2",!0],["respec-hl-c3",!0],["respec-hl-c4",!0],["respec-hl-c5",!0],["respec-hl-c6",!0],["respec-hl-c7",!0]]);function iu(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===ou.get("respec-hl-c1")?"respec-hl-c1":[...ou.keys()].find((e=>ou.get(e)))||"respec-hl-c1"}function au(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var cu=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=ru,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",su))),o("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(au)}))}});var lu=String.raw`var{position:relative;cursor:pointer} +}`;function iu(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=Dn(e.textContent),n=e.closest(".algorithm, section"),r=cu(e),s=[...n.querySelectorAll("var")].filter((e=>Dn(e.textContent)===t&&e.closest(".algorithm, section")===n)),o=s[0].classList.contains("respec-hl");if(au.set(r,o),o)return s.forEach((e=>lu(e,r))),[];s.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return s}(t),r=()=>{const e=cu(t);n.forEach((t=>lu(t,e))),[...au.keys()].forEach((e=>au.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const au=new Map([["respec-hl-c1",!0],["respec-hl-c2",!0],["respec-hl-c3",!0],["respec-hl-c4",!0],["respec-hl-c5",!0],["respec-hl-c6",!0],["respec-hl-c7",!0]]);function cu(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===au.get("respec-hl-c1")?"respec-hl-c1":[...au.keys()].find((e=>au.get(e)))||"respec-hl-c1"}function lu(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var uu=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=ou,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",iu))),hr("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(lu)}))}});var du=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 uu=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=lu,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 du=String.raw`:root{--assertion-border:#aaa;--assertion-bg:#eee;--assertion-text:black} +var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var pu=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=du,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 fu=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 pu=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(bn`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=du,document.head.appendChild(t)}});const fu="core/anchor-expander";function hu(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void or(`Found matching element "${t}", but it has no title or marker.`,fu,{title:"Missing title.",elements:[n]})}const s=er(r);n.append(...s.childNodes),n.classList.add("box-ref")}function mu(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void or(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,fu,{title:"Missing figcaption in referenced figure.",elements:[n]})}const s=[...er(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=jn(o.textContent))}function gu(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void or(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,fu,{title:"Missing caption in referenced table.",elements:[n]})}const s=[...er(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=jn(o.textContent))}function bu(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)yu(r,n),wu(r,n);else{n.textContent=n.getAttribute("href");or("Found matching section, but the section was lacking a heading element.",fu,{title:`No matching id in document: "${t}".`,elements:[n]})}}function yu(e,t){const n=e.querySelector(".self-link"),r=[...er(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=Vn(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function wu(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 vu=Object.freeze({__proto__:null,name:fu,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":yu(n,t);break;case"section":bu(n,e,t);break;case"figure":mu(n,e,t);break;case"table":gu(n,e,t);break;case"aside":case"div":hu(n,e,t);break;default:t.textContent=t.getAttribute("href");or("ReSpec doesn't support expanding this kind of reference.",fu,{title:`Can't expand "#${e}".`,elements:[t]})}wu(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");or(`Couldn't expand inline reference. The id "${e}" is not in the document.`,fu,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var $u=String.raw`dfn{cursor:pointer} +}`;var hu=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(mn`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,": "))}const t=document.createElement("style");t.textContent=fu,document.head.appendChild(t)}});const mu="core/anchor-expander";function gu(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void rr(`Found matching element "${t}", but it has no title or marker.`,mu,{title:"Missing title.",elements:[n]})}const s=Qn(r);n.append(...s.childNodes),n.classList.add("box-ref")}function bu(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void rr(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,mu,{title:"Missing figcaption in referenced figure.",elements:[n]})}const s=[...Qn(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=Dn(o.textContent))}function yu(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void rr(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,mu,{title:"Missing caption in referenced table.",elements:[n]})}const s=[...Qn(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=Dn(o.textContent))}function wu(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)vu(r,n),$u(r,n);else{n.textContent=n.getAttribute("href");rr("Found matching section, but the section was lacking a heading element.",mu,{title:`No matching id in document: "${t}".`,elements:[n]})}}function vu(e,t){const n=e.querySelector(".self-link"),r=[...Qn(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=Hn(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function $u(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 ku=Object.freeze({__proto__:null,name:mu,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":vu(n,t);break;case"section":wu(n,e,t);break;case"figure":bu(n,e,t);break;case"table":yu(n,e,t);break;case"aside":case"div":gu(n,e,t);break;default:t.textContent=t.getAttribute("href");rr("ReSpec doesn't support expanding this kind of reference.",mu,{title:`Can't expand "#${e}".`,elements:[t]})}$u(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");rr(`Couldn't expand inline reference. The id "${e}" is not in the document.`,mu,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});var xu=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} @@ -1164,7 +1164,7 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var uu=Obje .dfn-panel a[href]:hover{border-bottom-width:1px} .dfn-panel ul{padding:0} .dfn-panel li{margin-left:1em} -.dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto}`;function ku(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),s=`dfn-panel-for-${e.id}`,o=e.getAttribute("aria-label")||jn(e.textContent),i=bn` +.dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto}`;function _u(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),s=`dfn-panel-for-${e.id}`,o=e.getAttribute("aria-label")||Dn(e.textContent),i=mn` <div class="dfn-panel" id="${s}" @@ -1181,11 +1181,11 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var uu=Obje aria-label="Permalink for definition: ${o}. Activate to close this dialog." >Permalink</a > - ${function(e){return e.matches("dfn[data-export]")?bn`<span + ${function(e){return e.matches("dfn[data-export]")?mn`<span class="marker dfn-exported" title="Definition can be referenced by other specifications" >exported</span - >`:null}(e)} ${function(e,t){if(!e.hasAttribute("data-idl"))return null;for(const n of t){if(n.dataset.linkType!==e.dataset.dfnType)continue;const t=n.closest("pre.idl");if(t&&t.id){const e=`#${t.id}`;return bn`<a + >`:null}(e)} ${function(e,t){if(!e.hasAttribute("data-idl"))return null;for(const n of t){if(n.dataset.linkType!==e.dataset.dfnType)continue;const t=n.closest("pre.idl");if(t&&t.id){const e=`#${t.id}`;return mn`<a href="${e}" class="marker idl-block" title="Jump to IDL declaration" @@ -1193,42 +1193,42 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var uu=Obje >`}}return null}(e,r)} </div> <p><b>Referenced in:</b></p> - ${function(e,t){if(!t.length)return bn`<ul> + ${function(e,t){if(!t.length)return mn`<ul> <li>Not referenced in this document.</li> - </ul>`;const n=new Map;t.forEach(((t,r)=>{const s=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=s);const o=function(e){const t=e.closest("section");if(!t)return null;const n=t.querySelector("h1, h2, h3, h4, h5, h6");return n?`Ā§ ${jn(n.textContent)}`:null}(t);(n.get(o)||n.set(o,[]).get(o)).push(s)}));const r=([e,t])=>[{title:e,id:t[0],text:e}].concat(t.slice(1).map(((e,t)=>({title:`Reference ${t+2}`,text:`(${t+2})`,id:e})))),s=e=>bn`<li> - ${r(e).map((e=>bn`<a href="#${e.id}" title="${e.title}">${e.text}</a + </ul>`;const n=new Map;t.forEach(((t,r)=>{const s=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=s);const o=function(e){const t=e.closest("section");if(!t)return null;const n=t.querySelector("h1, h2, h3, h4, h5, h6");return n?`Ā§ ${Dn(n.textContent)}`:null}(t);(n.get(o)||n.set(o,[]).get(o)).push(s)}));const r=([e,t])=>[{title:e,id:t[0],text:e}].concat(t.slice(1).map(((e,t)=>({title:`Reference ${t+2}`,text:`(${t+2})`,id:e})))),s=e=>mn`<li> + ${r(e).map((e=>mn`<a href="#${e.id}" title="${e.title}">${e.text}</a >${" "}`))} - </li>`;return bn`<ul> + </li>`;return mn`<ul> ${[...n].map(s)} </ul>`}(t,r)} </div> - `;return i}var xu=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(bn`<style> - ${$u} - </style>`,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(ku(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");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 Ed}))).default}catch{return ql("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const _u="rs-changelog",Su=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;bn.bind(this)` + `;return i}var Su=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(mn`<style> + ${xu} + </style>`,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(_u(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");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 Td}))).default}catch{return Ul("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const Cu="rs-changelog",Ru=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;mn.bind(this)` <ul> - ${{any:Cu(e,t,n).then((e=>async function(e){const{repoURL:t}=await io;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),s=`${t}commit/${e.hash}`,o=r&&bn` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return bn`<li><a href="${s}">${n.trim()}</a>${o}</li>`}))}(e))).catch((e=>or(e.message,_u,{elements:[this]}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}} + ${{any:Eu(e,t,n).then((e=>async function(e){const{repoURL:t}=await co;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),s=`${t}commit/${e.hash}`,o=r&&mn` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return mn`<li><a href="${s}">${n.trim()}</a>${o}</li>`}))}(e))).catch((e=>rr(e.message,Cu,{elements:[this],cause:e}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}} </ul> - `}};async function Cu(e,t,n){let r;try{const s=await io;if(!s)throw new Error("`respecConfig.github` is not set");const o=new URL("commits",`${s.apiBase}/${s.fullName}/`);o.searchParams.set("from",e),o.searchParams.set("to",t);const i=await fetch(o.href);if(!i.ok)throw new Error(`Request to ${o} failed with status code ${i.status}`);if(r=await i.json(),!r.length)throw new Error(`No commits between ${e}..${t}.`);r=r.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw console.error(e),new Error(t)}return r}const Ru=[Object.freeze({__proto__:null,element:Su,name:_u})];var Eu=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Ru.forEach((e=>{customElements.define(e.name,e.element)}));const e=Ru.map((e=>e.name)).join(", "),t=[...document.querySelectorAll(e)].map((e=>new Promise((t=>e.addEventListener("done",t,{once:!0})))));await Promise.all(t)}});var Au=Object.freeze({__proto__:null,name:"core/web-monetization",run:function(e){if(!1===e.monetization)return;const{monetization:t}=e,{removeOnSave:n,paymentPointer:r}=function(e){const t={paymentPointer:"$respec.org",removeOnSave:!0};switch(typeof e){case"string":t.paymentPointer=e;break;case"object":e.paymentPointer&&(t.paymentPointer=String(e.paymentPointer)),!1===e.removeOnSave&&(t.removeOnSave=!1)}return t}(t),s=n?"removeOnSave":null;document.head.append(bn`<meta + `}};async function Eu(e,t,n){let r;try{const s=await co;if(!s)throw new Error("`respecConfig.github` is not set");const o=new URL("commits",`${s.apiBase}/${s.fullName}/`);o.searchParams.set("from",e),o.searchParams.set("to",t);const i=await fetch(o.href);if(!i.ok)throw new Error(`Request to ${o} failed with status code ${i.status}`);if(r=await i.json(),!r.length)throw new Error(`No commits between ${e}..${t}.`);r=r.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw new Error(t,{cause:e})}return r}const Au=[Object.freeze({__proto__:null,element:Ru,name:Cu})];var Tu=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Au.forEach((e=>{customElements.define(e.name,e.element)}));const e=Au.map((e=>e.name)).join(", "),t=[...document.querySelectorAll(e)].map((e=>new Promise((t=>e.addEventListener("done",t,{once:!0})))));await Promise.all(t)}});var Lu=Object.freeze({__proto__:null,name:"core/web-monetization",run:function(e){if(!1===e.monetization)return;const{monetization:t}=e,{removeOnSave:n,paymentPointer:r}=function(e){const t={paymentPointer:"$respec.org",removeOnSave:!0};switch(typeof e){case"string":t.paymentPointer=e;break;case"object":e.paymentPointer&&(t.paymentPointer=String(e.paymentPointer)),!1===e.removeOnSave&&(t.removeOnSave=!1)}return t}(t),s=n?"removeOnSave":null;document.head.append(mn`<meta name="monetization" content="${r}" class="${s}" - />`)}});var Tu=Object.freeze({__proto__:null,name:"core/dfn-contract",run:function(){!function(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}(),function(){const e=document.querySelectorAll("dl.definitions dt:has(dfn[data-dfn-type])");for(const t of e){const e=t.querySelector("dfn[data-dfn-type]").id,n=t.nextElementSibling;n&&!n.dataset.defines&&e&&(n.dataset.defines=`#${e}`)}const t=document.querySelectorAll(".definition:has(dfn[data-dfn-type])");for(const e of t){const t=e.querySelector("dfn[data-dfn-type]");t.id&&!e.dataset.defines&&(e.dataset.defines=`#${t.id}`)}}()}});const Lu="core/before-save";var Pu=Object.freeze({__proto__:null,name:Lu,run:function(e){if(e.beforeSave)if(Array.isArray(e.beforeSave)&&!e.beforeSave.some((e=>"function"!=typeof e||"AsyncFunction"===e.constructor.name)))o("beforesave",(t=>{!function(e,t){let n=0;for(const r of e)try{r(t)}catch(e){or(pr`Function ${`\`${r.name}\``||`at position ${n}`}\` threw an error during processing of ${"[beforeSave]"}.`,Lu,{hint:"See developer console."}),console.error(e)}finally{n++}}(e.beforeSave,t.ownerDocument)}),{once:!0});else{or(pr`${"[beforeSave]"} configuration option must be an array of synchronous JS functions.`,Lu)}}});const Iu="core/linter-rules/check-charset",Du=On({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ `<meta>` ꠇē­¾",hint:'å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ `<head>` éƒØ分ā€”ā€” `<meta charset="utf-8">` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚'}});var Nu=Object.freeze({__proto__:null,name:Iu,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||ir(Du.msg,Iu,{hint:Du.hint,elements:[...t]})}});const ju="core/linter-rules/check-punctuation",Ou=[".",":","!","?"],Mu=On({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Ou.map((e=>`"${e}"`)).join(", ")}.`}});var qu=Object.freeze({__proto__:null,name:ju,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Ou.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&ir(Mu.msg,ju,{hint:Mu.hint,elements:n})}});const zu="core/linter-rules/check-internal-slots",Uu=On({en:{msg:"Internal slots should be preceded by a '.'",hint:"Add a '.' between the elements mentioned."}});var Wu=Object.freeze({__proto__:null,name:zu,run:function(e){if(!e.lint?.["check-internal-slots"])return;const t=[...document.querySelectorAll("var+a")].filter((({previousSibling:{nodeName:e}})=>e&&"VAR"===e));t.length&&ir(Uu.msg,zu,{hint:Uu.hint,elements:t})}});const Fu="core/linter-rules/local-refs-exist",Bu=On({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function Hu(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Gu=Object.freeze({__proto__:null,name:Fu,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Hu);t.length&&ir(Bu.msg,Fu,{hint:Bu.hint,elements:t})}});const Vu="core/linter-rules/no-captionless-tables",Yu=On({en:{msg:"All tables marked with class='numbered' must start with a caption element.",hint:"Add a `caption` to the offending table."}});var Ku=Object.freeze({__proto__:null,name:Vu,run:function(e){if(!e.lint?.["no-captionless-tables"])return;const t=[...document.querySelectorAll("table.numbered")].filter((e=>!(e.firstElementChild instanceof HTMLTableCaptionElement)));t.length&&ir(Yu.msg,Vu,{hint:Yu.hint,elements:t})}});const Zu="no-unused-dfns",Ju="core/linter-rules/no-unused-dfns",Qu=On({en:{msg:e=>`Found definition for "${e}", but nothing links to it. This is usually a spec bug!`,get hint(){return pr` + />`)}});var Pu=Object.freeze({__proto__:null,name:"core/dfn-contract",run:function(){!function(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}(),function(){const e=document.querySelectorAll("dl.definitions dt:has(dfn[data-dfn-type])");for(const t of e){const e=t.querySelector("dfn[data-dfn-type]").id,n=t.nextElementSibling;n&&!n.dataset.defines&&e&&(n.dataset.defines=`#${e}`)}const t=document.querySelectorAll(".definition:has(dfn[data-dfn-type])");for(const e of t){const t=e.querySelector("dfn[data-dfn-type]");t.id&&!e.dataset.defines&&(e.dataset.defines=`#${t.id}`)}}()}});const Iu="core/before-save";var Du=Object.freeze({__proto__:null,name:Iu,run:function(e){if(e.beforeSave)if(Array.isArray(e.beforeSave)&&!e.beforeSave.some((e=>"function"!=typeof e||"AsyncFunction"===e.constructor.name)))hr("beforesave",(t=>{!function(e,t){let n=0;for(const r of e)try{r(t)}catch(e){rr(ur`Function ${`\`${r.name}\``||`at position ${n}`}\` threw an error during processing of ${"[beforeSave]"}.`,Iu,{hint:"See developer console.",cause:e})}finally{n++}}(e.beforeSave,t.ownerDocument)}),{once:!0});else{rr(ur`${"[beforeSave]"} configuration option must be an array of synchronous JS functions.`,Iu)}}});const Nu="core/linter-rules/check-charset",ju=Nn({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ `<meta>` ꠇē­¾",hint:'å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ `<head>` éƒØ分ā€”ā€” `<meta charset="utf-8">` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚'}});var Ou=Object.freeze({__proto__:null,name:Nu,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push(e.getAttribute("charset").trim().toLowerCase());n.includes("utf-8")&&1===t.length||sr(ju.msg,Nu,{hint:ju.hint,elements:[...t]})}});const Mu="core/linter-rules/check-punctuation",qu=[".",":","!","?"],zu=Nn({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${qu.map((e=>`"${e}"`)).join(", ")}.`}});var Uu=Object.freeze({__proto__:null,name:Mu,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${qu.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&sr(zu.msg,Mu,{hint:zu.hint,elements:n})}});const Wu="core/linter-rules/check-internal-slots",Fu=Nn({en:{msg:"Internal slots should be preceded by a '.'",hint:"Add a '.' between the elements mentioned."}});var Bu=Object.freeze({__proto__:null,name:Wu,run:function(e){if(!e.lint?.["check-internal-slots"])return;const t=[...document.querySelectorAll("var+a")].filter((({previousSibling:{nodeName:e}})=>e&&"VAR"===e));t.length&&sr(Fu.msg,Wu,{hint:Fu.hint,elements:t})}});const Hu="core/linter-rules/local-refs-exist",Gu=Nn({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function Vu(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Yu=Object.freeze({__proto__:null,name:Hu,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Vu);t.length&&sr(Gu.msg,Hu,{hint:Gu.hint,elements:t})}});const Ku="core/linter-rules/no-captionless-tables",Zu=Nn({en:{msg:"All tables marked with class='numbered' must start with a caption element.",hint:"Add a `caption` to the offending table."}});var Ju=Object.freeze({__proto__:null,name:Ku,run:function(e){if(!e.lint?.["no-captionless-tables"])return;const t=[...document.querySelectorAll("table.numbered")].filter((e=>!(e.firstElementChild instanceof HTMLTableCaptionElement)));t.length&&sr(Zu.msg,Ku,{hint:Zu.hint,elements:t})}});const Qu="no-unused-dfns",Xu="core/linter-rules/no-unused-dfns",ed=Nn({en:{msg:e=>`Found definition for "${e}", but nothing links to it. This is usually a spec bug!`,get hint(){return ur` You can do one of the following... * Add a \`class="lint-ignore"\` attribute the definition. * Either remove the definition or change \`<dfn>\` to another type of HTML element. * If you meant to ${"[export|#data-export]"} the definition, add \`class="export"\` to the definition. - To silence this warning entirely, set \`lint: { "no-unused-dfns": false }\` in your \`respecConfig\`.`}}});function Xu(e){return!document.querySelector(`a[href="#${e.id}"]:not(.index-term, .self-link)`)}var ed=Object.freeze({__proto__:null,name:Ju,run:function(e){if(!e.lint?.[Zu])return;const t="error"===e.lint[Zu]?or:ir;[...document.querySelectorAll("dfn:not(.lint-ignore, [data-export], [data-cite])")].filter(Xu).forEach((e=>{const n=[e],r=jn(e.textContent);t(Qu.msg(r),Ju,{elements:n,hint:Qu.hint})}))}});const td="core/linter-rules/no-headingless-sections",nd=On({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂",hint:"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂"}});var rd=Object.freeze({__proto__:null,name:td,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,#abstract,#sotd)")].filter((({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement)));t.length&&ir(nd.msg,td,{hint:nd.hint,elements:t})}});const sd="core/linter-rules/no-unused-vars",od=On({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var id=Object.freeze({__proto__:null,name:sd,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const s=new Map;for(const e of r){const t=jn(e.textContent);(s.get(t)||s.set(t,[]).get(t)).push(e)}for(const e of s.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&ir(od.msg,sd,{hint:od.hint,elements:t})}});const ad="required-sections",cd="w3c/linter-rules/required-sections",ld={en:{msg:e=>`W3C Recommendation track documents require a separate "${e}" section.`,hint:e=>pr`Add a \`<section>\` with a "${e}" header. See the [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review). + To silence this warning entirely, set \`lint: { "no-unused-dfns": false }\` in your \`respecConfig\`.`}}});function td(e){return!document.querySelector(`a[href="#${e.id}"]:not(.index-term, .self-link)`)}var nd=Object.freeze({__proto__:null,name:Xu,run:function(e){if(!e.lint?.[Qu])return;const t="error"===e.lint[Qu]?rr:sr;[...document.querySelectorAll("dfn:not(.lint-ignore, [data-export], [data-cite])")].filter(td).forEach((e=>{const n=[e],r=Dn(e.textContent);t(ed.msg(r),Xu,{elements:n,hint:ed.hint})}))}});const rd="core/linter-rules/no-headingless-sections",sd=Nn({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂",hint:"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂"}});var od=Object.freeze({__proto__:null,name:rd,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,#abstract,#sotd)")].filter((({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement)));t.length&&sr(sd.msg,rd,{hint:sd.hint,elements:t})}});const id="core/linter-rules/no-unused-vars",ad=Nn({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."}});var cd=Object.freeze({__proto__:null,name:id,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const s=new Map;for(const e of r){const t=Dn(e.textContent);(s.get(t)||s.set(t,[]).get(t)).push(e)}for(const e of s.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&sr(ad.msg,id,{hint:ad.hint,elements:t})}});const ld="required-sections",ud="w3c/linter-rules/required-sections",dd={en:{msg:e=>`W3C Recommendation track documents require a separate "${e}" section.`,hint:e=>ur`Add a \`<section>\` with a "${e}" header. See the [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review). If the document is not intended for the W3C Recommendation track, set ${"[noRecTrack]"} to \`true\` - or turn off the ${`[${ad}]`} linter rule.`,privacy_considerations:"Privacy Considerations",security_considerations:"Security Considerations"},es:{msg:e=>`Documentos que van a ser "W3C Recommendation" requieren una secciĆ³n "${e}" separada.`,hint:e=>pr`Agrega una \`<section>\` con tĆ­tulo "${e}". Ver los [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review). + or turn off the ${`[${ld}]`} linter rule.`,privacy_considerations:"Privacy Considerations",security_considerations:"Security Considerations"},es:{msg:e=>`Documentos que van a ser "W3C Recommendation" requieren una secciĆ³n "${e}" separada.`,hint:e=>ur`Agrega una \`<section>\` con tĆ­tulo "${e}". Ver los [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review). Si el documento no estĆ” destinado a ser un W3C Recommendation, puedes poner ${"[noRecTrack]"} a \`true\` - o apaga la regla de linter ${`[${ad}]`}.`,privacy_considerations:"Consideraciones de privacidad",security_considerations:"Consideraciones de Seguridad"}},ud=On(ld),dd=new Set([...Ts]);dd.delete("DISC"),As.forEach((e=>dd.delete(e)));var pd=Object.freeze({__proto__:null,name:cd,requiresSomeSectionStatus:dd,run:function(e){if(!e.lint?.[ad])return;if(!Mn(ld,"privacy_considerations")){return void ir("Cannot check for required sections as translations are not available.",cd,{hint:"File an issue to add translations or use a supported language."})}if(e.noRecTrack||!dd.has(e.specStatus))return;const t="error"===e.lint[ad]?or:ir,n=new Xn([ud.privacy_considerations,ud.security_considerations]),r=document.querySelectorAll("h2, h3, h4, h5, h6");for(const e of r){const t=e.cloneNode(!0);t.querySelectorAll("bdi")?.forEach((e=>e.remove()));const r=jn(t.textContent);if(n.has(r)&&(n.delete(r),0===n.size))return}for(const e of n)t(ud.msg(e),cd,{hint:ud.hint(e)})}});const fd="core/linter-rules/wpt-tests-exist",hd=On({en:{msg:"The following test could not be found in Web Platform Tests:",hint:"Check [wpt.live](https://wpt.live) to see if it was deleted or renamed."}});var md=Object.freeze({__proto__:null,name:fd,run:async function(e){if(!e.lint?.["wpt-tests-exist"])return;const t=await async function(e,t){let n;try{const t=new URL(e);if(t.pathname.startsWith("/web-platform-tests/wpt/tree/master/")){const e=/web-platform-tests\/wpt\/tree\/master\/(.+)/;n=t.pathname.match(e)[1].replace(/\//g,"")}else n=t.pathname.replace(/\//g,"")}catch(e){return ir("Failed to parse WPT directory from testSuiteURI",`linter/${fd}`),console.error(e),null}const r=new URL("web-platform-tests/wpt/files",`${t}/`);r.searchParams.set("path",n);const s=await fetch(r);if(!s.ok){return ir(`Failed to fetch files from WPT repository. Request failed with error: ${await s.text()} (${s.status})`,`linter/${fd}`),null}const{entries:o}=await s.json(),i=o.filter((e=>!e.endsWith("/")));return new Set(i)}(e.testSuiteURI,e.githubAPI);if(!t)return;const n=[...document.querySelectorAll("[data-tests]")].filter((e=>e.dataset.tests));for(const e of n)e.dataset.tests.split(/,/gm).map((e=>e.trim().split("#")[0])).filter((e=>e&&!t.has(e))).map((t=>{ir(`${hd.msg} \`${t}\`.`,fd,{hint:hd.hint,elements:[e]})}))}});const gd="core/linter-rules/no-http-props",bd=On({en:{msg:pr`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:pr`${"[respecConfig]"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,hint:"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š"}});var yd=Object.freeze({__proto__:null,name:gd,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter((t=>t.endsWith("URI")&&e[t]||"prevED"===t)).filter((t=>new URL(e[t],parent.location.href).href.startsWith("http://")));if(t.length){const e=In(t,(e=>pr`${`[${e}]`}`));ir(bd.msg,gd,{hint:bd.hint+e})}}});const wd="core/linter-rules/a11y",vd=["color-contrast","landmark-one-main","landmark-unique","region"];function $d(e){const t=[];for(const n of e.split("\n\n")){const[e,...r]=n.split(/^\s{2}/m),s=r.map((e=>`- ${e.trimEnd()}`)).join("\n");t.push(`${e}${s}`)}return t.join("\n\n")}var kd=Object.freeze({__proto__:null,name:wd,run:async function(e){if(!e.lint?.a11y&&!e.a11y)return;const t=e.lint?.a11y||e.a11y,n=!0===t?{}:t,r=await async function(e){const{rules:t,...n}=e,r={rules:{...Object.fromEntries(vd.map((e=>[e,{enabled:!1}]))),...t},...n,elementRef:!0,resultTypes:["violations"],reporter:"v1"};let s;try{s=await function(){const e=document.createElement("script");return e.classList.add("remove"),e.src="https://cdn.jsdelivr.net/npm/axe-core@4/axe.min.js",document.head.appendChild(e),new Promise(((t,n)=>{e.onload=()=>t(window.axe),e.onerror=n}))}()}catch(e){return or("Failed to load a11y linter.",wd),console.error(e),[]}try{return(await s.run(document,r)).violations}catch(e){return or("Error while looking for a11y issues.",wd),console.error(e),[]}}(n);for(const e of r){const t=new Map;for(const n of e.nodes){const{failureSummary:e,element:r}=n;(t.get(e)||t.set(e,[]).get(e)).push(r)}const{id:n,help:r,description:s,helpUrl:o}=e,i=`a11y/${n}: ${r}.`;for(const[e,n]of t){const t=$d(e);ir(i,wd,{details:`\n\n${s}.\n\n${t}. ([Learn more](${o}))`,elements:n})}}}});const xd="informative-dfn",_d="core/linter-rules/informative-dfn",Sd=On({en:{msg:(e,t)=>`Normative reference to "${e}" found but term is defined "informatively" in "${t}".`,get hint(){return pr` + o apaga la regla de linter ${`[${ld}]`}.`,privacy_considerations:"Consideraciones de privacidad",security_considerations:"Consideraciones de Seguridad"}},pd=Nn(dd),fd=new Set([...Ps]);fd.delete("DISC"),Ls.forEach((e=>fd.delete(e)));var hd=Object.freeze({__proto__:null,name:ud,requiresSomeSectionStatus:fd,run:function(e){if(!e.lint?.[ld])return;if(!jn(dd,"privacy_considerations")){return void sr("Cannot check for required sections as translations are not available.",ud,{hint:"File an issue to add translations or use a supported language."})}if(e.noRecTrack||!fd.has(e.specStatus))return;const t="error"===e.lint[ld]?rr:sr,n=new Jn([pd.privacy_considerations,pd.security_considerations]),r=document.querySelectorAll("h2, h3, h4, h5, h6");for(const e of r){const t=e.cloneNode(!0);t.querySelectorAll("bdi")?.forEach((e=>e.remove()));const r=Dn(t.textContent);if(n.has(r)&&(n.delete(r),0===n.size))return}for(const e of n)t(pd.msg(e),ud,{hint:pd.hint(e)})}});const md="core/linter-rules/wpt-tests-exist",gd=Nn({en:{msg:"The following test could not be found in Web Platform Tests:",hint:"Check [wpt.live](https://wpt.live) to see if it was deleted or renamed."}});var bd=Object.freeze({__proto__:null,name:md,run:async function(e){if(!e.lint?.["wpt-tests-exist"])return;const t=await async function(e,t){let n;try{const t=new URL(e);if(t.pathname.startsWith("/web-platform-tests/wpt/tree/master/")){const e=/web-platform-tests\/wpt\/tree\/master\/(.+)/;n=t.pathname.match(e)[1].replace(/\//g,"")}else n=t.pathname.replace(/\//g,"")}catch(e){return sr("Failed to parse WPT directory from testSuiteURI",`linter/${md}`),console.error(e),null}const r=new URL("web-platform-tests/wpt/files",`${t}/`);r.searchParams.set("path",n);const s=await fetch(r);if(!s.ok){return sr(`Failed to fetch files from WPT repository. Request failed with error: ${await s.text()} (${s.status})`,`linter/${md}`),null}const{entries:o}=await s.json(),i=o.filter((e=>!e.endsWith("/")));return new Set(i)}(e.testSuiteURI,e.githubAPI);if(!t)return;const n=[...document.querySelectorAll("[data-tests]")].filter((e=>e.dataset.tests));for(const e of n)e.dataset.tests.split(/,/gm).map((e=>e.trim().split("#")[0])).filter((e=>e&&!t.has(e))).map((t=>{sr(`${gd.msg} \`${t}\`.`,md,{hint:gd.hint,elements:[e]})}))}});const yd="core/linter-rules/no-http-props",wd=Nn({en:{msg:ur`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:ur`${"[respecConfig]"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,hint:"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š"}});var vd=Object.freeze({__proto__:null,name:yd,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter((t=>t.endsWith("URI")&&e[t]||"prevED"===t)).filter((t=>new URL(e[t],parent.location.href).href.startsWith("http://")));if(t.length){const e=Ln(t,(e=>ur`${`[${e}]`}`));sr(wd.msg,yd,{hint:wd.hint+e})}}});const $d="core/linter-rules/a11y",kd=["color-contrast","landmark-one-main","landmark-unique","region"];function xd(e){const t=[];for(const n of e.split("\n\n")){const[e,...r]=n.split(/^\s{2}/m),s=r.map((e=>`- ${e.trimEnd()}`)).join("\n");t.push(`${e}${s}`)}return t.join("\n\n")}var _d=Object.freeze({__proto__:null,name:$d,run:async function(e){if(!e.lint?.a11y&&!e.a11y)return;const t=e.lint?.a11y||e.a11y,n=!0===t?{}:t,r=await async function(e){const{rules:t,...n}=e,r={rules:{...Object.fromEntries(kd.map((e=>[e,{enabled:!1}]))),...t},...n,elementRef:!0,resultTypes:["violations"],reporter:"v1"};let s;try{s=await function(){const e=document.createElement("script");return e.classList.add("remove"),e.src="https://cdn.jsdelivr.net/npm/axe-core@4/axe.min.js",document.head.appendChild(e),new Promise(((t,n)=>{e.onload=()=>t(window.axe),e.onerror=n}))}()}catch(e){return rr("Failed to load a11y linter.",$d),console.error(e),[]}try{return(await s.run(document,r)).violations}catch(e){return rr("Error while looking for a11y issues.",$d),console.error(e),[]}}(n);for(const e of r){const t=new Map;for(const n of e.nodes){const{failureSummary:e,element:r}=n;(t.get(e)||t.set(e,[]).get(e)).push(r)}const{id:n,help:r,description:s,helpUrl:o}=e,i=`a11y/${n}: ${r}.`;for(const[e,n]of t){const t=xd(e);sr(i,$d,{details:`\n\n${s}.\n\n${t}. ([Learn more](${o}))`,elements:n})}}}});const Sd="informative-dfn",Cd="core/linter-rules/informative-dfn",Rd=Nn({en:{msg:(e,t)=>`Normative reference to "${e}" found but term is defined "informatively" in "${t}".`,get hint(){return ur` You can do one of the following... * Get the source definition to be made normative * Add a \`class="lint-ignore"\` attribute to the link. * Use a local normative proxy for the definition Ć  la \`<dfn data-cite="spec">term</dfn>\` - To silence this warning entirely, set \`lint: { "${xd}": false }\` in your \`respecConfig\`.`}}});var Cd=Object.freeze({__proto__:null,name:_d,run:function(e){if(!e.lint?.[xd])return;const t="error"===e.lint[xd]?or:ir;mc.forEach((({term:e,spec:n,element:r})=>{r.classList.contains("lint-ignore")||t(Sd.msg(e,n),_d,{title:"Normative reference to non-normative term.",elements:[r],hint:Sd.hint})}))}}),Rd=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'}),Ed=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 <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); + To silence this warning entirely, set \`lint: { "${Sd}": false }\` in your \`respecConfig\`.`}}});var Ed=Object.freeze({__proto__:null,name:Cd,run:function(e){if(!e.lint?.[Sd])return;const t="error"===e.lint[Sd]?rr:sr;bc.forEach((({term:e,spec:n,element:r})=>{r.classList.contains("lint-ignore")||t(Rd.msg(e,n),Cd,{title:"Normative reference to non-normative term.",elements:[r],hint:Rd.hint})}))}}),Ad=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'}),Td=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 <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLAnchorElement> elements */\n const anchors = panel.querySelectorAll("a[href]");\n // No need to trap focus\n if (!anchors.length) return;\n\n // Move focus to first anchor element\n const first = anchors.item(0);\n first.focus();\n\n const trapListener = createTrapListener(anchors, panel, dfn);\n panel.addEventListener("keydown", trapListener);\n\n // Hiding the panel releases the trap\n const mo = new MutationObserver(records => {\n const [record] = records;\n const target = /** @type HTMLElement */ (record.target);\n if (target.hidden) {\n panel.removeEventListener("keydown", trapListener);\n mo.disconnect();\n }\n });\n mo.observe(panel, { attributes: true, attributeFilter: ["hidden"] });\n}\n\n/**\n *\n * @param {NodeListOf<HTMLAnchorElement>} anchors\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(anchors, panel, dfn) {\n const lastIndex = anchors.length - 1;\n let currentIndex = 0;\n return event => {\n switch (event.key) {\n // Hitting "Tab" traps us in a nice loop around elements.\n case "Tab": {\n event.preventDefault();\n currentIndex += event.shiftKey ? -1 : +1;\n if (currentIndex < 0) {\n currentIndex = lastIndex;\n } else if (currentIndex > lastIndex) {\n currentIndex = 0;\n }\n anchors.item(currentIndex).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n hidePanel(panel);\n break;\n\n // Hitting "Escape" returns focus to dfn.\n case "Escape":\n hidePanel(panel);\n dfn.focus();\n return;\n }\n };\n}\n\n/** @param {HTMLElement} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n})()'})}(); //# sourceMappingURL=respec-w3c.js.map diff --git a/builds/respec-w3c.js.map b/builds/respec-w3c.js.map index 3f6a749c6c..b0b05d07b9 100644 --- a/builds/respec-w3c.js.map +++ b/builds/respec-w3c.js.map @@ -1 +1 @@ -{"version":3,"file":"respec-w3c.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/index.js","../node_modules/webidl2/lib/error.js","../node_modules/webidl2/lib/productions/base.js","../node_modules/webidl2/lib/validators/helpers.js","../node_modules/webidl2/lib/productions/array-base.js","../node_modules/webidl2/lib/productions/token.js","../node_modules/webidl2/lib/productions/extended-attributes.js","../node_modules/webidl2/lib/productions/type.js","../node_modules/webidl2/lib/productions/default.js","../node_modules/webidl2/lib/productions/argument.js","../node_modules/webidl2/lib/productions/operation.js","../node_modules/webidl2/lib/productions/attribute.js","../node_modules/webidl2/lib/productions/helpers.js","../node_modules/webidl2/lib/tokeniser.js","../node_modules/webidl2/lib/productions/enum.js","../node_modules/webidl2/lib/productions/includes.js","../node_modules/webidl2/lib/productions/typedef.js","../node_modules/webidl2/lib/productions/callback.js","../node_modules/webidl2/lib/productions/container.js","../node_modules/webidl2/lib/productions/constant.js","../node_modules/webidl2/lib/productions/iterable.js","../node_modules/webidl2/lib/productions/constructor.js","../node_modules/webidl2/lib/productions/interface.js","../node_modules/webidl2/lib/validators/interface.js","../node_modules/webidl2/lib/productions/mixin.js","../node_modules/webidl2/lib/productions/field.js","../node_modules/webidl2/lib/productions/dictionary.js","../node_modules/webidl2/lib/productions/namespace.js","../node_modules/webidl2/lib/productions/callback-interface.js","../node_modules/webidl2/lib/webidl2.js","../node_modules/webidl2/lib/writer.js","../node_modules/webidl2/lib/validator.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/utils.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/w3c.js","../src/core/location-hash.js","../src/w3c/group.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/w3c/templates/headers.js","../src/w3c/templates/cgbg-headers.js","../src/w3c/templates/sotd.js","../src/w3c/templates/cgbg-sotd.js","../src/w3c/headers.js","../src/core/defaults.js","../src/w3c/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/w3c/style.js","../src/core/github.js","../src/core/sections.js","../src/core/data-include.js","../src/core/reindent.js","../src/core/title.js","../src/w3c/level.js","../src/w3c/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/w3c/conformance.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/tables.js","../src/core/dfn-finder.js","../src/core/webidl-clipboard.js","../src/styles/webidl.css.js","../src/core/webidl.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/xref-db.js","../src/core/xref.js","../src/styles/dfn-index.css.js","../src/core/dfn-index.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/webidl-index.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/styles/caniuse.css.js","../src/core/caniuse.js","../src/styles/mdn-annotation.css.js","../src/core/mdn-annotation.js","../src/ui/save-html.js","../src/ui/search-specref.js","../src/ui/search-xref.js","../src/ui/about-respec.js","../src/core/seo.js","../src/w3c/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/data-tests.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/web-monetization.js","../src/core/dfn-contract.js","../src/core/before-save.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/check-internal-slots.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-captionless-tables.js","../src/core/linter-rules/no-unused-dfns.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/w3c/linter-rules/required-sections.js","../src/core/linter-rules/wpt-tests-exist.js","../src/core/linter-rules/no-http-props.js","../src/core/linter-rules/a11y.js","../src/core/linter-rules/informative-dfn.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\n// Explicitly default lang and dir on <html> if not set.\n// We assume English and ltr as default for international standards.\nif (!html?.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html?.lang ?? \"en\";\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst transactionDoneMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(this.request);\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nconst advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance'];\nconst methodMap = {};\nconst advanceResults = new WeakMap();\nconst ittrProxiedCursorToOriginalProxy = new WeakMap();\nconst cursorIteratorTraps = {\n get(target, prop) {\n if (!advanceMethodProps.includes(prop))\n return target[prop];\n let cachedFunc = methodMap[prop];\n if (!cachedFunc) {\n cachedFunc = methodMap[prop] = function (...args) {\n advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args));\n };\n }\n return cachedFunc;\n },\n};\nasync function* iterate(...args) {\n // tslint:disable-next-line:no-this-assignment\n let cursor = this;\n if (!(cursor instanceof IDBCursor)) {\n cursor = await cursor.openCursor(...args);\n }\n if (!cursor)\n return;\n cursor = cursor;\n const proxiedCursor = new Proxy(cursor, cursorIteratorTraps);\n ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor);\n // Map this double-proxy back to the original, so other cursor methods work.\n reverseTransformCache.set(proxiedCursor, unwrap(cursor));\n while (cursor) {\n yield proxiedCursor;\n // If one of the advancing methods was not called, call continue().\n cursor = await (advanceResults.get(proxiedCursor) || cursor.continue());\n advanceResults.delete(proxiedCursor);\n }\n}\nfunction isIteratorProp(target, prop) {\n return ((prop === Symbol.asyncIterator &&\n instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) ||\n (prop === 'iterate' && instanceOfAny(target, [IDBIndex, IDBObjectStore])));\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get(target, prop, receiver) {\n if (isIteratorProp(target, prop))\n return iterate;\n return oldTraps.get(target, prop, receiver);\n },\n has(target, prop) {\n return isIteratorProp(target, prop) || oldTraps.has(target, prop);\n },\n}));\n\nexport { deleteDB, openDB, unwrap, wrap };\n","/**\n * @param {string} text\n */\nfunction lastLine(text) {\n const splitted = text.split(\"\\n\");\n return splitted[splitted.length - 1];\n}\n\nfunction appendIfExist(base, target) {\n let result = base;\n if (target) {\n result += ` ${target}`;\n }\n return result;\n}\n\nfunction contextAsText(node) {\n const hierarchy = [node];\n while (node && node.parent) {\n const { parent } = node;\n hierarchy.unshift(parent);\n node = parent;\n }\n return hierarchy.map((n) => appendIfExist(n.type, n.name)).join(\" -> \");\n}\n\n/**\n * @typedef {object} WebIDL2ErrorOptions\n * @property {\"error\" | \"warning\"} [level]\n * @property {Function} [autofix]\n * @property {string} [ruleName]\n *\n * @typedef {ReturnType<typeof error>} WebIDLErrorData\n *\n * @param {string} message error message\n * @param {*} position\n * @param {*} current\n * @param {*} message\n * @param {\"Syntax\" | \"Validation\"} kind error type\n * @param {WebIDL2ErrorOptions=} options\n */\nfunction error(\n source,\n position,\n current,\n message,\n kind,\n { level = \"error\", autofix, ruleName } = {}\n) {\n /**\n * @param {number} count\n */\n function sliceTokens(count) {\n return count > 0\n ? source.slice(position, position + count)\n : source.slice(Math.max(position + count, 0), position);\n }\n\n /**\n * @param {import(\"./tokeniser.js\").Token[]} inputs\n * @param {object} [options]\n * @param {boolean} [options.precedes]\n * @returns\n */\n function tokensToText(inputs, { precedes } = {}) {\n const text = inputs.map((t) => t.trivia + t.value).join(\"\");\n const nextToken = source[position];\n if (nextToken.type === \"eof\") {\n return text;\n }\n if (precedes) {\n return text + nextToken.trivia;\n }\n return text.slice(nextToken.trivia.length);\n }\n\n const maxTokens = 5; // arbitrary but works well enough\n const line =\n source[position].type !== \"eof\"\n ? source[position].line\n : source.length > 1\n ? source[position - 1].line\n : 1;\n\n const precedingLastLine = lastLine(\n tokensToText(sliceTokens(-maxTokens), { precedes: true })\n );\n\n const subsequentTokens = sliceTokens(maxTokens);\n const subsequentText = tokensToText(subsequentTokens);\n const subsequentFirstLine = subsequentText.split(\"\\n\")[0];\n\n const spaced = \" \".repeat(precedingLastLine.length) + \"^\";\n const sourceContext = precedingLastLine + subsequentFirstLine + \"\\n\" + spaced;\n\n const contextType = kind === \"Syntax\" ? \"since\" : \"inside\";\n const inSourceName = source.name ? ` in ${source.name}` : \"\";\n const grammaticalContext =\n current && current.name\n ? `, ${contextType} \\`${current.partial ? \"partial \" : \"\"}${contextAsText(\n current\n )}\\``\n : \"\";\n const context = `${kind} error at line ${line}${inSourceName}${grammaticalContext}:\\n${sourceContext}`;\n return {\n message: `${context} ${message}`,\n bareMessage: message,\n context,\n line,\n sourceName: source.name,\n level,\n ruleName,\n autofix,\n input: subsequentText,\n tokens: subsequentTokens,\n };\n}\n\n/**\n * @param {string} message error message\n */\nexport function syntaxError(source, position, current, message) {\n return error(source, position, current, message, \"Syntax\");\n}\n\n/**\n * @param {string} message error message\n * @param {WebIDL2ErrorOptions} [options]\n */\nexport function validationError(\n token,\n current,\n ruleName,\n message,\n options = {}\n) {\n options.ruleName = ruleName;\n return error(\n current.source,\n token.index,\n current,\n message,\n \"Validation\",\n options\n );\n}\n","export class Base {\n /**\n * @param {object} initializer\n * @param {Base[\"source\"]} initializer.source\n * @param {Base[\"tokens\"]} initializer.tokens\n */\n constructor({ source, tokens }) {\n Object.defineProperties(this, {\n source: { value: source },\n tokens: { value: tokens, writable: true },\n parent: { value: null, writable: true },\n this: { value: this }, // useful when escaping from proxy\n });\n }\n\n toJSON() {\n const json = { type: undefined, name: undefined, inheritance: undefined };\n let proto = this;\n while (proto !== Object.prototype) {\n const descMap = Object.getOwnPropertyDescriptors(proto);\n for (const [key, value] of Object.entries(descMap)) {\n if (value.enumerable || value.get) {\n // @ts-ignore - allow indexing here\n json[key] = this[key];\n }\n }\n proto = Object.getPrototypeOf(proto);\n }\n return json;\n }\n}\n","/**\n * @typedef {import(\"../validator.js\").Definitions} Definitions\n * @typedef {import(\"../productions/dictionary.js\").Dictionary} Dictionary\n * @typedef {import(\"../../lib/productions/type\").Type} Type\n *\n * @param {Type} idlType\n * @param {Definitions} defs\n * @param {object} [options]\n * @param {boolean} [options.useNullableInner] use when the input idlType is nullable and you want to use its inner type\n * @return {{ reference: *, dictionary: Dictionary }} the type reference that ultimately includes dictionary.\n */\nexport function idlTypeIncludesDictionary(\n idlType,\n defs,\n { useNullableInner } = {}\n) {\n if (!idlType.union) {\n const def = defs.unique.get(idlType.idlType);\n if (!def) {\n return;\n }\n if (def.type === \"typedef\") {\n const { typedefIncludesDictionary } = defs.cache;\n if (typedefIncludesDictionary.has(def)) {\n // Note that this also halts when it met indeterminate state\n // to prevent infinite recursion\n return typedefIncludesDictionary.get(def);\n }\n defs.cache.typedefIncludesDictionary.set(def, undefined); // indeterminate state\n const result = idlTypeIncludesDictionary(def.idlType, defs);\n defs.cache.typedefIncludesDictionary.set(def, result);\n if (result) {\n return {\n reference: idlType,\n dictionary: result.dictionary,\n };\n }\n }\n if (def.type === \"dictionary\" && (useNullableInner || !idlType.nullable)) {\n return {\n reference: idlType,\n dictionary: def,\n };\n }\n }\n for (const subtype of idlType.subtype) {\n const result = idlTypeIncludesDictionary(subtype, defs);\n if (result) {\n if (subtype.union) {\n return result;\n }\n return {\n reference: subtype,\n dictionary: result.dictionary,\n };\n }\n }\n}\n\n/**\n * @param {Dictionary} dict dictionary type\n * @param {Definitions} defs\n * @return {boolean}\n */\nexport function dictionaryIncludesRequiredField(dict, defs) {\n if (defs.cache.dictionaryIncludesRequiredField.has(dict)) {\n return defs.cache.dictionaryIncludesRequiredField.get(dict);\n }\n // Set cached result to indeterminate to short-circuit circular definitions.\n // The final result will be updated to true or false.\n defs.cache.dictionaryIncludesRequiredField.set(dict, undefined);\n let result = dict.members.some((field) => field.required);\n if (!result && dict.inheritance) {\n const superdict = defs.unique.get(dict.inheritance);\n if (!superdict) {\n // Assume required members in the supertype if it is unknown.\n result = true;\n } else if (dictionaryIncludesRequiredField(superdict, defs)) {\n result = true;\n }\n }\n defs.cache.dictionaryIncludesRequiredField.set(dict, result);\n return result;\n}\n\n/**\n * For now this only checks the most frequent cases:\n * 1. direct inclusion of [EnforceRange]\n * 2. typedef of that\n *\n * More complex cases with dictionaries and records are not covered yet.\n *\n * @param {Type} idlType\n * @param {Definitions} defs\n */\nexport function idlTypeIncludesEnforceRange(idlType, defs) {\n if (idlType.union) {\n // TODO: This should ideally be checked too\n return false;\n }\n\n if (idlType.extAttrs.some((e) => e.name === \"EnforceRange\")) {\n return true;\n }\n\n const def = defs.unique.get(idlType.idlType);\n if (def?.type !== \"typedef\") {\n return false;\n }\n\n return def.idlType.extAttrs.some((e) => e.name === \"EnforceRange\");\n}\n","export class ArrayBase extends Array {\n constructor({ source, tokens }) {\n super();\n Object.defineProperties(this, {\n source: { value: source },\n tokens: { value: tokens },\n parent: { value: null, writable: true },\n });\n }\n}\n","import { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class WrappedToken extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} type\n */\n static parser(tokeniser, type) {\n return () => {\n const value = tokeniser.consumeKind(type);\n if (value) {\n return new WrappedToken({\n source: tokeniser.source,\n tokens: { value },\n });\n }\n };\n }\n\n get value() {\n return unescape(this.tokens.value.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n w.token(this.tokens.value),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\nexport class Eof extends WrappedToken {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consumeKind(\"eof\");\n if (value) {\n return new Eof({ source: tokeniser.source, tokens: { value } });\n }\n }\n\n get type() {\n return \"eof\";\n }\n}\n","import { Base } from \"./base.js\";\nimport { ArrayBase } from \"./array-base.js\";\nimport { WrappedToken } from \"./token.js\";\nimport { list, argument_list, autoParenter, unescape } from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} tokenName\n */\nfunction tokens(tokeniser, tokenName) {\n return list(tokeniser, {\n parser: WrappedToken.parser(tokeniser, tokenName),\n listName: tokenName + \" list\",\n });\n}\n\nconst extAttrValueSyntax = [\"identifier\", \"decimal\", \"integer\", \"string\"];\n\nconst shouldBeLegacyPrefixed = [\n \"NoInterfaceObject\",\n \"LenientSetter\",\n \"LenientThis\",\n \"TreatNonObjectAsNull\",\n \"Unforgeable\",\n];\n\nconst renamedLegacies = new Map([\n .../** @type {[string, string][]} */ (\n shouldBeLegacyPrefixed.map((name) => [name, `Legacy${name}`])\n ),\n [\"NamedConstructor\", \"LegacyFactoryFunction\"],\n [\"OverrideBuiltins\", \"LegacyOverrideBuiltIns\"],\n [\"TreatNullAs\", \"LegacyNullToEmptyString\"],\n]);\n\n/**\n * This will allow a set of extended attribute values to be parsed.\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction extAttrListItems(tokeniser) {\n for (const syntax of extAttrValueSyntax) {\n const toks = tokens(tokeniser, syntax);\n if (toks.length) {\n return toks;\n }\n }\n tokeniser.error(\n `Expected identifiers, strings, decimals, or integers but none found`\n );\n}\n\nexport class ExtendedAttributeParameters extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const tokens = { assign: tokeniser.consume(\"=\") };\n const ret = autoParenter(\n new ExtendedAttributeParameters({ source: tokeniser.source, tokens })\n );\n ret.list = [];\n if (tokens.assign) {\n tokens.asterisk = tokeniser.consume(\"*\");\n if (tokens.asterisk) {\n return ret.this;\n }\n tokens.secondaryName = tokeniser.consumeKind(...extAttrValueSyntax);\n }\n tokens.open = tokeniser.consume(\"(\");\n if (tokens.open) {\n ret.list = ret.rhsIsList\n ? // [Exposed=(Window,Worker)]\n extAttrListItems(tokeniser)\n : // [LegacyFactoryFunction=Audio(DOMString src)] or [Constructor(DOMString str)]\n argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") ||\n tokeniser.error(\"Unexpected token in extended attribute argument list\");\n } else if (tokens.assign && !tokens.secondaryName) {\n tokeniser.error(\"No right hand side to extended attribute assignment\");\n }\n return ret.this;\n }\n\n get rhsIsList() {\n return (\n this.tokens.assign && !this.tokens.asterisk && !this.tokens.secondaryName\n );\n }\n\n get rhsType() {\n if (this.rhsIsList) {\n return this.list[0].tokens.value.type + \"-list\";\n }\n if (this.tokens.asterisk) {\n return \"*\";\n }\n if (this.tokens.secondaryName) {\n return this.tokens.secondaryName.type;\n }\n return null;\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { rhsType } = this;\n return w.ts.wrap([\n w.token(this.tokens.assign),\n w.token(this.tokens.asterisk),\n w.reference_token(this.tokens.secondaryName, this.parent),\n w.token(this.tokens.open),\n ...this.list.map((p) => {\n return rhsType === \"identifier-list\"\n ? w.identifier(p, this.parent)\n : p.write(w);\n }),\n w.token(this.tokens.close),\n ]);\n }\n}\n\nexport class SimpleExtendedAttribute extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const name = tokeniser.consumeKind(\"identifier\");\n if (name) {\n return new SimpleExtendedAttribute({\n source: tokeniser.source,\n tokens: { name },\n params: ExtendedAttributeParameters.parse(tokeniser),\n });\n }\n }\n\n constructor({ source, tokens, params }) {\n super({ source, tokens });\n params.parent = this;\n Object.defineProperty(this, \"params\", { value: params });\n }\n\n get type() {\n return \"extended-attribute\";\n }\n get name() {\n return this.tokens.name.value;\n }\n get rhs() {\n const { rhsType: type, tokens, list } = this.params;\n if (!type) {\n return null;\n }\n const value = this.params.rhsIsList\n ? list\n : this.params.tokens.secondaryName\n ? unescape(tokens.secondaryName.value)\n : null;\n return { type, value };\n }\n get arguments() {\n const { rhsIsList, list } = this.params;\n if (!list || rhsIsList) {\n return [];\n }\n return list;\n }\n\n *validate(defs) {\n const { name } = this;\n if (name === \"LegacyNoInterfaceObject\") {\n const message = `\\`[LegacyNoInterfaceObject]\\` extended attribute is an \\\nundesirable feature that may be removed from Web IDL in the future. Refer to the \\\n[relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more \\\ninformation.`;\n yield validationError(\n this.tokens.name,\n this,\n \"no-nointerfaceobject\",\n message,\n { level: \"warning\" }\n );\n } else if (renamedLegacies.has(name)) {\n const message = `\\`[${name}]\\` extended attribute is a legacy feature \\\nthat is now renamed to \\`[${renamedLegacies.get(name)}]\\`. Refer to the \\\n[relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more \\\ninformation.`;\n yield validationError(this.tokens.name, this, \"renamed-legacy\", message, {\n level: \"warning\",\n autofix: renameLegacyExtendedAttribute(this),\n });\n }\n for (const arg of this.arguments) {\n yield* arg.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n w.ts.trivia(this.tokens.name.trivia),\n w.ts.extendedAttribute(\n w.ts.wrap([\n w.ts.extendedAttributeReference(this.name),\n this.params.write(w),\n ])\n ),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {SimpleExtendedAttribute} extAttr\n */\nfunction renameLegacyExtendedAttribute(extAttr) {\n return () => {\n const { name } = extAttr;\n extAttr.tokens.name.value = renamedLegacies.get(name);\n if (name === \"TreatNullAs\") {\n extAttr.params.tokens = {};\n }\n };\n}\n\n// Note: we parse something simpler than the official syntax. It's all that ever\n// seems to be used\nexport class ExtendedAttributes extends ArrayBase {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const tokens = {};\n tokens.open = tokeniser.consume(\"[\");\n const ret = new ExtendedAttributes({ source: tokeniser.source, tokens });\n if (!tokens.open) return ret;\n ret.push(\n ...list(tokeniser, {\n parser: SimpleExtendedAttribute.parse,\n listName: \"extended attribute\",\n })\n );\n tokens.close =\n tokeniser.consume(\"]\") ||\n tokeniser.error(\n \"Expected a closing token for the extended attribute list\"\n );\n if (!ret.length) {\n tokeniser.unconsume(tokens.close.index);\n tokeniser.error(\"An extended attribute list must not be empty\");\n }\n if (tokeniser.probe(\"[\")) {\n tokeniser.error(\n \"Illegal double extended attribute lists, consider merging them\"\n );\n }\n return ret;\n }\n\n *validate(defs) {\n for (const extAttr of this) {\n yield* extAttr.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n if (!this.length) return \"\";\n return w.ts.wrap([\n w.token(this.tokens.open),\n ...this.map((ea) => ea.write(w)),\n w.token(this.tokens.close),\n ]);\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n return_type,\n primitive_type,\n autoParenter,\n} from \"./helpers.js\";\nimport { stringTypes, typeNameKeywords } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport { idlTypeIncludesDictionary } from \"../validators/helpers.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nfunction generic_type(tokeniser, typeName) {\n const base = tokeniser.consume(\n \"FrozenArray\",\n \"ObservableArray\",\n \"Promise\",\n \"sequence\",\n \"record\"\n );\n if (!base) {\n return;\n }\n const ret = autoParenter(\n new Type({ source: tokeniser.source, tokens: { base } })\n );\n ret.tokens.open =\n tokeniser.consume(\"<\") ||\n tokeniser.error(`No opening bracket after ${base.value}`);\n switch (base.value) {\n case \"Promise\": {\n if (tokeniser.probe(\"[\"))\n tokeniser.error(\"Promise type cannot have extended attribute\");\n const subtype =\n return_type(tokeniser, typeName) ||\n tokeniser.error(\"Missing Promise subtype\");\n ret.subtype.push(subtype);\n break;\n }\n case \"sequence\":\n case \"FrozenArray\":\n case \"ObservableArray\": {\n const subtype =\n type_with_extended_attributes(tokeniser, typeName) ||\n tokeniser.error(`Missing ${base.value} subtype`);\n ret.subtype.push(subtype);\n break;\n }\n case \"record\": {\n if (tokeniser.probe(\"[\"))\n tokeniser.error(\"Record key cannot have extended attribute\");\n const keyType =\n tokeniser.consume(...stringTypes) ||\n tokeniser.error(`Record key must be one of: ${stringTypes.join(\", \")}`);\n const keyIdlType = new Type({\n source: tokeniser.source,\n tokens: { base: keyType },\n });\n keyIdlType.tokens.separator =\n tokeniser.consume(\",\") ||\n tokeniser.error(\"Missing comma after record key type\");\n keyIdlType.type = typeName;\n const valueType =\n type_with_extended_attributes(tokeniser, typeName) ||\n tokeniser.error(\"Error parsing generic type record\");\n ret.subtype.push(keyIdlType, valueType);\n break;\n }\n }\n if (!ret.idlType) tokeniser.error(`Error parsing generic type ${base.value}`);\n ret.tokens.close =\n tokeniser.consume(\">\") ||\n tokeniser.error(`Missing closing bracket after ${base.value}`);\n return ret.this;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction type_suffix(tokeniser, obj) {\n const nullable = tokeniser.consume(\"?\");\n if (nullable) {\n obj.tokens.nullable = nullable;\n }\n if (tokeniser.probe(\"?\")) tokeniser.error(\"Can't nullable more than once\");\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nfunction single_type(tokeniser, typeName) {\n let ret = generic_type(tokeniser, typeName) || primitive_type(tokeniser);\n if (!ret) {\n const base =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.consume(...stringTypes, ...typeNameKeywords);\n if (!base) {\n return;\n }\n ret = new Type({ source: tokeniser.source, tokens: { base } });\n if (tokeniser.probe(\"<\"))\n tokeniser.error(`Unsupported generic type ${base.value}`);\n }\n if (ret.generic === \"Promise\" && tokeniser.probe(\"?\")) {\n tokeniser.error(\"Promise type cannot be nullable\");\n }\n ret.type = typeName || null;\n type_suffix(tokeniser, ret);\n if (ret.nullable && ret.idlType === \"any\")\n tokeniser.error(\"Type `any` cannot be made nullable\");\n return ret;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} type\n */\nfunction union_type(tokeniser, type) {\n const tokens = {};\n tokens.open = tokeniser.consume(\"(\");\n if (!tokens.open) return;\n const ret = autoParenter(new Type({ source: tokeniser.source, tokens }));\n ret.type = type || null;\n while (true) {\n const typ =\n type_with_extended_attributes(tokeniser, type) ||\n tokeniser.error(\"No type after open parenthesis or 'or' in union type\");\n if (typ.idlType === \"any\")\n tokeniser.error(\"Type `any` cannot be included in a union type\");\n if (typ.generic === \"Promise\")\n tokeniser.error(\"Type `Promise` cannot be included in a union type\");\n ret.subtype.push(typ);\n const or = tokeniser.consume(\"or\");\n if (or) {\n typ.tokens.separator = or;\n } else break;\n }\n if (ret.idlType.length < 2) {\n tokeniser.error(\n \"At least two types are expected in a union type but found less\"\n );\n }\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated union type\");\n type_suffix(tokeniser, ret);\n return ret.this;\n}\n\nexport class Type extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} typeName\n */\n static parse(tokeniser, typeName) {\n return single_type(tokeniser, typeName) || union_type(tokeniser, typeName);\n }\n\n constructor({ source, tokens }) {\n super({ source, tokens });\n Object.defineProperty(this, \"subtype\", { value: [], writable: true });\n this.extAttrs = new ExtendedAttributes({ source, tokens: {} });\n }\n\n get generic() {\n if (this.subtype.length && this.tokens.base) {\n return this.tokens.base.value;\n }\n return \"\";\n }\n get nullable() {\n return Boolean(this.tokens.nullable);\n }\n get union() {\n return Boolean(this.subtype.length) && !this.tokens.base;\n }\n get idlType() {\n if (this.subtype.length) {\n return this.subtype;\n }\n // Adding prefixes/postfixes for \"unrestricted float\", etc.\n const name = [this.tokens.prefix, this.tokens.base, this.tokens.postfix]\n .filter((t) => t)\n .map((t) => t.value)\n .join(\" \");\n return unescape(name);\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n\n if (this.idlType === \"BufferSource\") {\n // XXX: For now this is a hack. Consider moving parents' extAttrs into types as the spec says:\n // https://webidl.spec.whatwg.org/#idl-annotated-types\n for (const extAttrs of [this.extAttrs, this.parent?.extAttrs]) {\n for (const extAttr of extAttrs) {\n if (extAttr.name !== \"AllowShared\") {\n continue;\n }\n const message = `\\`[AllowShared] BufferSource\\` is now replaced with AllowSharedBufferSource.`;\n yield validationError(\n this.tokens.base,\n this,\n \"migrate-allowshared\",\n message,\n { autofix: replaceAllowShared(this, extAttr, extAttrs) }\n );\n }\n }\n }\n\n if (this.idlType === \"void\") {\n const message = `\\`void\\` is now replaced by \\`undefined\\`. Refer to the \\\n[relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) \\\nfor more information.`;\n yield validationError(this.tokens.base, this, \"replace-void\", message, {\n autofix: replaceVoid(this),\n });\n }\n\n /*\n * If a union is nullable, its subunions cannot include a dictionary\n * If not, subunions may include dictionaries if each union is not nullable\n */\n const typedef = !this.union && defs.unique.get(this.idlType);\n const target = this.union\n ? this\n : typedef && typedef.type === \"typedef\"\n ? typedef.idlType\n : undefined;\n if (target && this.nullable) {\n // do not allow any dictionary\n const { reference } = idlTypeIncludesDictionary(target, defs) || {};\n if (reference) {\n const targetToken = (this.union ? reference : this).tokens.base;\n const message = \"Nullable union cannot include a dictionary type.\";\n yield validationError(\n targetToken,\n this,\n \"no-nullable-union-dict\",\n message\n );\n }\n } else {\n // allow some dictionary\n for (const subtype of this.subtype) {\n yield* subtype.validate(defs);\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const type_body = () => {\n if (this.union || this.generic) {\n return w.ts.wrap([\n w.token(this.tokens.base, w.ts.generic),\n w.token(this.tokens.open),\n ...this.subtype.map((t) => t.write(w)),\n w.token(this.tokens.close),\n ]);\n }\n const firstToken = this.tokens.prefix || this.tokens.base;\n const prefix = this.tokens.prefix\n ? [this.tokens.prefix.value, w.ts.trivia(this.tokens.base.trivia)]\n : [];\n const ref = w.reference(\n w.ts.wrap([\n ...prefix,\n this.tokens.base.value,\n w.token(this.tokens.postfix),\n ]),\n {\n unescaped: /** @type {string} (because it's not union) */ (\n this.idlType\n ),\n context: this,\n }\n );\n return w.ts.wrap([w.ts.trivia(firstToken.trivia), ref]);\n };\n return w.ts.wrap([\n this.extAttrs.write(w),\n type_body(),\n w.token(this.tokens.nullable),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {Type} type\n * @param {import(\"./extended-attributes.js\").SimpleExtendedAttribute} extAttr\n * @param {ExtendedAttributes} extAttrs\n */\nfunction replaceAllowShared(type, extAttr, extAttrs) {\n return () => {\n const index = extAttrs.indexOf(extAttr);\n extAttrs.splice(index, 1);\n if (!extAttrs.length && type.tokens.base.trivia.match(/^\\s$/)) {\n type.tokens.base.trivia = \"\"; // (let's not remove comments)\n }\n\n type.tokens.base.value = \"AllowSharedBufferSource\";\n };\n}\n\n/**\n * @param {Type} type\n */\nfunction replaceVoid(type) {\n return () => {\n type.tokens.base.value = \"undefined\";\n };\n}\n","import { Base } from \"./base.js\";\nimport { const_data, const_value } from \"./helpers.js\";\n\nexport class Default extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const assign = tokeniser.consume(\"=\");\n if (!assign) {\n return null;\n }\n const def =\n const_value(tokeniser) ||\n tokeniser.consumeKind(\"string\") ||\n tokeniser.consume(\"null\", \"[\", \"{\") ||\n tokeniser.error(\"No value for default\");\n const expression = [def];\n if (def.value === \"[\") {\n const close =\n tokeniser.consume(\"]\") ||\n tokeniser.error(\"Default sequence value must be empty\");\n expression.push(close);\n } else if (def.value === \"{\") {\n const close =\n tokeniser.consume(\"}\") ||\n tokeniser.error(\"Default dictionary value must be empty\");\n expression.push(close);\n }\n return new Default({\n source: tokeniser.source,\n tokens: { assign },\n expression,\n });\n }\n\n constructor({ source, tokens, expression }) {\n super({ source, tokens });\n expression.parent = this;\n Object.defineProperty(this, \"expression\", { value: expression });\n }\n\n get type() {\n return const_data(this.expression[0]).type;\n }\n get value() {\n return const_data(this.expression[0]).value;\n }\n get negative() {\n return const_data(this.expression[0]).negative;\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n w.token(this.tokens.assign),\n ...this.expression.map((t) => w.token(t)),\n ]);\n }\n}\n","import { Base } from \"./base.js\";\nimport { Default } from \"./default.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n autoParenter,\n getFirstToken,\n} from \"./helpers.js\";\nimport { argumentNameKeywords, Tokeniser } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport {\n idlTypeIncludesDictionary,\n dictionaryIncludesRequiredField,\n} from \"../validators/helpers.js\";\n\nexport class Argument extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const start_position = tokeniser.position;\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(\n new Argument({ source: tokeniser.source, tokens })\n );\n ret.extAttrs = ExtendedAttributes.parse(tokeniser);\n tokens.optional = tokeniser.consume(\"optional\");\n ret.idlType = type_with_extended_attributes(tokeniser, \"argument-type\");\n if (!ret.idlType) {\n return tokeniser.unconsume(start_position);\n }\n if (!tokens.optional) {\n tokens.variadic = tokeniser.consume(\"...\");\n }\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.consume(...argumentNameKeywords);\n if (!tokens.name) {\n return tokeniser.unconsume(start_position);\n }\n ret.default = tokens.optional ? Default.parse(tokeniser) : null;\n return ret.this;\n }\n\n get type() {\n return \"argument\";\n }\n get optional() {\n return !!this.tokens.optional;\n }\n get variadic() {\n return !!this.tokens.variadic;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n /**\n * @param {import(\"../validator.js\").Definitions} defs\n */\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n const result = idlTypeIncludesDictionary(this.idlType, defs, {\n useNullableInner: true,\n });\n if (result) {\n if (this.idlType.nullable) {\n const message = `Dictionary arguments cannot be nullable.`;\n yield validationError(\n this.tokens.name,\n this,\n \"no-nullable-dict-arg\",\n message\n );\n } else if (!this.optional) {\n if (\n this.parent &&\n !dictionaryIncludesRequiredField(result.dictionary, defs) &&\n isLastRequiredArgument(this)\n ) {\n const message = `Dictionary argument must be optional if it has no required fields`;\n yield validationError(\n this.tokens.name,\n this,\n \"dict-arg-optional\",\n message,\n {\n autofix: autofixDictionaryArgumentOptionality(this),\n }\n );\n }\n } else if (!this.default) {\n const message = `Optional dictionary arguments must have a default value of \\`{}\\`.`;\n yield validationError(\n this.tokens.name,\n this,\n \"dict-arg-default\",\n message,\n {\n autofix: autofixOptionalDictionaryDefaultValue(this),\n }\n );\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.optional),\n w.ts.type(this.idlType.write(w)),\n w.token(this.tokens.variadic),\n w.name_token(this.tokens.name, { data: this }),\n this.default ? this.default.write(w) : \"\",\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {Argument} arg\n */\nfunction isLastRequiredArgument(arg) {\n const list = arg.parent.arguments || arg.parent.list;\n const index = list.indexOf(arg);\n const requiredExists = list.slice(index + 1).some((a) => !a.optional);\n return !requiredExists;\n}\n\n/**\n * @param {Argument} arg\n */\nfunction autofixDictionaryArgumentOptionality(arg) {\n return () => {\n const firstToken = getFirstToken(arg.idlType);\n arg.tokens.optional = {\n ...firstToken,\n type: \"optional\",\n value: \"optional\",\n };\n firstToken.trivia = \" \";\n autofixOptionalDictionaryDefaultValue(arg)();\n };\n}\n\n/**\n * @param {Argument} arg\n */\nfunction autofixOptionalDictionaryDefaultValue(arg) {\n return () => {\n arg.default = Default.parse(new Tokeniser(\" = {}\"));\n };\n}\n","import { Base } from \"./base.js\";\nimport {\n return_type,\n argument_list,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\n\nexport class Operation extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.special]\n * @param {import(\"../tokeniser.js\").Token} [options.regular]\n */\n static parse(tokeniser, { special, regular } = {}) {\n const tokens = { special };\n const ret = autoParenter(\n new Operation({ source: tokeniser.source, tokens })\n );\n if (special && special.value === \"stringifier\") {\n tokens.termination = tokeniser.consume(\";\");\n if (tokens.termination) {\n ret.arguments = [];\n return ret;\n }\n }\n if (!special && !regular) {\n tokens.special = tokeniser.consume(\"getter\", \"setter\", \"deleter\");\n }\n ret.idlType =\n return_type(tokeniser) || tokeniser.error(\"Missing return type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") || tokeniser.consume(\"includes\");\n tokens.open =\n tokeniser.consume(\"(\") || tokeniser.error(\"Invalid operation\");\n ret.arguments = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated operation\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated operation, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"operation\";\n }\n get name() {\n const { name } = this.tokens;\n if (!name) {\n return \"\";\n }\n return unescape(name.value);\n }\n get special() {\n if (!this.tokens.special) {\n return \"\";\n }\n return this.tokens.special.value;\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n if (!this.name && [\"\", \"static\"].includes(this.special)) {\n const message = `Regular or static operations must have both a return type and an identifier.`;\n yield validationError(this.tokens.open, this, \"incomplete-op\", message);\n }\n if (this.idlType) {\n yield* this.idlType.validate(defs);\n }\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n const body = this.idlType\n ? [\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.open),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.close),\n ]\n : [];\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n this.tokens.name\n ? w.token(this.tokens.special)\n : w.token(this.tokens.special, w.ts.nameless, { data: this, parent }),\n ...body,\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { validationError } from \"../error.js\";\nimport {\n idlTypeIncludesDictionary,\n idlTypeIncludesEnforceRange,\n} from \"../validators/helpers.js\";\nimport { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\n\nexport class Attribute extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.special]\n * @param {boolean} [options.noInherit]\n * @param {boolean} [options.readonly]\n */\n static parse(\n tokeniser,\n { special, noInherit = false, readonly = false } = {}\n ) {\n const start_position = tokeniser.position;\n const tokens = { special };\n const ret = autoParenter(\n new Attribute({ source: tokeniser.source, tokens })\n );\n if (!special && !noInherit) {\n tokens.special = tokeniser.consume(\"inherit\");\n }\n if (ret.special === \"inherit\" && tokeniser.probe(\"readonly\")) {\n tokeniser.error(\"Inherited attributes cannot be read-only\");\n }\n tokens.readonly = tokeniser.consume(\"readonly\");\n if (readonly && !tokens.readonly && tokeniser.probe(\"attribute\")) {\n tokeniser.error(\"Attributes must be readonly in this context\");\n }\n tokens.base = tokeniser.consume(\"attribute\");\n if (!tokens.base) {\n tokeniser.unconsume(start_position);\n return;\n }\n ret.idlType =\n type_with_extended_attributes(tokeniser, \"attribute-type\") ||\n tokeniser.error(\"Attribute lacks a type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.consume(\"async\", \"required\") ||\n tokeniser.error(\"Attribute lacks a name\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated attribute, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"attribute\";\n }\n get special() {\n if (!this.tokens.special) {\n return \"\";\n }\n return this.tokens.special.value;\n }\n get readonly() {\n return !!this.tokens.readonly;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n\n if ([\"sequence\", \"record\"].includes(this.idlType.generic)) {\n const message = `Attributes cannot accept ${this.idlType.generic} types.`;\n yield validationError(\n this.tokens.name,\n this,\n \"attr-invalid-type\",\n message\n );\n }\n\n {\n const { reference } = idlTypeIncludesDictionary(this.idlType, defs) || {};\n if (reference) {\n const targetToken = (this.idlType.union ? reference : this.idlType)\n .tokens.base;\n const message = \"Attributes cannot accept dictionary types.\";\n yield validationError(targetToken, this, \"attr-invalid-type\", message);\n }\n }\n\n if (this.readonly) {\n if (idlTypeIncludesEnforceRange(this.idlType, defs)) {\n const targetToken = this.idlType.tokens.base;\n const message =\n \"Readonly attributes cannot accept [EnforceRange] extended attribute.\";\n yield validationError(targetToken, this, \"attr-invalid-type\", message);\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.special),\n w.token(this.tokens.readonly),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Type } from \"./type.js\";\nimport { Argument } from \"./argument.js\";\nimport {\n ExtendedAttributes,\n SimpleExtendedAttribute,\n} from \"./extended-attributes.js\";\nimport { Operation } from \"./operation.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Tokeniser } from \"../tokeniser.js\";\n\n/**\n * @param {string} identifier\n */\nexport function unescape(identifier) {\n return identifier.startsWith(\"_\") ? identifier.slice(1) : identifier;\n}\n\n/**\n * Parses comma-separated list\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} args\n * @param {Function} args.parser parser function for each item\n * @param {boolean} [args.allowDangler] whether to allow dangling comma\n * @param {string} [args.listName] the name to be shown on error messages\n */\nexport function list(tokeniser, { parser, allowDangler, listName = \"list\" }) {\n const first = parser(tokeniser);\n if (!first) {\n return [];\n }\n first.tokens.separator = tokeniser.consume(\",\");\n const items = [first];\n while (first.tokens.separator) {\n const item = parser(tokeniser);\n if (!item) {\n if (!allowDangler) {\n tokeniser.error(`Trailing comma in ${listName}`);\n }\n break;\n }\n item.tokens.separator = tokeniser.consume(\",\");\n items.push(item);\n if (!item.tokens.separator) break;\n }\n return items;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function const_value(tokeniser) {\n return (\n tokeniser.consumeKind(\"decimal\", \"integer\") ||\n tokeniser.consume(\"true\", \"false\", \"Infinity\", \"-Infinity\", \"NaN\")\n );\n}\n\n/**\n * @param {object} token\n * @param {string} token.type\n * @param {string} token.value\n */\nexport function const_data({ type, value }) {\n switch (type) {\n case \"decimal\":\n case \"integer\":\n return { type: \"number\", value };\n case \"string\":\n return { type: \"string\", value: value.slice(1, -1) };\n }\n\n switch (value) {\n case \"true\":\n case \"false\":\n return { type: \"boolean\", value: value === \"true\" };\n case \"Infinity\":\n case \"-Infinity\":\n return { type: \"Infinity\", negative: value.startsWith(\"-\") };\n case \"[\":\n return { type: \"sequence\", value: [] };\n case \"{\":\n return { type: \"dictionary\" };\n default:\n return { type: value };\n }\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function primitive_type(tokeniser) {\n function integer_type() {\n const prefix = tokeniser.consume(\"unsigned\");\n const base = tokeniser.consume(\"short\", \"long\");\n if (base) {\n const postfix = tokeniser.consume(\"long\");\n return new Type({ source, tokens: { prefix, base, postfix } });\n }\n if (prefix) tokeniser.error(\"Failed to parse integer type\");\n }\n\n function decimal_type() {\n const prefix = tokeniser.consume(\"unrestricted\");\n const base = tokeniser.consume(\"float\", \"double\");\n if (base) {\n return new Type({ source, tokens: { prefix, base } });\n }\n if (prefix) tokeniser.error(\"Failed to parse float type\");\n }\n\n const { source } = tokeniser;\n const num_type = integer_type() || decimal_type();\n if (num_type) return num_type;\n const base = tokeniser.consume(\n \"bigint\",\n \"boolean\",\n \"byte\",\n \"octet\",\n \"undefined\"\n );\n if (base) {\n return new Type({ source, tokens: { base } });\n }\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function argument_list(tokeniser) {\n return list(tokeniser, {\n parser: Argument.parse,\n listName: \"arguments list\",\n });\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string=} typeName (TODO: See Type.type for more details)\n */\nexport function type_with_extended_attributes(tokeniser, typeName) {\n const extAttrs = ExtendedAttributes.parse(tokeniser);\n const ret = Type.parse(tokeniser, typeName);\n if (ret) autoParenter(ret).extAttrs = extAttrs;\n return ret;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string=} typeName (TODO: See Type.type for more details)\n */\nexport function return_type(tokeniser, typeName) {\n const typ = Type.parse(tokeniser, typeName || \"return-type\");\n if (typ) {\n return typ;\n }\n const voidToken = tokeniser.consume(\"void\");\n if (voidToken) {\n const ret = new Type({\n source: tokeniser.source,\n tokens: { base: voidToken },\n });\n ret.type = \"return-type\";\n return ret;\n }\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function stringifier(tokeniser) {\n const special = tokeniser.consume(\"stringifier\");\n if (!special) return;\n const member =\n Attribute.parse(tokeniser, { special }) ||\n Operation.parse(tokeniser, { special }) ||\n tokeniser.error(\"Unterminated stringifier\");\n return member;\n}\n\n/**\n * @param {string} str\n */\nexport function getLastIndentation(str) {\n const lines = str.split(\"\\n\");\n // the first line visually binds to the preceding token\n if (lines.length) {\n const match = lines[lines.length - 1].match(/^\\s+/);\n if (match) {\n return match[0];\n }\n }\n return \"\";\n}\n\n/**\n * @param {string} parentTrivia\n */\nexport function getMemberIndentation(parentTrivia) {\n const indentation = getLastIndentation(parentTrivia);\n const indentCh = indentation.includes(\"\\t\") ? \"\\t\" : \" \";\n return indentation + indentCh;\n}\n\n/**\n * @param {import(\"./interface.js\").Interface} def\n */\nexport function autofixAddExposedWindow(def) {\n return () => {\n if (def.extAttrs.length) {\n const tokeniser = new Tokeniser(\"Exposed=Window,\");\n const exposed = SimpleExtendedAttribute.parse(tokeniser);\n exposed.tokens.separator = tokeniser.consume(\",\");\n const existing = def.extAttrs[0];\n if (!/^\\s/.test(existing.tokens.name.trivia)) {\n existing.tokens.name.trivia = ` ${existing.tokens.name.trivia}`;\n }\n def.extAttrs.unshift(exposed);\n } else {\n autoParenter(def).extAttrs = ExtendedAttributes.parse(\n new Tokeniser(\"[Exposed=Window]\")\n );\n const trivia = def.tokens.base.trivia;\n def.extAttrs.tokens.open.trivia = trivia;\n def.tokens.base.trivia = `\\n${getLastIndentation(trivia)}`;\n }\n };\n}\n\n/**\n * Get the first syntax token for the given IDL object.\n * @param {*} data\n */\nexport function getFirstToken(data) {\n if (data.extAttrs.length) {\n return data.extAttrs.tokens.open;\n }\n if (data.type === \"operation\" && !data.special) {\n return getFirstToken(data.idlType);\n }\n const tokens = Object.values(data.tokens).sort((x, y) => x.index - y.index);\n return tokens[0];\n}\n\n/**\n * @template T\n * @param {T[]} array\n * @param {(item: T) => boolean} predicate\n */\nexport function findLastIndex(array, predicate) {\n const index = array.slice().reverse().findIndex(predicate);\n if (index === -1) {\n return index;\n }\n return array.length - index - 1;\n}\n\n/**\n * Returns a proxy that auto-assign `parent` field.\n * @template {Record<string | symbol, any>} T\n * @param {T} data\n * @param {*} [parent] The object that will be assigned to `parent`.\n * If absent, it will be `data` by default.\n * @return {T}\n */\nexport function autoParenter(data, parent) {\n if (!parent) {\n // Defaults to `data` unless specified otherwise.\n parent = data;\n }\n if (!data) {\n // This allows `autoParenter(undefined)` which again allows\n // `autoParenter(parse())` where the function may return nothing.\n return data;\n }\n const proxy = new Proxy(data, {\n get(target, p) {\n const value = target[p];\n if (Array.isArray(value) && p !== \"source\") {\n // Wraps the array so that any added items will also automatically\n // get their `parent` values.\n return autoParenter(value, target);\n }\n return value;\n },\n set(target, p, value) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/47357\n target[p] = value;\n if (!value) {\n return true;\n } else if (Array.isArray(value)) {\n // Assigning an array will add `parent` to its items.\n for (const item of value) {\n if (typeof item.parent !== \"undefined\") {\n item.parent = parent;\n }\n }\n } else if (typeof value.parent !== \"undefined\") {\n value.parent = parent;\n }\n return true;\n },\n });\n return proxy;\n}\n","import { syntaxError } from \"./error.js\";\nimport { unescape } from \"./productions/helpers.js\";\n\n// These regular expressions use the sticky flag so they will only match at\n// the current location (ie. the offset of lastIndex).\nconst tokenRe = {\n // This expression uses a lookahead assertion to catch false matches\n // against integers early.\n decimal:\n /-?(?=[0-9]*\\.|[0-9]+[eE])(([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,\n integer: /-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,\n identifier: /[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,\n string: /\"[^\"]*\"/y,\n whitespace: /[\\t\\n\\r ]+/y,\n comment: /\\/\\/.*|\\/\\*[\\s\\S]*?\\*\\//y,\n other: /[^\\t\\n\\r 0-9A-Za-z]/y,\n};\n\nexport const typeNameKeywords = [\n \"ArrayBuffer\",\n \"SharedArrayBuffer\",\n \"DataView\",\n \"Int8Array\",\n \"Int16Array\",\n \"Int32Array\",\n \"Uint8Array\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8ClampedArray\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Float32Array\",\n \"Float64Array\",\n \"any\",\n \"object\",\n \"symbol\",\n];\n\nexport const stringTypes = [\"ByteString\", \"DOMString\", \"USVString\"];\n\nexport const argumentNameKeywords = [\n \"async\",\n \"attribute\",\n \"callback\",\n \"const\",\n \"constructor\",\n \"deleter\",\n \"dictionary\",\n \"enum\",\n \"getter\",\n \"includes\",\n \"inherit\",\n \"interface\",\n \"iterable\",\n \"maplike\",\n \"namespace\",\n \"partial\",\n \"required\",\n \"setlike\",\n \"setter\",\n \"static\",\n \"stringifier\",\n \"typedef\",\n \"unrestricted\",\n];\n\nconst nonRegexTerminals = [\n \"-Infinity\",\n \"FrozenArray\",\n \"Infinity\",\n \"NaN\",\n \"ObservableArray\",\n \"Promise\",\n \"bigint\",\n \"boolean\",\n \"byte\",\n \"double\",\n \"false\",\n \"float\",\n \"long\",\n \"mixin\",\n \"null\",\n \"octet\",\n \"optional\",\n \"or\",\n \"readonly\",\n \"record\",\n \"sequence\",\n \"short\",\n \"true\",\n \"undefined\",\n \"unsigned\",\n \"void\",\n].concat(argumentNameKeywords, stringTypes, typeNameKeywords);\n\nconst punctuations = [\n \"(\",\n \")\",\n \",\",\n \"...\",\n \":\",\n \";\",\n \"<\",\n \"=\",\n \">\",\n \"?\",\n \"*\",\n \"[\",\n \"]\",\n \"{\",\n \"}\",\n];\n\nconst reserved = [\n // \"constructor\" is now a keyword\n \"_constructor\",\n \"toString\",\n \"_toString\",\n];\n\n/**\n * @typedef {ArrayItemType<ReturnType<typeof tokenise>>} Token\n * @param {string} str\n */\nfunction tokenise(str) {\n const tokens = [];\n let lastCharIndex = 0;\n let trivia = \"\";\n let line = 1;\n let index = 0;\n while (lastCharIndex < str.length) {\n const nextChar = str.charAt(lastCharIndex);\n let result = -1;\n\n if (/[\\t\\n\\r ]/.test(nextChar)) {\n result = attemptTokenMatch(\"whitespace\", { noFlushTrivia: true });\n } else if (nextChar === \"/\") {\n result = attemptTokenMatch(\"comment\", { noFlushTrivia: true });\n }\n\n if (result !== -1) {\n const currentTrivia = tokens.pop().value;\n line += (currentTrivia.match(/\\n/g) || []).length;\n trivia += currentTrivia;\n index -= 1;\n } else if (/[-0-9.A-Z_a-z]/.test(nextChar)) {\n result = attemptTokenMatch(\"decimal\");\n if (result === -1) {\n result = attemptTokenMatch(\"integer\");\n }\n if (result === -1) {\n result = attemptTokenMatch(\"identifier\");\n const lastIndex = tokens.length - 1;\n const token = tokens[lastIndex];\n if (result !== -1) {\n if (reserved.includes(token.value)) {\n const message = `${unescape(\n token.value\n )} is a reserved identifier and must not be used.`;\n throw new WebIDLParseError(\n syntaxError(tokens, lastIndex, null, message)\n );\n } else if (nonRegexTerminals.includes(token.value)) {\n token.type = \"inline\";\n }\n }\n }\n } else if (nextChar === '\"') {\n result = attemptTokenMatch(\"string\");\n }\n\n for (const punctuation of punctuations) {\n if (str.startsWith(punctuation, lastCharIndex)) {\n tokens.push({\n type: \"inline\",\n value: punctuation,\n trivia,\n line,\n index,\n });\n trivia = \"\";\n lastCharIndex += punctuation.length;\n result = lastCharIndex;\n break;\n }\n }\n\n // other as the last try\n if (result === -1) {\n result = attemptTokenMatch(\"other\");\n }\n if (result === -1) {\n throw new Error(\"Token stream not progressing\");\n }\n lastCharIndex = result;\n index += 1;\n }\n\n // remaining trivia as eof\n tokens.push({\n type: \"eof\",\n value: \"\",\n trivia,\n line,\n index,\n });\n\n return tokens;\n\n /**\n * @param {keyof typeof tokenRe} type\n * @param {object} options\n * @param {boolean} [options.noFlushTrivia]\n */\n function attemptTokenMatch(type, { noFlushTrivia } = {}) {\n const re = tokenRe[type];\n re.lastIndex = lastCharIndex;\n const result = re.exec(str);\n if (result) {\n tokens.push({ type, value: result[0], trivia, line, index });\n if (!noFlushTrivia) {\n trivia = \"\";\n }\n return re.lastIndex;\n }\n return -1;\n }\n}\n\nexport class Tokeniser {\n /**\n * @param {string} idl\n */\n constructor(idl) {\n this.source = tokenise(idl);\n this.position = 0;\n }\n\n /**\n * @param {string} message\n * @return {never}\n */\n error(message) {\n throw new WebIDLParseError(\n syntaxError(this.source, this.position, this.current, message)\n );\n }\n\n /**\n * @param {string} type\n */\n probeKind(type) {\n return (\n this.source.length > this.position &&\n this.source[this.position].type === type\n );\n }\n\n /**\n * @param {string} value\n */\n probe(value) {\n return (\n this.probeKind(\"inline\") && this.source[this.position].value === value\n );\n }\n\n /**\n * @param {...string} candidates\n */\n consumeKind(...candidates) {\n for (const type of candidates) {\n if (!this.probeKind(type)) continue;\n const token = this.source[this.position];\n this.position++;\n return token;\n }\n }\n\n /**\n * @param {...string} candidates\n */\n consume(...candidates) {\n if (!this.probeKind(\"inline\")) return;\n const token = this.source[this.position];\n for (const value of candidates) {\n if (token.value !== value) continue;\n this.position++;\n return token;\n }\n }\n\n /**\n * @param {string} value\n */\n consumeIdentifier(value) {\n if (!this.probeKind(\"identifier\")) {\n return;\n }\n if (this.source[this.position].value !== value) {\n return;\n }\n return this.consumeKind(\"identifier\");\n }\n\n /**\n * @param {number} position\n */\n unconsume(position) {\n this.position = position;\n }\n}\n\nexport class WebIDLParseError extends Error {\n /**\n * @param {object} options\n * @param {string} options.message\n * @param {string} options.bareMessage\n * @param {string} options.context\n * @param {number} options.line\n * @param {*} options.sourceName\n * @param {string} options.input\n * @param {*[]} options.tokens\n */\n constructor({\n message,\n bareMessage,\n context,\n line,\n sourceName,\n input,\n tokens,\n }) {\n super(message);\n\n this.name = \"WebIDLParseError\"; // not to be mangled\n this.bareMessage = bareMessage;\n this.context = context;\n this.line = line;\n this.sourceName = sourceName;\n this.input = input;\n this.tokens = tokens;\n }\n}\n","import { list, unescape, autoParenter } from \"./helpers.js\";\nimport { WrappedToken } from \"./token.js\";\nimport { Base } from \"./base.js\";\n\nexport class EnumValue extends WrappedToken {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consumeKind(\"string\");\n if (value) {\n return new EnumValue({ source: tokeniser.source, tokens: { value } });\n }\n }\n\n get type() {\n return \"enum-value\";\n }\n get value() {\n return super.value.slice(1, -1);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.wrap([\n w.ts.trivia(this.tokens.value.trivia),\n w.ts.definition(\n w.ts.wrap(['\"', w.ts.name(this.value, { data: this, parent }), '\"']),\n { data: this, parent }\n ),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\nexport class Enum extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n tokens.base = tokeniser.consume(\"enum\");\n if (!tokens.base) {\n return;\n }\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"No name for enum\");\n const ret = autoParenter(new Enum({ source: tokeniser.source, tokens }));\n tokeniser.current = ret.this;\n tokens.open = tokeniser.consume(\"{\") || tokeniser.error(\"Bodyless enum\");\n ret.values = list(tokeniser, {\n parser: EnumValue.parse,\n allowDangler: true,\n listName: \"enumeration\",\n });\n if (tokeniser.probeKind(\"string\")) {\n tokeniser.error(\"No comma between enum values\");\n }\n tokens.close =\n tokeniser.consume(\"}\") || tokeniser.error(\"Unexpected value in enum\");\n if (!ret.values.length) {\n tokeniser.error(\"No value in enum\");\n }\n tokens.termination =\n tokeniser.consume(\";\") || tokeniser.error(\"No semicolon after enum\");\n return ret.this;\n }\n\n get type() {\n return \"enum\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.open),\n w.ts.wrap(this.values.map((v) => v.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class Includes extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const target = tokeniser.consumeKind(\"identifier\");\n if (!target) {\n return;\n }\n const tokens = { target };\n tokens.includes = tokeniser.consume(\"includes\");\n if (!tokens.includes) {\n tokeniser.unconsume(target.index);\n return;\n }\n tokens.mixin =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Incomplete includes statement\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"No terminating ; for includes statement\");\n return new Includes({ source: tokeniser.source, tokens });\n }\n\n get type() {\n return \"includes\";\n }\n get target() {\n return unescape(this.tokens.target.value);\n }\n get includes() {\n return unescape(this.tokens.mixin.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.reference_token(this.tokens.target, this),\n w.token(this.tokens.includes),\n w.reference_token(this.tokens.mixin, this),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\n\nexport class Typedef extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(new Typedef({ source: tokeniser.source, tokens }));\n tokens.base = tokeniser.consume(\"typedef\");\n if (!tokens.base) {\n return;\n }\n ret.idlType =\n type_with_extended_attributes(tokeniser, \"typedef-type\") ||\n tokeniser.error(\"Typedef lacks a type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Typedef lacks a name\");\n tokeniser.current = ret.this;\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated typedef, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"typedef\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n return_type,\n argument_list,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\n\nexport class CallbackFunction extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser, base) {\n const tokens = { base };\n const ret = autoParenter(\n new CallbackFunction({ source: tokeniser.source, tokens })\n );\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Callback lacks a name\");\n tokeniser.current = ret.this;\n tokens.assign =\n tokeniser.consume(\"=\") || tokeniser.error(\"Callback lacks an assignment\");\n ret.idlType =\n return_type(tokeniser) || tokeniser.error(\"Callback lacks a return type\");\n tokens.open =\n tokeniser.consume(\"(\") ||\n tokeniser.error(\"Callback lacks parentheses for arguments\");\n ret.arguments = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated callback\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated callback, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"callback\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.assign),\n w.ts.type(this.idlType.write(w)),\n w.token(this.tokens.open),\n ...this.arguments.map((arg) => arg.write(w)),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport { unescape, autoParenter } from \"./helpers.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction inheritance(tokeniser) {\n const colon = tokeniser.consume(\":\");\n if (!colon) {\n return {};\n }\n const inheritance =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Inheritance lacks a type\");\n return { colon, inheritance };\n}\n\n/**\n * Parser callback.\n * @callback ParserCallback\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {...*} args\n */\n\n/**\n * A parser callback and optional option object.\n * @typedef AllowedMember\n * @type {[ParserCallback, object?]}\n */\n\nexport class Container extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {*} instance TODO: This should be {T extends Container}, but see https://github.com/microsoft/TypeScript/issues/4628\n * @param {*} args\n */\n static parse(tokeniser, instance, { inheritable, allowedMembers }) {\n const { tokens, type } = instance;\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(`Missing name in ${type}`);\n tokeniser.current = instance;\n instance = autoParenter(instance);\n if (inheritable) {\n Object.assign(tokens, inheritance(tokeniser));\n }\n tokens.open = tokeniser.consume(\"{\") || tokeniser.error(`Bodyless ${type}`);\n instance.members = [];\n while (true) {\n tokens.close = tokeniser.consume(\"}\");\n if (tokens.close) {\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(`Missing semicolon after ${type}`);\n return instance.this;\n }\n const ea = ExtendedAttributes.parse(tokeniser);\n let mem;\n for (const [parser, ...args] of allowedMembers) {\n mem = autoParenter(parser(tokeniser, ...args));\n if (mem) {\n break;\n }\n }\n if (!mem) {\n tokeniser.error(\"Unknown member\");\n }\n mem.extAttrs = ea;\n instance.members.push(mem.this);\n }\n }\n\n get partial() {\n return !!this.tokens.partial;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get inheritance() {\n if (!this.tokens.inheritance) {\n return null;\n }\n return unescape(this.tokens.inheritance.value);\n }\n\n *validate(defs) {\n for (const member of this.members) {\n if (member.validate) {\n yield* member.validate(defs);\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const inheritance = () => {\n if (!this.tokens.inheritance) {\n return \"\";\n }\n return w.ts.wrap([\n w.token(this.tokens.colon),\n w.ts.trivia(this.tokens.inheritance.trivia),\n w.ts.inheritance(\n w.reference(this.tokens.inheritance.value, { context: this })\n ),\n ]);\n };\n\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.callback),\n w.token(this.tokens.partial),\n w.token(this.tokens.base),\n w.token(this.tokens.mixin),\n w.name_token(this.tokens.name, { data: this }),\n inheritance(),\n w.token(this.tokens.open),\n w.ts.wrap(this.members.map((m) => m.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { Type } from \"./type.js\";\nimport {\n const_data,\n const_value,\n primitive_type,\n autoParenter,\n unescape,\n} from \"./helpers.js\";\n\nexport class Constant extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n tokens.base = tokeniser.consume(\"const\");\n if (!tokens.base) {\n return;\n }\n let idlType = primitive_type(tokeniser);\n if (!idlType) {\n const base =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Const lacks a type\");\n idlType = new Type({ source: tokeniser.source, tokens: { base } });\n }\n if (tokeniser.probe(\"?\")) {\n tokeniser.error(\"Unexpected nullable constant type\");\n }\n idlType.type = \"const-type\";\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Const lacks a name\");\n tokens.assign =\n tokeniser.consume(\"=\") || tokeniser.error(\"Const lacks value assignment\");\n tokens.value =\n const_value(tokeniser) || tokeniser.error(\"Const lacks a value\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated const, expected `;`\");\n const ret = new Constant({ source: tokeniser.source, tokens });\n autoParenter(ret).idlType = idlType;\n return ret;\n }\n\n get type() {\n return \"const\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get value() {\n return const_data(this.tokens.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.assign),\n w.token(this.tokens.value),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n autoParenter,\n argument_list,\n} from \"./helpers.js\";\n\nexport class IterableLike extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const start_position = tokeniser.position;\n const ret = autoParenter(\n new IterableLike({ source: tokeniser.source, tokens: {} })\n );\n const { tokens } = ret;\n tokens.readonly = tokeniser.consume(\"readonly\");\n if (!tokens.readonly) {\n tokens.async = tokeniser.consume(\"async\");\n }\n tokens.base = tokens.readonly\n ? tokeniser.consume(\"maplike\", \"setlike\")\n : tokens.async\n ? tokeniser.consume(\"iterable\")\n : tokeniser.consume(\"iterable\", \"maplike\", \"setlike\");\n if (!tokens.base) {\n tokeniser.unconsume(start_position);\n return;\n }\n\n const { type } = ret;\n const secondTypeRequired = type === \"maplike\";\n const secondTypeAllowed = secondTypeRequired || type === \"iterable\";\n const argumentAllowed = ret.async && type === \"iterable\";\n\n tokens.open =\n tokeniser.consume(\"<\") ||\n tokeniser.error(`Missing less-than sign \\`<\\` in ${type} declaration`);\n const first =\n type_with_extended_attributes(tokeniser) ||\n tokeniser.error(`Missing a type argument in ${type} declaration`);\n ret.idlType = [first];\n ret.arguments = [];\n\n if (secondTypeAllowed) {\n first.tokens.separator = tokeniser.consume(\",\");\n if (first.tokens.separator) {\n ret.idlType.push(type_with_extended_attributes(tokeniser));\n } else if (secondTypeRequired) {\n tokeniser.error(`Missing second type argument in ${type} declaration`);\n }\n }\n\n tokens.close =\n tokeniser.consume(\">\") ||\n tokeniser.error(`Missing greater-than sign \\`>\\` in ${type} declaration`);\n\n if (tokeniser.probe(\"(\")) {\n if (argumentAllowed) {\n tokens.argsOpen = tokeniser.consume(\"(\");\n ret.arguments.push(...argument_list(tokeniser));\n tokens.argsClose =\n tokeniser.consume(\")\") ||\n tokeniser.error(\"Unterminated async iterable argument list\");\n } else {\n tokeniser.error(`Arguments are only allowed for \\`async iterable\\``);\n }\n }\n\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(`Missing semicolon after ${type} declaration`);\n\n return ret.this;\n }\n\n get type() {\n return this.tokens.base.value;\n }\n get readonly() {\n return !!this.tokens.readonly;\n }\n get async() {\n return !!this.tokens.async;\n }\n\n *validate(defs) {\n for (const type of this.idlType) {\n yield* type.validate(defs);\n }\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.readonly),\n w.token(this.tokens.async),\n w.token(this.tokens.base, w.ts.generic),\n w.token(this.tokens.open),\n w.ts.wrap(this.idlType.map((t) => t.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.argsOpen),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.argsClose),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent: this.parent }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { argument_list, autoParenter } from \"./helpers.js\";\n\nexport class Constructor extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const base = tokeniser.consume(\"constructor\");\n if (!base) {\n return;\n }\n /** @type {Base[\"tokens\"]} */\n const tokens = { base };\n tokens.open =\n tokeniser.consume(\"(\") ||\n tokeniser.error(\"No argument list in constructor\");\n const args = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated constructor\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"No semicolon after constructor\");\n const ret = new Constructor({ source: tokeniser.source, tokens });\n autoParenter(ret).arguments = args;\n return ret;\n }\n\n get type() {\n return \"constructor\";\n }\n\n *validate(defs) {\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base, w.ts.nameless, { data: this, parent }),\n w.token(this.tokens.open),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Container } from \"./container.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { Constant } from \"./constant.js\";\nimport { IterableLike } from \"./iterable.js\";\nimport {\n stringifier,\n autofixAddExposedWindow,\n getMemberIndentation,\n getLastIndentation,\n getFirstToken,\n findLastIndex,\n autoParenter,\n} from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\nimport { checkInterfaceMemberDuplication } from \"../validators/interface.js\";\nimport { Constructor } from \"./constructor.js\";\nimport { Tokeniser } from \"../tokeniser.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction static_member(tokeniser) {\n const special = tokeniser.consume(\"static\");\n if (!special) return;\n const member =\n Attribute.parse(tokeniser, { special }) ||\n Operation.parse(tokeniser, { special }) ||\n tokeniser.error(\"No body in static member\");\n return member;\n}\n\nexport class Interface extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {import(\"../tokeniser.js\").Token} base\n * @param {object} [options]\n * @param {import(\"./container.js\").AllowedMember[]} [options.extMembers]\n * @param {import(\"../tokeniser.js\").Token|null} [options.partial]\n */\n static parse(tokeniser, base, { extMembers = [], partial = null } = {}) {\n const tokens = { partial, base };\n return Container.parse(\n tokeniser,\n new Interface({ source: tokeniser.source, tokens }),\n {\n inheritable: !partial,\n allowedMembers: [\n ...extMembers,\n [Constant.parse],\n [Constructor.parse],\n [static_member],\n [stringifier],\n [IterableLike.parse],\n [Attribute.parse],\n [Operation.parse],\n ],\n }\n );\n }\n\n get type() {\n return \"interface\";\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n if (\n !this.partial &&\n this.extAttrs.every((extAttr) => extAttr.name !== \"Exposed\")\n ) {\n const message = `Interfaces must have \\`[Exposed]\\` extended attribute. \\\nTo fix, add, for example, \\`[Exposed=Window]\\`. Please also consider carefully \\\nif your interface should also be exposed in a Worker scope. Refer to the \\\n[WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) \\\nfor more information.`;\n yield validationError(\n this.tokens.name,\n this,\n \"require-exposed\",\n message,\n {\n autofix: autofixAddExposedWindow(this),\n }\n );\n }\n const oldConstructors = this.extAttrs.filter(\n (extAttr) => extAttr.name === \"Constructor\"\n );\n for (const constructor of oldConstructors) {\n const message = `Constructors should now be represented as a \\`constructor()\\` operation on the interface \\\ninstead of \\`[Constructor]\\` extended attribute. Refer to the \\\n[WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) \\\nfor more information.`;\n yield validationError(\n constructor.tokens.name,\n this,\n \"constructor-member\",\n message,\n {\n autofix: autofixConstructor(this, constructor),\n }\n );\n }\n\n const isGlobal = this.extAttrs.some((extAttr) => extAttr.name === \"Global\");\n if (isGlobal) {\n const factoryFunctions = this.extAttrs.filter(\n (extAttr) => extAttr.name === \"LegacyFactoryFunction\"\n );\n for (const named of factoryFunctions) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have factory functions.`;\n yield validationError(\n named.tokens.name,\n this,\n \"no-constructible-global\",\n message\n );\n }\n\n const constructors = this.members.filter(\n (member) => member.type === \"constructor\"\n );\n for (const named of constructors) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have constructors.`;\n yield validationError(\n named.tokens.base,\n this,\n \"no-constructible-global\",\n message\n );\n }\n }\n\n yield* super.validate(defs);\n if (!this.partial) {\n yield* checkInterfaceMemberDuplication(defs, this);\n }\n }\n}\n\nfunction autofixConstructor(interfaceDef, constructorExtAttr) {\n interfaceDef = autoParenter(interfaceDef);\n return () => {\n const indentation = getLastIndentation(\n interfaceDef.extAttrs.tokens.open.trivia\n );\n const memberIndent = interfaceDef.members.length\n ? getLastIndentation(getFirstToken(interfaceDef.members[0]).trivia)\n : getMemberIndentation(indentation);\n const constructorOp = Constructor.parse(\n new Tokeniser(`\\n${memberIndent}constructor();`)\n );\n constructorOp.extAttrs = new ExtendedAttributes({\n source: interfaceDef.source,\n tokens: {},\n });\n autoParenter(constructorOp).arguments = constructorExtAttr.arguments;\n\n const existingIndex = findLastIndex(\n interfaceDef.members,\n (m) => m.type === \"constructor\"\n );\n interfaceDef.members.splice(existingIndex + 1, 0, constructorOp);\n\n const { close } = interfaceDef.tokens;\n if (!close.trivia.includes(\"\\n\")) {\n close.trivia += `\\n${indentation}`;\n }\n\n const { extAttrs } = interfaceDef;\n const index = extAttrs.indexOf(constructorExtAttr);\n const removed = extAttrs.splice(index, 1);\n if (!extAttrs.length) {\n extAttrs.tokens.open = extAttrs.tokens.close = undefined;\n } else if (extAttrs.length === index) {\n extAttrs[index - 1].tokens.separator = undefined;\n } else if (!extAttrs[index].tokens.name.trivia.trim()) {\n extAttrs[index].tokens.name.trivia = removed[0].tokens.name.trivia;\n }\n };\n}\n","import { validationError } from \"../error.js\";\n\n/**\n * @param {import(\"../validator.js\").Definitions} defs\n * @param {import(\"../productions/container.js\").Container} i\n */\nexport function* checkInterfaceMemberDuplication(defs, i) {\n const opNames = groupOperationNames(i);\n const partials = defs.partials.get(i.name) || [];\n const mixins = defs.mixinMap.get(i.name) || [];\n for (const ext of [...partials, ...mixins]) {\n const additions = getOperations(ext);\n const statics = additions.filter((a) => a.special === \"static\");\n const nonstatics = additions.filter((a) => a.special !== \"static\");\n yield* checkAdditions(statics, opNames.statics, ext, i);\n yield* checkAdditions(nonstatics, opNames.nonstatics, ext, i);\n statics.forEach((op) => opNames.statics.add(op.name));\n nonstatics.forEach((op) => opNames.nonstatics.add(op.name));\n }\n\n /**\n * @param {import(\"../productions/operation.js\").Operation[]} additions\n * @param {Set<string>} existings\n * @param {import(\"../productions/container.js\").Container} ext\n * @param {import(\"../productions/container.js\").Container} base\n */\n function* checkAdditions(additions, existings, ext, base) {\n for (const addition of additions) {\n const { name } = addition;\n if (name && existings.has(name)) {\n const isStatic = addition.special === \"static\" ? \"static \" : \"\";\n const message = `The ${isStatic}operation \"${name}\" has already been defined for the base interface \"${base.name}\" either in itself or in a mixin`;\n yield validationError(\n addition.tokens.name,\n ext,\n \"no-cross-overload\",\n message\n );\n }\n }\n }\n\n /**\n * @param {import(\"../productions/container.js\").Container} i\n * @returns {import(\"../productions/operation.js\").Operation[]}\n */\n function getOperations(i) {\n return i.members.filter(({ type }) => type === \"operation\");\n }\n\n /**\n * @param {import(\"../productions/container.js\").Container} i\n */\n function groupOperationNames(i) {\n const ops = getOperations(i);\n return {\n statics: new Set(\n ops.filter((op) => op.special === \"static\").map((op) => op.name)\n ),\n nonstatics: new Set(\n ops.filter((op) => op.special !== \"static\").map((op) => op.name)\n ),\n };\n }\n}\n","import { Container } from \"./container.js\";\nimport { Constant } from \"./constant.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { stringifier } from \"./helpers.js\";\n\nexport class Mixin extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {import(\"../tokeniser.js\").Token} base\n * @param {object} [options]\n * @param {import(\"./container.js\").AllowedMember[]} [options.extMembers]\n * @param {import(\"../tokeniser.js\").Token} [options.partial]\n */\n static parse(tokeniser, base, { extMembers = [], partial } = {}) {\n const tokens = { partial, base };\n tokens.mixin = tokeniser.consume(\"mixin\");\n if (!tokens.mixin) {\n return;\n }\n return Container.parse(\n tokeniser,\n new Mixin({ source: tokeniser.source, tokens }),\n {\n allowedMembers: [\n ...extMembers,\n [Constant.parse],\n [stringifier],\n [Attribute.parse, { noInherit: true }],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"interface mixin\";\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n autoParenter,\n} from \"./helpers.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport { Default } from \"./default.js\";\n\nexport class Field extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(new Field({ source: tokeniser.source, tokens }));\n ret.extAttrs = ExtendedAttributes.parse(tokeniser);\n tokens.required = tokeniser.consume(\"required\");\n ret.idlType =\n type_with_extended_attributes(tokeniser, \"dictionary-type\") ||\n tokeniser.error(\"Dictionary member lacks a type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Dictionary member lacks a name\");\n ret.default = Default.parse(tokeniser);\n if (tokens.required && ret.default)\n tokeniser.error(\"Required member must not have a default\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated dictionary member, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"field\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get required() {\n return !!this.tokens.required;\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.required),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n this.default ? this.default.write(w) : \"\",\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Container } from \"./container.js\";\nimport { Field } from \"./field.js\";\n\nexport class Dictionary extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"./container.js\").AllowedMember[]} [options.extMembers]\n * @param {import(\"../tokeniser.js\").Token} [options.partial]\n */\n static parse(tokeniser, { extMembers = [], partial } = {}) {\n const tokens = { partial };\n tokens.base = tokeniser.consume(\"dictionary\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(\n tokeniser,\n new Dictionary({ source: tokeniser.source, tokens }),\n {\n inheritable: !partial,\n allowedMembers: [...extMembers, [Field.parse]],\n }\n );\n }\n\n get type() {\n return \"dictionary\";\n }\n}\n","import { Container } from \"./container.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { validationError } from \"../error.js\";\nimport { autofixAddExposedWindow } from \"./helpers.js\";\nimport { Constant } from \"./constant.js\";\n\nexport class Namespace extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"./container.js\").AllowedMember[]} [options.extMembers]\n * @param {import(\"../tokeniser.js\").Token} [options.partial]\n */\n static parse(tokeniser, { extMembers = [], partial } = {}) {\n const tokens = { partial };\n tokens.base = tokeniser.consume(\"namespace\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(\n tokeniser,\n new Namespace({ source: tokeniser.source, tokens }),\n {\n allowedMembers: [\n ...extMembers,\n [Attribute.parse, { noInherit: true, readonly: true }],\n [Constant.parse],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"namespace\";\n }\n\n *validate(defs) {\n if (\n !this.partial &&\n this.extAttrs.every((extAttr) => extAttr.name !== \"Exposed\")\n ) {\n const message = `Namespaces must have [Exposed] extended attribute. \\\nTo fix, add, for example, [Exposed=Window]. Please also consider carefully \\\nif your namespace should also be exposed in a Worker scope. Refer to the \\\n[WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) \\\nfor more information.`;\n yield validationError(\n this.tokens.name,\n this,\n \"require-exposed\",\n message,\n {\n autofix: autofixAddExposedWindow(this),\n }\n );\n }\n yield* super.validate(defs);\n }\n}\n","import { Container } from \"./container.js\";\nimport { Operation } from \"./operation.js\";\nimport { Constant } from \"./constant.js\";\n\nexport class CallbackInterface extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {*} callback\n * @param {object} [options]\n * @param {import(\"./container.js\").AllowedMember[]} [options.extMembers]\n */\n static parse(tokeniser, callback, { extMembers = [] } = {}) {\n const tokens = { callback };\n tokens.base = tokeniser.consume(\"interface\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(\n tokeniser,\n new CallbackInterface({ source: tokeniser.source, tokens }),\n {\n allowedMembers: [\n ...extMembers,\n [Constant.parse],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"callback interface\";\n }\n}\n","import { Tokeniser } from \"./tokeniser.js\";\nimport { Enum } from \"./productions/enum.js\";\nimport { Includes } from \"./productions/includes.js\";\nimport { ExtendedAttributes } from \"./productions/extended-attributes.js\";\nimport { Typedef } from \"./productions/typedef.js\";\nimport { CallbackFunction } from \"./productions/callback.js\";\nimport { Interface } from \"./productions/interface.js\";\nimport { Mixin } from \"./productions/mixin.js\";\nimport { Dictionary } from \"./productions/dictionary.js\";\nimport { Namespace } from \"./productions/namespace.js\";\nimport { CallbackInterface } from \"./productions/callback-interface.js\";\nimport { autoParenter } from \"./productions/helpers.js\";\nimport { Eof } from \"./productions/token.js\";\n\n/** @typedef {'callbackInterface'|'dictionary'|'interface'|'mixin'|'namespace'} ExtendableInterfaces */\n/** @typedef {{ extMembers?: import(\"./productions/container.js\").AllowedMember[]}} Extension */\n/** @typedef {Partial<Record<ExtendableInterfaces, Extension>>} Extensions */\n\n/**\n * Parser options.\n * @typedef {Object} ParserOptions\n * @property {string} [sourceName]\n * @property {boolean} [concrete]\n * @property {Function[]} [productions]\n * @property {Extensions} [extensions]\n */\n\n/**\n * @param {Tokeniser} tokeniser\n * @param {ParserOptions} options\n */\nfunction parseByTokens(tokeniser, options) {\n const source = tokeniser.source;\n\n function error(str) {\n tokeniser.error(str);\n }\n\n function consume(...candidates) {\n return tokeniser.consume(...candidates);\n }\n\n function callback() {\n const callback = consume(\"callback\");\n if (!callback) return;\n if (tokeniser.probe(\"interface\")) {\n return CallbackInterface.parse(tokeniser, callback, {\n ...options?.extensions?.callbackInterface,\n });\n }\n return CallbackFunction.parse(tokeniser, callback);\n }\n\n function interface_(opts) {\n const base = consume(\"interface\");\n if (!base) return;\n return (\n Mixin.parse(tokeniser, base, {\n ...opts,\n ...options?.extensions?.mixin,\n }) ||\n Interface.parse(tokeniser, base, {\n ...opts,\n ...options?.extensions?.interface,\n }) ||\n error(\"Interface has no proper body\")\n );\n }\n\n function partial() {\n const partial = consume(\"partial\");\n if (!partial) return;\n return (\n Dictionary.parse(tokeniser, {\n partial,\n ...options?.extensions?.dictionary,\n }) ||\n interface_({ partial }) ||\n Namespace.parse(tokeniser, {\n partial,\n ...options?.extensions?.namespace,\n }) ||\n error(\"Partial doesn't apply to anything\")\n );\n }\n\n function definition() {\n if (options.productions) {\n for (const production of options.productions) {\n const result = production(tokeniser);\n if (result) {\n return result;\n }\n }\n }\n\n return (\n callback() ||\n interface_() ||\n partial() ||\n Dictionary.parse(tokeniser, options?.extensions?.dictionary) ||\n Enum.parse(tokeniser) ||\n Typedef.parse(tokeniser) ||\n Includes.parse(tokeniser) ||\n Namespace.parse(tokeniser, options?.extensions?.namespace)\n );\n }\n\n function definitions() {\n if (!source.length) return [];\n const defs = [];\n while (true) {\n const ea = ExtendedAttributes.parse(tokeniser);\n const def = definition();\n if (!def) {\n if (ea.length) error(\"Stray extended attributes\");\n break;\n }\n autoParenter(def).extAttrs = ea;\n defs.push(def);\n }\n const eof = Eof.parse(tokeniser);\n if (options.concrete) {\n defs.push(eof);\n }\n return defs;\n }\n\n const res = definitions();\n if (tokeniser.position < source.length) error(\"Unrecognised tokens\");\n return res;\n}\n\n/**\n * @param {string} str\n * @param {ParserOptions} [options]\n */\nexport function parse(str, options = {}) {\n const tokeniser = new Tokeniser(str);\n if (typeof options.sourceName !== \"undefined\") {\n // @ts-ignore (See Tokeniser.source in supplement.d.ts)\n tokeniser.source.name = options.sourceName;\n }\n return parseByTokens(tokeniser, options);\n}\n","function noop(arg) {\n return arg;\n}\n\nconst templates = {\n wrap: (items) => items.join(\"\"),\n trivia: noop,\n name: noop,\n reference: noop,\n type: noop,\n generic: noop,\n nameless: noop,\n inheritance: noop,\n definition: noop,\n extendedAttribute: noop,\n extendedAttributeReference: noop,\n};\n\nexport class Writer {\n constructor(ts) {\n this.ts = Object.assign({}, templates, ts);\n }\n\n /**\n * @param {string} raw\n * @param {object} options\n * @param {string} [options.unescaped]\n * @param {import(\"./productions/base.js\").Base} [options.context]\n * @returns\n */\n reference(raw, { unescaped, context }) {\n if (!unescaped) {\n unescaped = raw.startsWith(\"_\") ? raw.slice(1) : raw;\n }\n return this.ts.reference(raw, unescaped, context);\n }\n\n /**\n * @param {import(\"./tokeniser.js\").Token} t\n * @param {Function} wrapper\n * @param {...any} args\n * @returns\n */\n token(t, wrapper = noop, ...args) {\n if (!t) {\n return \"\";\n }\n const value = wrapper(t.value, ...args);\n return this.ts.wrap([this.ts.trivia(t.trivia), value]);\n }\n\n reference_token(t, context) {\n return this.token(t, this.reference.bind(this), { context });\n }\n\n name_token(t, arg) {\n return this.token(t, this.ts.name, arg);\n }\n\n identifier(id, context) {\n return this.ts.wrap([\n this.reference_token(id.tokens.value, context),\n this.token(id.tokens.separator),\n ]);\n }\n}\n\nexport function write(ast, { templates: ts = templates } = {}) {\n ts = Object.assign({}, templates, ts);\n\n const w = new Writer(ts);\n\n return ts.wrap(ast.map((it) => it.write(w)));\n}\n","import { validationError as error } from \"./error.js\";\n\nfunction getMixinMap(all, unique) {\n const map = new Map();\n const includes = all.filter((def) => def.type === \"includes\");\n for (const include of includes) {\n const mixin = unique.get(include.includes);\n if (!mixin) {\n continue;\n }\n const array = map.get(include.target);\n if (array) {\n array.push(mixin);\n } else {\n map.set(include.target, [mixin]);\n }\n }\n return map;\n}\n\n/**\n * @typedef {ReturnType<typeof groupDefinitions>} Definitions\n */\nfunction groupDefinitions(all) {\n const unique = new Map();\n const duplicates = new Set();\n const partials = new Map();\n for (const def of all) {\n if (def.partial) {\n const array = partials.get(def.name);\n if (array) {\n array.push(def);\n } else {\n partials.set(def.name, [def]);\n }\n continue;\n }\n if (!def.name) {\n continue;\n }\n if (!unique.has(def.name)) {\n unique.set(def.name, def);\n } else {\n duplicates.add(def);\n }\n }\n return {\n all,\n unique,\n partials,\n duplicates,\n mixinMap: getMixinMap(all, unique),\n cache: {\n typedefIncludesDictionary: new WeakMap(),\n dictionaryIncludesRequiredField: new WeakMap(),\n },\n };\n}\n\nfunction* checkDuplicatedNames({ unique, duplicates }) {\n for (const dup of duplicates) {\n const { name } = dup;\n const message = `The name \"${name}\" of type \"${\n unique.get(name).type\n }\" was already seen`;\n yield error(dup.tokens.name, dup, \"no-duplicate\", message);\n }\n}\n\nfunction* validateIterable(ast) {\n const defs = groupDefinitions(ast);\n for (const def of defs.all) {\n if (def.validate) {\n yield* def.validate(defs);\n }\n }\n yield* checkDuplicatedNames(defs);\n}\n\n// Remove this once all of our support targets expose `.flat()` by default\nfunction flatten(array) {\n if (array.flat) {\n return array.flat();\n }\n return [].concat(...array);\n}\n\n/**\n * @param {import(\"./productions/base.js\").Base[]} ast\n * @return {import(\"./error.js\").WebIDLErrorData[]} validation errors\n */\nexport function validate(ast) {\n return [...validateIterable(flatten(ast))];\n}\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (Ćæ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v12.0.2 - a markdown parser\n * Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\n/**\n * Gets the original marked default options.\n */\nfunction _getDefaults() {\n return {\n async: false,\n breaks: false,\n extensions: null,\n gfm: true,\n hooks: null,\n pedantic: false,\n renderer: null,\n silent: false,\n tokenizer: null,\n walkTokens: null\n };\n}\nlet _defaults = _getDefaults();\nfunction changeDefaults(newDefaults) {\n _defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape$1(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n }\n else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n return html;\n}\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon')\n return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\nconst caret = /(^|[^\\[])\\^/g;\nfunction edit(regex, opt) {\n let source = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n let valSource = typeof val === 'string' ? val : val.source;\n valSource = valSource.replace(caret, '$1');\n source = source.replace(name, valSource);\n return obj;\n },\n getRegex: () => {\n return new RegExp(source, opt);\n }\n };\n return obj;\n}\nfunction cleanUrl(href) {\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n }\n catch (e) {\n return null;\n }\n return href;\n}\nconst noopTest = { exec: () => null };\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false;\n let curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\')\n escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n }\n else {\n // add space before unescaped |\n return ' |';\n }\n }), cells = row.split(/ \\|/);\n let i = 0;\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) {\n cells.shift();\n }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) {\n cells.pop();\n }\n if (count) {\n if (cells.length > count) {\n cells.splice(count);\n }\n else {\n while (cells.length < count)\n cells.push('');\n }\n }\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param str\n * @param c\n * @param invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n }\n else if (currChar !== c && invert) {\n suffLen++;\n }\n else {\n break;\n }\n }\n return str.slice(0, l - suffLen);\n}\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n let level = 0;\n for (let i = 0; i < str.length; i++) {\n if (str[i] === '\\\\') {\n i++;\n }\n else if (str[i] === b[0]) {\n level++;\n }\n else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape$1(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape$1(text)\n };\n}\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n if (matchIndentToCode === null) {\n return text;\n }\n const indentToCode = matchIndentToCode[1];\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n const [indentInNode] = matchIndentInNode;\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n return node;\n })\n .join('\\n');\n}\n/**\n * Tokenizer\n */\nclass _Tokenizer {\n options;\n rules; // set by the lexer\n lexer; // set by the lexer\n constructor(options) {\n this.options = options || _defaults;\n }\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, '$1') : cap[2],\n text\n };\n }\n }\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n }\n else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n // precede setext continuation with 4 spaces so it isn't a setext\n let text = cap[0].replace(/\\n {0,3}((?:=+|-+) *)(?=\\n|$)/g, '\\n $1');\n text = rtrim(text.replace(/^ *>[ \\t]?/gm, ''), '\\n');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n let raw = '';\n let itemContents = '';\n let endsWithBlankLine = false;\n // Check if current bullet point can start a new List Item\n while (src) {\n let endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n raw = cap[0];\n src = src.substring(raw.length);\n let line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n let nextLine = src.split('\\n', 1)[0];\n let indent = 0;\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimStart();\n }\n else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n let blankLine = false;\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n // Check if following lines should be included in List Item\n while (src) {\n const rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n }\n else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n itemContents += '\\n' + nextLine;\n }\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n }\n else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n let istask = null;\n let ischecked;\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents,\n tokens: []\n });\n list.raw += raw;\n }\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimEnd();\n (list.items[list.items.length - 1]).text = itemContents.trimEnd();\n list.raw = list.raw.trimEnd();\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (let i = 0; i < list.items.length; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n list.loose = hasMultipleLineBreaks;\n }\n }\n // Set all items to loose if list is loose\n if (list.loose) {\n for (let i = 0; i < list.items.length; i++) {\n list.items[i].loose = true;\n }\n }\n return list;\n }\n }\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n block: true,\n raw: cap[0],\n pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',\n text: cap[0]\n };\n return token;\n }\n }\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline.anyPunctuation, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (!cap) {\n return;\n }\n if (!/[:|]/.test(cap[2])) {\n // delimiter row must have a pipe (|) or colon (:) otherwise it is a setext heading\n return;\n }\n const headers = splitCells(cap[1]);\n const aligns = cap[2].replace(/^\\||\\| *$/g, '').split('|');\n const rows = cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : [];\n const item = {\n type: 'table',\n raw: cap[0],\n header: [],\n align: [],\n rows: []\n };\n if (headers.length !== aligns.length) {\n // header and align columns must be equal, rows can be different.\n return;\n }\n for (const align of aligns) {\n if (/^ *-+: *$/.test(align)) {\n item.align.push('right');\n }\n else if (/^ *:-+: *$/.test(align)) {\n item.align.push('center');\n }\n else if (/^ *:-+ *$/.test(align)) {\n item.align.push('left');\n }\n else {\n item.align.push(null);\n }\n }\n for (const header of headers) {\n item.header.push({\n text: header,\n tokens: this.lexer.inline(header)\n });\n }\n for (const row of rows) {\n item.rows.push(splitCells(row, item.header.length).map(cell => {\n return {\n text: cell,\n tokens: this.lexer.inline(cell)\n };\n }));\n }\n return item;\n }\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape$1(cap[1])\n };\n }\n }\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n }\n else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n }\n else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n return {\n type: 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n block: false,\n text: cap[0]\n };\n }\n }\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n }\n else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n if (link) {\n href = link[1];\n title = link[3];\n }\n }\n else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n }\n else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline.anyPunctuation, '$1') : href,\n title: title ? title.replace(this.rules.inline.anyPunctuation, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n const linkString = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n const link = links[linkString.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrongLDelim.exec(src);\n if (!match)\n return;\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u))\n return;\n const nextChar = match[1] || match[2] || '';\n if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {\n // unicode Regex counts emoji as 1 char; spread into array for proper count (used multiple times below)\n const lLength = [...match[0]].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;\n endReg.lastIndex = 0;\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n if (!rDelim)\n continue; // skip single * in __abc*abc__\n rLength = [...rDelim].length;\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n }\n else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n delimTotal -= rLength;\n if (delimTotal > 0)\n continue; // Haven't found enough closing delimiters\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n // char length can be >1 for unicode characters;\n const lastCharLength = [...match[0]][0].length;\n const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape$1(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n autolink(src) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[1]);\n href = 'mailto:' + text;\n }\n else {\n text = escape$1(cap[1]);\n href = text;\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n url(src) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[0]);\n href = 'mailto:' + text;\n }\n else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? '';\n } while (prevCapZero !== cap[0]);\n text = escape$1(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n }\n else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n inlineText(src) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = cap[0];\n }\n else {\n text = escape$1(cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst newline = /^(?: *(?:\\n|$))+/;\nconst blockCode = /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/;\nconst fences = /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/;\nconst hr = /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/;\nconst heading = /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/;\nconst bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nconst lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\\n(?!\\s*?\\n|bull |blockCode|fences|blockquote|heading|html))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/)\n .replace(/bull/g, bullet) // lists can interrupt\n .replace(/blockCode/g, / {4}/) // indented code blocks can interrupt\n .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt\n .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n .getRegex();\nconst _paragraph = /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/;\nconst blockText = /^[^\\n]+/;\nconst _blockLabel = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nconst def = edit(/^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/)\n .replace('label', _blockLabel)\n .replace('title', /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/)\n .getRegex();\nconst list = edit(/^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/)\n .replace(/bull/g, bullet)\n .getRegex();\nconst _tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title'\n + '|tr|track|ul';\nconst _comment = /<!--(?:-?>|[\\s\\S]*?(?:-->|$))/;\nconst html = edit('^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')', 'i')\n .replace('comment', _comment)\n .replace('tag', _tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst paragraph = edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\nconst blockquote = edit(/^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/)\n .replace('paragraph', paragraph)\n .getRegex();\n/**\n * Normal Block Grammar\n */\nconst blockNormal = {\n blockquote,\n code: blockCode,\n def,\n fences,\n heading,\n hr,\n html,\n lheading,\n list,\n newline,\n paragraph,\n table: noopTest,\n text: blockText\n};\n/**\n * GFM Block Grammar\n */\nconst gfmTable = edit('^ *([^\\\\n ].*)\\\\n' // Header\n + ' {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)') // Cells\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\nconst blockGfm = {\n ...blockNormal,\n table: gfmTable,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('table', gfmTable) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex()\n};\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\nconst blockPedantic = {\n ...blockNormal,\n html: edit('^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', _comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', lheading)\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .replace('|tag', '')\n .getRegex()\n};\n/**\n * Inline-Level Grammar\n */\nconst escape = /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/;\nconst inlineCode = /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/;\nconst br = /^( {2,}|\\\\)\\n(?!\\s*$)/;\nconst inlineText = /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/;\n// list of unicode punctuation marks, plus any missing characters from CommonMark spec\nconst _punctuation = '\\\\p{P}\\\\p{S}';\nconst punctuation = edit(/^((?![*_])[\\spunctuation])/, 'u')\n .replace(/punctuation/g, _punctuation).getRegex();\n// sequences em should skip over [title](link), `code`, <html>\nconst blockSkip = /\\[[^[\\]]*?\\]\\([^\\(\\)]*?\\)|`[^`]*?`|<[^<>]*?>/g;\nconst emStrongLDelim = edit(/^(?:\\*+(?:((?!\\*)[punct])|[^\\s*]))|^_+(?:((?!_)[punct])|([^\\s_]))/, 'u')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst emStrongRDelimAst = edit('^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)' // Skip orphan inside strong\n + '|[^*]+(?=[^*])' // Consume to delim\n + '|(?!\\\\*)[punct](\\\\*+)(?=[\\\\s]|$)' // (1) #*** can only be a Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?!\\\\*)(?=[punct\\\\s]|$)' // (2) a***#, a*** can only be a Right Delimiter\n + '|(?!\\\\*)[punct\\\\s](\\\\*+)(?=[^punct\\\\s])' // (3) #***a, ***a can only be Left Delimiter\n + '|[\\\\s](\\\\*+)(?!\\\\*)(?=[punct])' // (4) ***# can only be Left Delimiter\n + '|(?!\\\\*)[punct](\\\\*+)(?!\\\\*)(?=[punct])' // (5) #***# can be either Left or Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?=[^punct\\\\s])', 'gu') // (6) a***a can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\n// (6) Not allowed for _\nconst emStrongRDelimUnd = edit('^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)' // Skip orphan inside strong\n + '|[^_]+(?=[^_])' // Consume to delim\n + '|(?!_)[punct](_+)(?=[\\\\s]|$)' // (1) #___ can only be a Right Delimiter\n + '|[^punct\\\\s](_+)(?!_)(?=[punct\\\\s]|$)' // (2) a___#, a___ can only be a Right Delimiter\n + '|(?!_)[punct\\\\s](_+)(?=[^punct\\\\s])' // (3) #___a, ___a can only be Left Delimiter\n + '|[\\\\s](_+)(?!_)(?=[punct])' // (4) ___# can only be Left Delimiter\n + '|(?!_)[punct](_+)(?!_)(?=[punct])', 'gu') // (5) #___# can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst anyPunctuation = edit(/\\\\([punct])/, 'gu')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst autolink = edit(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/)\n .replace('scheme', /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/)\n .replace('email', /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/)\n .getRegex();\nconst _inlineComment = edit(_comment).replace('(?:-->|$)', '-->').getRegex();\nconst tag = edit('^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>') // CDATA section\n .replace('comment', _inlineComment)\n .replace('attribute', /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst _inlineLabel = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\nconst link = edit(/^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/)\n .replace('label', _inlineLabel)\n .replace('href', /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/)\n .replace('title', /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/)\n .getRegex();\nconst reflink = edit(/^!?\\[(label)\\]\\[(ref)\\]/)\n .replace('label', _inlineLabel)\n .replace('ref', _blockLabel)\n .getRegex();\nconst nolink = edit(/^!?\\[(ref)\\](?:\\[\\])?/)\n .replace('ref', _blockLabel)\n .getRegex();\nconst reflinkSearch = edit('reflink|nolink(?!\\\\()', 'g')\n .replace('reflink', reflink)\n .replace('nolink', nolink)\n .getRegex();\n/**\n * Normal Inline Grammar\n */\nconst inlineNormal = {\n _backpedal: noopTest, // only used for GFM url\n anyPunctuation,\n autolink,\n blockSkip,\n br,\n code: inlineCode,\n del: noopTest,\n emStrongLDelim,\n emStrongRDelimAst,\n emStrongRDelimUnd,\n escape,\n link,\n nolink,\n punctuation,\n reflink,\n reflinkSearch,\n tag,\n text: inlineText,\n url: noopTest\n};\n/**\n * Pedantic Inline Grammar\n */\nconst inlinePedantic = {\n ...inlineNormal,\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', _inlineLabel)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', _inlineLabel)\n .getRegex()\n};\n/**\n * GFM Inline Grammar\n */\nconst inlineGfm = {\n ...inlineNormal,\n escape: edit(escape).replace('])', '~|])').getRegex(),\n url: edit(/^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/, 'i')\n .replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/)\n .getRegex(),\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n};\n/**\n * GFM + Line Breaks Inline Grammar\n */\nconst inlineBreaks = {\n ...inlineGfm,\n br: edit(br).replace('{2,}', '*').getRegex(),\n text: edit(inlineGfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n/**\n * exports\n */\nconst block = {\n normal: blockNormal,\n gfm: blockGfm,\n pedantic: blockPedantic\n};\nconst inline = {\n normal: inlineNormal,\n gfm: inlineGfm,\n breaks: inlineBreaks,\n pedantic: inlinePedantic\n};\n\n/**\n * Block Lexer\n */\nclass _Lexer {\n tokens;\n options;\n state;\n tokenizer;\n inlineQueue;\n constructor(options) {\n // TokenList cannot be created in one go\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || _defaults;\n this.options.tokenizer = this.options.tokenizer || new _Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n }\n else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n }\n else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new _Lexer(options);\n return lexer.lex(src);\n }\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new _Lexer(options);\n return lexer.inlineTokens(src);\n }\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n this.blockTokens(src, this.tokens);\n for (let i = 0; i < this.inlineQueue.length; i++) {\n const next = this.inlineQueue[i];\n this.inlineTokens(next.src, next.tokens);\n }\n this.inlineQueue = [];\n return this.tokens;\n }\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n }\n else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n let token;\n let lastToken;\n let cutSrc;\n let lastParagraphClipped;\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unnecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n this.state.top = true;\n return tokens;\n }\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n // Mask out escaped characters\n while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);\n }\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // autolink\n if (token = this.tokenizer.autolink(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass _Renderer {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/^\\S*/)?.[0];\n code = code.replace(/\\n$/, '') + '\\n';\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n return '<pre><code class=\"language-'\n + escape$1(lang)\n + '\">'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n html(html, block) {\n return html;\n }\n heading(text, level, raw) {\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n hr() {\n return '<hr>\\n';\n }\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul';\n const startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n listitem(text, task, checked) {\n return `<li>${text}</li>\\n`;\n }\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\">';\n }\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n table(header, body) {\n if (body)\n body = `<tbody>${body}</tbody>`;\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n /**\n * span level renderer\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n em(text) {\n return `<em>${text}</em>`;\n }\n codespan(text) {\n return `<code>${text}</code>`;\n }\n br() {\n return '<br>';\n }\n del(text) {\n return `<del>${text}</del>`;\n }\n link(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n image(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += '>';\n return out;\n }\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass _TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n em(text) {\n return text;\n }\n codespan(text) {\n return text;\n }\n del(text) {\n return text;\n }\n html(text) {\n return text;\n }\n text(text) {\n return text;\n }\n link(href, title, text) {\n return '' + text;\n }\n image(href, title, text) {\n return '' + text;\n }\n br() {\n return '';\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass _Parser {\n options;\n renderer;\n textRenderer;\n constructor(options) {\n this.options = options || _defaults;\n this.options.renderer = this.options.renderer || new _Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new _TextRenderer();\n }\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new _Parser(options);\n return parser.parse(tokens);\n }\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new _Parser(options);\n return parser.parseInline(tokens);\n }\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const genericToken = token;\n const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(genericToken.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n const headingToken = token;\n out += this.renderer.heading(this.parseInline(headingToken.tokens), headingToken.depth, unescape(this.parseInline(headingToken.tokens, this.textRenderer)));\n continue;\n }\n case 'code': {\n const codeToken = token;\n out += this.renderer.code(codeToken.text, codeToken.lang, !!codeToken.escaped);\n continue;\n }\n case 'table': {\n const tableToken = token;\n let header = '';\n // header\n let cell = '';\n for (let j = 0; j < tableToken.header.length; j++) {\n cell += this.renderer.tablecell(this.parseInline(tableToken.header[j].tokens), { header: true, align: tableToken.align[j] });\n }\n header += this.renderer.tablerow(cell);\n let body = '';\n for (let j = 0; j < tableToken.rows.length; j++) {\n const row = tableToken.rows[j];\n cell = '';\n for (let k = 0; k < row.length; k++) {\n cell += this.renderer.tablecell(this.parseInline(row[k].tokens), { header: false, align: tableToken.align[k] });\n }\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n const blockquoteToken = token;\n const body = this.parse(blockquoteToken.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n const listToken = token;\n const ordered = listToken.ordered;\n const start = listToken.start;\n const loose = listToken.loose;\n let body = '';\n for (let j = 0; j < listToken.items.length; j++) {\n const item = listToken.items[j];\n const checked = item.checked;\n const task = item.task;\n let itemBody = '';\n if (item.task) {\n const checkbox = this.renderer.checkbox(!!checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n }\n else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox + ' '\n });\n }\n }\n else {\n itemBody += checkbox + ' ';\n }\n }\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, !!checked);\n }\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n const htmlToken = token;\n out += this.renderer.html(htmlToken.text, htmlToken.block);\n continue;\n }\n case 'paragraph': {\n const paragraphToken = token;\n out += this.renderer.paragraph(this.parseInline(paragraphToken.tokens));\n continue;\n }\n case 'text': {\n let textToken = token;\n let body = textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text;\n while (i + 1 < tokens.length && tokens[i + 1].type === 'text') {\n textToken = tokens[++i];\n body += '\\n' + (textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'escape': {\n const escapeToken = token;\n out += renderer.text(escapeToken.text);\n break;\n }\n case 'html': {\n const tagToken = token;\n out += renderer.html(tagToken.text);\n break;\n }\n case 'link': {\n const linkToken = token;\n out += renderer.link(linkToken.href, linkToken.title, this.parseInline(linkToken.tokens, renderer));\n break;\n }\n case 'image': {\n const imageToken = token;\n out += renderer.image(imageToken.href, imageToken.title, imageToken.text);\n break;\n }\n case 'strong': {\n const strongToken = token;\n out += renderer.strong(this.parseInline(strongToken.tokens, renderer));\n break;\n }\n case 'em': {\n const emToken = token;\n out += renderer.em(this.parseInline(emToken.tokens, renderer));\n break;\n }\n case 'codespan': {\n const codespanToken = token;\n out += renderer.codespan(codespanToken.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n const delToken = token;\n out += renderer.del(this.parseInline(delToken.tokens, renderer));\n break;\n }\n case 'text': {\n const textToken = token;\n out += renderer.text(textToken.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\nclass _Hooks {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess',\n 'processAllTokens'\n ]);\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n /**\n * Process all tokens before walk tokens\n */\n processAllTokens(tokens) {\n return tokens;\n }\n}\n\nclass Marked {\n defaults = _getDefaults();\n options = this.setOptions;\n parse = this.#parseMarkdown(_Lexer.lex, _Parser.parse);\n parseInline = this.#parseMarkdown(_Lexer.lexInline, _Parser.parseInline);\n Parser = _Parser;\n Renderer = _Renderer;\n TextRenderer = _TextRenderer;\n Lexer = _Lexer;\n Tokenizer = _Tokenizer;\n Hooks = _Hooks;\n constructor(...args) {\n this.use(...args);\n }\n /**\n * Run callback for every token\n */\n walkTokens(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(this, token));\n switch (token.type) {\n case 'table': {\n const tableToken = token;\n for (const cell of tableToken.header) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n for (const row of tableToken.rows) {\n for (const cell of row) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n const listToken = token;\n values = values.concat(this.walkTokens(listToken.items, callback));\n break;\n }\n default: {\n const genericToken = token;\n if (this.defaults.extensions?.childTokens?.[genericToken.type]) {\n this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {\n const tokens = genericToken[childTokens].flat(Infinity);\n values = values.concat(this.walkTokens(tokens, callback));\n });\n }\n else if (genericToken.tokens) {\n values = values.concat(this.walkTokens(genericToken.tokens, callback));\n }\n }\n }\n }\n return values;\n }\n use(...args) {\n const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n // set async to true if it was set to true before\n opts.async = this.defaults.async || opts.async || false;\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if ('renderer' in ext) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function (...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n }\n else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if ('tokenizer' in ext) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n const extLevel = extensions[ext.level];\n if (extLevel) {\n extLevel.unshift(ext.tokenizer);\n }\n else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n }\n else {\n extensions.startBlock = [ext.start];\n }\n }\n else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n }\n else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if ('childTokens' in ext && ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = this.defaults.renderer || new _Renderer(this.defaults);\n for (const prop in pack.renderer) {\n if (!(prop in renderer)) {\n throw new Error(`renderer '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const rendererProp = prop;\n const rendererFunc = pack.renderer[rendererProp];\n const prevRenderer = renderer[rendererProp];\n // Replace renderer with func to run extension, but fall back if false\n renderer[rendererProp] = (...args) => {\n let ret = rendererFunc.apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret || '';\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);\n for (const prop in pack.tokenizer) {\n if (!(prop in tokenizer)) {\n throw new Error(`tokenizer '${prop}' does not exist`);\n }\n if (['options', 'rules', 'lexer'].includes(prop)) {\n // ignore options, rules, and lexer properties\n continue;\n }\n const tokenizerProp = prop;\n const tokenizerFunc = pack.tokenizer[tokenizerProp];\n const prevTokenizer = tokenizer[tokenizerProp];\n // Replace tokenizer with func to run extension, but fall back if false\n // @ts-expect-error cannot type tokenizer function dynamically\n tokenizer[tokenizerProp] = (...args) => {\n let ret = tokenizerFunc.apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = this.defaults.hooks || new _Hooks();\n for (const prop in pack.hooks) {\n if (!(prop in hooks)) {\n throw new Error(`hook '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const hooksProp = prop;\n const hooksFunc = pack.hooks[hooksProp];\n const prevHook = hooks[hooksProp];\n if (_Hooks.passThroughHooks.has(prop)) {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (arg) => {\n if (this.defaults.async) {\n return Promise.resolve(hooksFunc.call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n const ret = hooksFunc.call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n }\n else {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (...args) => {\n let ret = hooksFunc.apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = this.defaults.walkTokens;\n const packWalktokens = pack.walkTokens;\n opts.walkTokens = function (token) {\n let values = [];\n values.push(packWalktokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n this.defaults = { ...this.defaults, ...opts };\n });\n return this;\n }\n setOptions(opt) {\n this.defaults = { ...this.defaults, ...opt };\n return this;\n }\n lexer(src, options) {\n return _Lexer.lex(src, options ?? this.defaults);\n }\n parser(tokens, options) {\n return _Parser.parse(tokens, options ?? this.defaults);\n }\n #parseMarkdown(lexer, parser) {\n return (src, options) => {\n const origOpt = { ...options };\n const opt = { ...this.defaults, ...origOpt };\n // Show warning if an extension set async to true but the parse was called with async: false\n if (this.defaults.async === true && origOpt.async === false) {\n if (!opt.silent) {\n console.warn('marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.');\n }\n opt.async = true;\n }\n const throwError = this.#onError(!!opt.silent, !!opt.async);\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens)\n .then(tokens => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n let tokens = lexer(src, opt);\n if (opt.hooks) {\n tokens = opt.hooks.processAllTokens(tokens);\n }\n if (opt.walkTokens) {\n this.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n }\n catch (e) {\n return throwError(e);\n }\n };\n }\n #onError(silent, async) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape$1(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n return msg;\n }\n if (async) {\n return Promise.reject(e);\n }\n throw e;\n };\n }\n}\n\nconst markedInstance = new Marked();\nfunction marked(src, opt) {\n return markedInstance.parse(src, opt);\n}\n/**\n * Sets the default options.\n *\n * @param options Hash of options\n */\nmarked.options =\n marked.setOptions = function (options) {\n markedInstance.setOptions(options);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n };\n/**\n * Gets the original marked default options.\n */\nmarked.getDefaults = _getDefaults;\nmarked.defaults = _defaults;\n/**\n * Use Extension\n */\nmarked.use = function (...args) {\n markedInstance.use(...args);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n};\n/**\n * Run callback for every token\n */\nmarked.walkTokens = function (tokens, callback) {\n return markedInstance.walkTokens(tokens, callback);\n};\n/**\n * Compiles markdown to HTML without enclosing `p` tag.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options\n * @return String of compiled HTML\n */\nmarked.parseInline = markedInstance.parseInline;\n/**\n * Expose\n */\nmarked.Parser = _Parser;\nmarked.parser = _Parser.parse;\nmarked.Renderer = _Renderer;\nmarked.TextRenderer = _TextRenderer;\nmarked.Lexer = _Lexer;\nmarked.lexer = _Lexer.lex;\nmarked.Tokenizer = _Tokenizer;\nmarked.Hooks = _Hooks;\nmarked.parse = marked;\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = _Parser.parse;\nconst lexer = _Lexer.lex;\n\nexport { _Hooks as Hooks, _Lexer as Lexer, Marked, _Parser as Parser, _Renderer as Renderer, _TextRenderer as TextRenderer, _Tokenizer as Tokenizer, _defaults as defaults, _getDefaults as getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n//# sourceMappingURL=marked.esm.js.map\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralize$1 = {exports: {}};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eĆ©]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t}); \n} (pluralize$1));\n\nvar pluralizeExports = pluralize$1.exports;\nvar pluralize = /*@__PURE__*/getDefaultExportFromCjs(pluralizeExports);\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"šŸ‘»\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint });\n console.error(e);\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up šŸ˜–\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message);\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return { message, name, plugin, hint, elements, title, details, stack };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Creates showError, showWarning utilities for use in custom pre-process and\n * post-process plugins.\n * @param {string} pluginName\n */\nexport function makePluginUtils(pluginName) {\n /** @typedef {Parameters<typeof showError>[2]} Options */\n return {\n /** @type {(message: string, options?: Options) => void} */\n showError: (msg, options) => showError(msg, pluginName, options),\n /** @type {(message: string, options?: Options) => void} */\n showWarning: (msg, options) => showWarning(msg, pluginName, options),\n };\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n\n/**\n * Takes a text string, trims it, splits it into lines,\n * finds the common indentation level, and then de-indents every line\n * by that common indentation level.\n *\n * @param {string} text - The text to be re-indented.\n * @returns {string} The re-indented text.\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n background: var(--bg, #fff);\n color: rgb(120, 120, 120);\n color: var(--tocnav-normal-text, rgb(120, 120, 120));\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n box-shadow: 1px 1px 8px 0 var(--tocsidebar-shadow, rgba(100, 100, 100, 0.5));\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: var(--bg, #fff);\n color: var(--text, black);\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: var(--def-text, white);\n background: var(--def-bg, rgb(42, 90, 168));\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: var(--def-text, white);\n background: var(--defrow-border, rgb(42, 90, 168));\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: var(--tocnav-active-bg, #193766);\n color: var(--tocnav-active-text, black);\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"āš ļø\";\n}\n\n.respec-error-list > li::before {\n content: \"šŸ’„\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: var(--bg, #fff);\n color: var(--text, black);\n border: 5px solid #666;\n border-color: var(--tocsidebar-shadow, #666);\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n left: 0 !important;\n text-align: center;\n background: var(--tocsidebar-shadow, #ddd);\n color: var(--text, black);\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: var(--bg, white);\n color: var(--text, black);\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: var(--tocnav-hover-bg, #eee);\n color: var(--tocnav-hover-text, black);\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/markedjs/marked\n *\n */\n\nimport { getElementIndentation, reindent } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\n\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\n\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super\n .code(code, language, isEscaped)\n .replace(`class=\"language-`, `class=\"`);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw);\n }\n}\n\n/** @type {import('marked').MarkedOptions} */\nconst config = {\n gfm: true,\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport { reindent, xmlEscape } from \"./utils.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n āŒ\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}ā€¦\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${xmlEscape(err.message)}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/w3c/group.js\"),\n import(\"../src/w3c/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/w3c/style.js\"),\n import(\"../src/core/github.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/title.js\"),\n import(\"../src/w3c/level.js\"),\n import(\"../src/w3c/headers.js\"),\n import(\"../src/w3c/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/w3c/conformance.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/tables.js\"),\n import(\"../src/core/webidl.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/xref.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/dfn-index.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/webidl-index.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/core/caniuse.js\"),\n import(\"../src/core/mdn-annotation.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/search-specref.js\"),\n import(\"../src/ui/search-xref.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/w3c/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/webidl-clipboard.js\"),\n import(\"../src/core/data-tests.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n import(\"../src/core/web-monetization.js\"),\n import(\"../src/core/dfn-contract.js\"),\n import(\"../src/core/before-save.js\"),\n /* Linters must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/check-internal-slots.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-captionless-tables.js\"),\n import(\"../src/core/linter-rules/no-unused-dfns.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/w3c/linter-rules/required-sections.js\"),\n import(\"../src/core/linter-rules/wpt-tests-exist.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n import(\"../src/core/linter-rules/a11y.js\"),\n import(\"../src/core/linter-rules/informative-dfn.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// As ReSpec injects a bunch of stuff async, the scroll position is not always\n// at the right place when we are done processing. The purpose of this module\n// is to reset window's location hash, which will cause the browser to scroll\n// the window to the correct point in the document when processing is done.\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!window.location.hash) {\n return;\n }\n\n // We have to use .then() here because otherwise we would get stuck\n // awaiting this plugin to finish.\n document.respec.ready.then(() => {\n const hash = decodeURIComponent(window.location.hash).slice(1);\n\n let newHash = hash;\n /** @type {HTMLElement|null} */\n const element = document.getElementById(newHash);\n\n // Check if hash contains any non-word character.\n const isLegacyFrag = /\\W/.test(newHash);\n\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/speced/respec/issues/1353\n if (!element && isLegacyFrag) {\n const id = newHash\n // Replace all non-word characters with a dash.\n .replace(/[\\W]+/gim, \"-\")\n // Remove any leading dashes.\n .replace(/^-+/, \"\")\n // Remove any trailing dashes.\n .replace(/-+$/, \"\");\n\n /** @type {HTMLElement|null} */\n const updatedElement = document.getElementById(id);\n if (updatedElement) {\n newHash = id;\n }\n }\n window.location.hash = `#${newHash}`;\n });\n}\n","// @ts-check\n/**\n * @module w3c/group\n * The purpose of this module is to fetch and set the working group configuration details.\n */\nimport { docLink, fetchAndCache, showError } from \"../core/utils.js\";\n\nexport const name = \"w3c/group\";\n\nconst W3C_GROUPS_API = \"https://respec.org/w3c/groups/\";\n\n/**\n * Fetches the group configuration details and adds them to the document's configuration.\n * @param {Conf} conf The document configuration object.\n * @return {Promise<void>} Resolves after setting the group configuration details.\n */\nexport async function run(conf) {\n if (!conf.group) {\n return;\n }\n\n const { group } = conf;\n const groupDetails = Array.isArray(group)\n ? await getMultipleGroupDetails(group)\n : await getGroupDetails(group);\n Object.assign(conf, groupDetails);\n}\n\n/**\n * Fetches configuration details for multiple groups concurrently.\n * @param {string[]} groups An array of group identifiers.\n * @return {Promise<object>} Resolves to an object containing the configuration details for each group.\n */\nasync function getMultipleGroupDetails(groups) {\n const details = await Promise.all(groups.map(getGroupDetails));\n /** @type {{ [key in keyof GroupDetails]: GroupDetails[key][] }} */\n const result = {\n wg: [],\n wgId: [],\n wgURI: [],\n wgPatentURI: [],\n wgPatentPolicy: [],\n groupType: [],\n };\n for (const groupDetails of details.filter(Boolean)) {\n for (const key of Object.keys(result)) {\n result[key].push(groupDetails[key]);\n }\n }\n return result;\n}\n\n/**\n * Fetches configuration details for a single group.\n * @param {string} group A group identifier.\n * @return {Promise<GroupDetails|undefined>} Resolves to an object containing the group's configuration details, or undefined if the group could not be fetched.\n */\nasync function getGroupDetails(group) {\n let type = \"\";\n let shortname = group;\n if (group.includes(\"/\")) {\n [type, shortname] = group.split(\"/\", 2);\n }\n const url = new URL(`${shortname}/${type}`, W3C_GROUPS_API);\n const res = await fetchAndCache(url.href);\n if (res.ok) {\n const json = await res.json();\n const {\n id: wgId,\n name: wg,\n patentURI: wgPatentURI,\n patentPolicy: wgPatentPolicy,\n type: groupType,\n wgURI,\n } = json;\n return { wg, wgId, wgURI, wgPatentURI, wgPatentPolicy, groupType };\n }\n\n const text = await res.text();\n let message = `Failed to fetch group details (HTTP: ${res.status}).`;\n let hint;\n if (res.status === 409) {\n [message, hint] = text.split(\"\\n\", 2);\n } else if (res.status === 404) {\n hint = docLink`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${\"[group]\"} configuration option.`;\n }\n showError(message, name, { hint });\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"core/templates/show-link\";\n\n/**\n * @param {object} link\n * @param {string} link.key\n * @param {string} [link.class]\n * @param {LinkData[]} [link.data]\n */\nexport default function showLink(link) {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n showWarning(msg, name);\n console.warn(msg, link);\n return;\n }\n return html`\n <dt class=\"${link.class ? link.class : null}\">${link.key}</dt>\n ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n `;\n}\n\n/**\n * @typedef {object} LinkData\n * @property {string} [LinkData.class]\n * @property {string} [LinkData.href]\n * @property {string} [LinkData.value]\n * @param {LinkData} data\n */\nfunction showLinkData(data) {\n return html`<dd class=\"${data.class ? data.class : null}\">\n ${data.href\n ? html`<a href=\"${data.href}\">${data.value || data.href}</a>`\n : data.value}\n </dd>`;\n}\n","// @ts-check\nimport { docLink, showError } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst name = \"core/templates/show-logo\";\n\n/**\n * Logo mapper. Takes a logo structure and converts it to HTML.\n *\n * @param {object} logo\n * @param {string} logo.src\n * @param {string} logo.url\n * @param {string} logo.alt\n * @param {string} [logo.id]\n * @param {number} [logo.width]\n * @param {number} [logo.height]\n * @param {number} index\n */\nexport default function showLogo(logo, index) {\n /** @type {HTMLAnchorElement} */\n const a = html`<a href=\"${logo.url || null}\" class=\"logo\"\n ><img\n alt=\"${logo.alt || null}\"\n crossorigin\n height=\"${logo.height || null}\"\n id=\"${logo.id || null}\"\n src=\"${logo.src || null}\"\n width=\"${logo.width || null}\"\n />\n </a>`;\n if (!logo.alt) {\n const src = logo.src ? `, with \\`src\\` ${logo.src}, ` : \"\";\n const msg = `Logo at index ${index}${src} is missing required \"\\`alt\\`\" property.`;\n const hint = docLink`Add the missing \"\\`alt\\`\" property describing the logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n if (!logo.src) {\n const msg = `Logo at index ${index} is missing \"\\`src\\`\" property.`;\n const hint = docLink`The \\`src\\` property is required on every logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n return a;\n}\n","// @ts-check\n\nconst name = \"core/templates/show-people\";\n\nimport {\n W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n until(date) {\n return html` Until ${date} `;\n },\n },\n es: {\n until(date) {\n return html` Hasta ${date} `;\n },\n },\n ko: {\n until(date) {\n return html` ${date} ģ“ģ „ `;\n },\n },\n ja: {\n until(date) {\n return html` ${date} 仄前 `;\n },\n },\n de: {\n until(date) {\n return html` bis ${date} `;\n },\n },\n zh: {\n until(date) {\n return html` ē›“到 ${date} `;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst orcidIcon = () =>\n html`<svg\n width=\"16\"\n height=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n >\n <style>\n .st1 {\n fill: #fff;\n }\n </style>\n <path\n d=\"M256 128c0 70.7-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0s128 57.3 128 128z\"\n fill=\"#a6ce39\"\n />\n <path\n class=\"st1\"\n d=\"M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z\"\n />\n </svg>`;\n\n/**\n * @param {Conf} conf\n * @param {\"editors\" | \"authors\" | \"formerEditors\"} propName - the name of the property of the people to render.\n */\nexport default function showPeople(conf, propName) {\n const people = conf[propName];\n if (!Array.isArray(people) || !people.length) return; // nothing to show...\n\n const validatePerson = personValidator(propName);\n return people.filter(validatePerson).map(personToHTML);\n}\n\n/**\n * @param {Person} person\n */\nfunction personToHTML(person) {\n // The following are treated as opt-in HTML by hyperHTML\n // we need to deprecate this!\n const personName = [person.name];\n const company = [person.company];\n const editorId = person.w3cid || null;\n const contents = [];\n if (person.mailto) {\n person.url = `mailto:${person.mailto}`;\n }\n if (person.url) {\n const url = new URL(person.url, document.location.href);\n const classList =\n url.protocol === \"mailto:\"\n ? \"ed_mailto u-email email p-name\"\n : \"u-url url p-name fn\";\n contents.push(\n html`<a class=\"${classList}\" href=\"${person.url}\">${personName}</a>`\n );\n } else {\n contents.push(html`<span class=\"p-name fn\">${personName}</span>`);\n }\n if (person.orcid) {\n contents.push(\n html`<a class=\"p-name orcid\" href=\"${person.orcid}\">${orcidIcon()}</a>`\n );\n }\n if (person.company) {\n const hCard = \"p-org org h-org\";\n const companyElem = person.companyURL\n ? html`<a class=\"${hCard}\" href=\"${person.companyURL}\">${company}</a>`\n : html`<span class=\"${hCard}\">${company}</span>`;\n contents.push(html` (${companyElem})`);\n }\n if (person.note) {\n contents.push(document.createTextNode(` (${person.note})`));\n }\n if (person.extras) {\n contents.push(...person.extras.map(extra => html`, ${renderExtra(extra)}`));\n }\n const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(retiredDate))}</time\n >`;\n contents.push(html` - ${l10n.until(time)} `);\n }\n const dd = html`<dd\n class=\"editor p-author h-card vcard\"\n data-editor-id=\"${editorId}\"\n >\n ${contents}\n </dd>`;\n return dd;\n}\n\nfunction renderExtra(extra) {\n const classVal = extra.class || null;\n const { name, href } = extra;\n return href\n ? html`<a href=\"${href}\" class=\"${classVal}\">${name}</a>`\n : html`<span class=\"${classVal}\">${name}</span>`;\n}\n\n/**\n *\n * @param {string} prop\n */\nfunction personValidator(prop) {\n /**\n * @param {Person} person\n * @param {Number} index\n */\n return function validatePerson(person, index) {\n const docsUrl = \"https://respec.org/docs/\";\n const seePersonHint = `See [person](${docsUrl}#person) configuration for available options.`;\n const preamble =\n `Error processing the [person object](${docsUrl}#person) ` +\n `at index ${index} of the \"[\\`${prop}\\`](${docsUrl}#${prop})\" configuration option.`;\n\n if (!person.name) {\n const msg = `${preamble} Missing required property \\`\"name\"\\`.`;\n showError(msg, name, { hint: seePersonHint });\n return false;\n }\n\n if (person.orcid) {\n const { orcid } = person;\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n\n if (orcidUrl.origin !== \"https://orcid.org\") {\n const msg = `${preamble} ORCID \"${person.orcid}\" at index ${index} is invalid.`;\n const hint = `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`;\n showError(msg, name, { hint });\n return false;\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n const msg = `${preamble} ORCID \"${orcidId}\" has wrong format.`;\n const hint = `ORCIDs have the format \"1234-1234-1234-1234.\"`;\n showError(msg, name, { hint });\n return false;\n }\n\n if (!checkOrcidChecksum(orcid)) {\n const msg = `${preamble} ORCID \"${orcid}\" failed checksum check.`;\n const hint = \"Please check that the ORCID is valid.\";\n showError(msg, name, { hint });\n return false;\n }\n\n // canonical form\n person.orcid = orcidUrl.href;\n }\n\n if (person.retiredDate && !isValidConfDate(person.retiredDate)) {\n const msg = `${preamble} The property \"\\`retiredDate\\`\" is not a valid date.`;\n showError(msg, name, {\n hint: `The expected format is YYYY-MM-DD. ${seePersonHint}`,\n });\n return false;\n }\n\n if (\n person.hasOwnProperty(\"extras\") &&\n !validateExtras(person.extras, seePersonHint, preamble)\n ) {\n return false;\n }\n\n if (person.url && person.mailto) {\n const msg = `${preamble} Has both \"url\" and \"mailto\" property.`;\n showWarning(msg, name, {\n hint: `Please choose either \"url\" or \"mailto\" (\"url\" is preferred). ${seePersonHint}`,\n });\n }\n\n if (person.companyURL && !person.company) {\n const msg = `${preamble} Has a \"\\`companyURL\\`\" property but no \"\\`company\\`\" property.`;\n showWarning(msg, name, {\n hint: `Please add a \"\\`company\\`\" property. ${seePersonHint}.`,\n });\n }\n return true;\n };\n}\n\n/**\n *\n * @param {PersonExtras[]} extras\n * @param {string} hint\n * @param {string} preamble\n */\nfunction validateExtras(extras, hint, preamble) {\n if (!Array.isArray(extras)) {\n showError(\n `${preamble}. A person's \"extras\" member must be an array.`,\n name,\n { hint }\n );\n return false;\n }\n return extras.every((extra, index) => {\n switch (true) {\n case typeof extra !== \"object\":\n showError(\n `${preamble}. Member \"extra\" at index ${index} is not an object.`,\n name,\n {\n hint,\n }\n );\n return false;\n case !extra.hasOwnProperty(\"name\"):\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} is missing required \"name\" member.`,\n name,\n { hint }\n );\n return false;\n case typeof extra.name === \"string\" && extra.name.trim() === \"\":\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} \"name\" can't be empty.`,\n name,\n { hint }\n );\n return false;\n }\n return true;\n });\n}\n\n/**\n * @param {string} orcid\n * @returns {boolean}\n */\nfunction checkOrcidChecksum(orcid) {\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcid[orcid.length - 1];\n const remainder = orcid\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n return lastDigit === lastDigitShould;\n}\n","// @ts-check\nimport { ISODate, W3CDate, getIntlData } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\nimport { sub } from \"../../core/pubsubhub.js\";\n\nconst localizationStrings = {\n en: {\n archives: \"archives\",\n author: \"Author:\",\n authors: \"Authors:\",\n commit_history: \"Commit history\",\n edited_in_place: \"edited in place\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n feedback: \"Feedback:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n history: \"History:\",\n implementation_report: \"Implementation report:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest published version:\",\n latest_recommendation: \"Latest Recommendation:\",\n message_topic: \"ā€¦ message topic ā€¦\",\n more_details_about_this_doc: \"More details about this document\",\n multiple_alternates(plural) {\n return `This document is also available in ${\n plural ? \"these non-normative formats\" : \"this non-normative format\"\n }:`;\n },\n prev_editor_draft: \"Previous editor's draft:\",\n prev_recommendation: \"Previous Recommendation:\",\n prev_version: \"Previous version:\",\n publication_history: \"Publication history\",\n test_suite: \"Test suite:\",\n this_version: \"This version:\",\n with_subject_line: \"with subject line\",\n your_topic_here: \"YOUR TOPIC HERE\",\n },\n ko: {\n author: \"ģ €ģž:\",\n authors: \"ģ €ģž:\",\n editor: \"ķŽøģ§‘ģž:\",\n editors: \"ķŽøģ§‘ģž:\",\n former_editor: \"ģ“ģ „ ķŽøģ§‘ģž:\",\n former_editors: \"ģ“ģ „ ķŽøģ§‘ģž:\",\n latest_editors_draft: \"ģµœģ‹  ķŽøģ§‘ ģ“ˆģ•ˆ:\",\n latest_published_version: \"ģµœģ‹  ė²„ģ „:\",\n this_version: \"ķ˜„ģž¬ ė²„ģ „:\",\n },\n zh: {\n author: \"ä½œč€…ļ¼š\",\n authors: \"ä½œč€…ļ¼š\",\n commit_history: \"Gitꏐäŗ¤åŽ†å²\",\n editor: \"ē¼–č¾‘ļ¼š\",\n editors: \"ē¼–č¾‘ļ¼š\",\n feedback: \"反馈ļ¼š\",\n former_editor: \"原ē¼–č¾‘ļ¼š\",\n former_editors: \"原ē¼–č¾‘ļ¼š\",\n history: \"历史ļ¼š\",\n implementation_report: \"实ēŽ°ęŠ„告ļ¼š\",\n latest_editors_draft: \"꜀ꖰē¼–č¾‘č‰ēØæļ¼š\",\n latest_published_version: \"ęœ€ę–°å‘åøƒē‰ˆęœ¬ļ¼š\",\n latest_recommendation: \"ęœ€ę–°å‘åøƒēš„ę­£å¼ęŽØčę ‡å‡†ļ¼š\",\n message_topic: \"ā€¦ 邮件äø»é¢˜ ā€¦\",\n prev_editor_draft: \"äøŠäø€ē‰ˆē¼–č¾‘č‰ēØæļ¼š\",\n prev_recommendation: \"äøŠäø€ē‰ˆę­£å¼ęŽØčę ‡å‡†ļ¼š\",\n prev_version: \"äøŠäø€ē‰ˆļ¼š\",\n test_suite: \"굋čƕ儗件ļ¼š\",\n this_version: \"ęœ¬ē‰ˆęœ¬ļ¼š\",\n },\n ja: {\n archives: \"ć‚¢ćƒ¼ć‚«ć‚¤ćƒ–\",\n author: \"著者ļ¼š\",\n authors: \"著者ļ¼š\",\n commit_history: \"ę›“ę–°å±„ę­“\",\n edited_in_place: \"ę”¹ē‰ˆćŖćę›“ę–°\",\n editor: \"ē·Ø者ļ¼š\",\n editors: \"ē·Ø者ļ¼š\",\n feedback: \"ćƒ•ć‚£ćƒ¼ćƒ‰ćƒćƒƒć‚Æ:\",\n former_editor: \"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š\",\n former_editors: \"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š\",\n history: \"å±„ę­“:\",\n implementation_report: \"å®Ÿč£…ćƒ¬ćƒćƒ¼ćƒˆļ¼š\",\n latest_editors_draft: \"ęœ€ę–°ć®ē·Ø集ē”Øč‰ę”ˆļ¼š\",\n latest_published_version: \"ęœ€ę–°ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š\",\n latest_recommendation: \"ęœ€ę–°ć®å‹§å‘Šē‰ˆ:\",\n message_topic: \"ā€¦ ćƒ”ćƒ¼ćƒ«ä»¶å ā€¦\",\n more_details_about_this_doc: \"恓恮ꖇę›øć«ć¤ć„ć¦ć®ć‚ˆć‚Šč©³ē“°\",\n prev_editor_draft: \"å‰å›žć®ē·Ø集ē”Øč‰ę”ˆ:\",\n prev_recommendation: \"å‰å›žć®å‹§å‘Šē‰ˆ:\",\n prev_version: \"å‰å›žć®ćƒćƒ¼ć‚øćƒ§ćƒ³:\",\n publication_history: \"公č”Øå±„ę­“\",\n test_suite: \"ćƒ†ć‚¹ćƒˆć‚¹ć‚¤ćƒ¼ćƒˆļ¼š\",\n this_version: \"ć“ć®ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š\",\n with_subject_line: \"ę¬”ć®ä»¶åć§\",\n },\n nl: {\n author: \"Auteur:\",\n authors: \"Auteurs:\",\n editor: \"Redacteur:\",\n editors: \"Redacteurs:\",\n latest_editors_draft: \"Laatste werkversie:\",\n latest_published_version: \"Laatst gepubliceerde versie:\",\n this_version: \"Deze versie:\",\n },\n es: {\n archives: \"archivos\",\n author: \"Autor:\",\n authors: \"Autores:\",\n commit_history: \"Historial de cambios\",\n edited_in_place: \"editado en lugar\",\n editor: \"Editor:\",\n editors: \"Editores:\",\n feedback: \"Comentarios:\",\n former_editor: \"Antiguo editor:\",\n former_editors: \"Antiguos editores:\",\n history: \"Historia:\",\n implementation_report: \"Informe de implementaciĆ³n:\",\n latest_editors_draft: \"ƚltima versiĆ³n del editor:\",\n latest_published_version: \"ƚltima versiĆ³n publicada:\",\n latest_recommendation: \"RecomendaciĆ³n mĆ”s reciente:\",\n message_topic: \"ā€¦ detalles de mensaje ā€¦\",\n more_details_about_this_doc: \"MĆ”s detalles sobre este documento:\",\n publication_history: \"Historial de publicaciĆ³n\",\n prev_editor_draft: \"ƚltima versiĆ³n del editor:\",\n prev_recommendation: \"ƚltima RecomendaciĆ³n:\",\n prev_version: \"ƚltima versiĆ³n:\",\n test_suite: \"Suite de pruebas:\",\n this_version: \"Esta versiĆ³n:\",\n with_subject_line: \"con lĆ­nea de asunto\",\n your_topic_here: \"TU SUJETO AQUƍ\",\n },\n de: {\n archives: \"Archiv\",\n author: \"Autor/in:\",\n authors: \"Autor/innen:\",\n commit_history: \"Commit-Historie\",\n edited_in_place: \"zuletzt geƤndert am\",\n editor: \"Redaktion:\",\n editors: \"Redaktion:\",\n feedback: \"Feedback:\",\n former_editor: \"FrĆ¼here Mitwirkende:\",\n former_editors: \"FrĆ¼here Mitwirkende:\",\n history: \"Verlauf:\",\n implementation_report: \"Umsetzungsbericht:\",\n latest_editors_draft: \"Letzter Entwurf:\",\n latest_published_version: \"Letzte publizierte Fassung:\",\n latest_recommendation: \"Aktuellste Empfehlung:\",\n more_details_about_this_doc: \"Mehr Informationen Ć¼ber dieses Dokument\",\n multiple_alternates(plural) {\n return `Dieses Dokument ist ebenfalls in ${\n plural\n ? \"diesen nicht-normativen Formaten verfĆ¼gbar\"\n : \"diesem nicht-normativen Format verfĆ¼gbar\"\n }:`;\n },\n prev_editor_draft: \"Vorheriger Entwurf:\",\n prev_recommendation: \"Vorherige Empfehlung:\",\n prev_version: \"Vorherige Version:\",\n publication_history: \"Verƶffentlichungsverlauf\",\n test_suite: \"Testumgebung:\",\n this_version: \"Diese Fassung:\",\n },\n};\nexport const l10n = getIntlData(localizationStrings);\n\nexport function getSpecSubTitleElem(conf) {\n let specSubTitleElem = document.querySelector(\"h2#subtitle\");\n\n if (specSubTitleElem && specSubTitleElem.parentElement) {\n specSubTitleElem.remove();\n conf.subtitle = specSubTitleElem.textContent.trim();\n } else if (conf.subtitle) {\n specSubTitleElem = document.createElement(\"h2\");\n specSubTitleElem.textContent = conf.subtitle;\n specSubTitleElem.id = \"subtitle\";\n }\n if (specSubTitleElem) {\n specSubTitleElem.classList.add(\"subtitle\");\n }\n return specSubTitleElem;\n}\n\nexport default (conf, options) => {\n /**\n * After export, we let fixup.js handle the <details>.\n */\n sub(\"beforesave\", doc => {\n const details = doc.querySelector(\".head details\");\n if (details) details.open = true;\n });\n return html`<div class=\"head\">\n ${conf.logos.length\n ? html`<p class=\"logos\">${conf.logos.map(showLogo)}</p>`\n : \"\"}\n ${document.querySelector(\"h1#title\")} ${getSpecSubTitleElem(conf)}\n <p id=\"w3c-state\">${renderSpecTitle(conf)}</p>\n <details open=\"${localStorage.getItem(\"tr-metadata\") || \"true\"}\">\n <summary>${l10n.more_details_about_this_doc}</summary>\n <dl>\n ${conf.thisVersion\n ? html`<dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>`\n : \"\"}\n ${\"latestVersion\" in conf // latestVersion can be falsy\n ? html`<dt>${l10n.latest_published_version}</dt>\n <dd>\n ${conf.latestVersion\n ? html`<a href=\"${conf.latestVersion}\"\n >${conf.latestVersion}</a\n >`\n : \"none\"}\n </dd>`\n : \"\"}\n ${conf.edDraftURI\n ? html`\n <dt>${l10n.latest_editors_draft}</dt>\n <dd><a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a></dd>\n `\n : \"\"}\n ${conf.historyURI || conf.github\n ? html`<dt>${l10n.history}</dt>\n ${conf.historyURI\n ? html`<dd>\n <a href=\"${conf.historyURI}\">${conf.historyURI}</a>\n </dd>`\n : \"\"}\n ${conf.github\n ? html`<dd>\n <a href=\"${conf.github.commitHistoryURL}\"\n >${l10n.commit_history}</a\n >\n </dd>`\n : \"\"}`\n : \"\"}\n ${conf.testSuiteURI\n ? html`\n <dt>${l10n.test_suite}</dt>\n <dd><a href=\"${conf.testSuiteURI}\">${conf.testSuiteURI}</a></dd>\n `\n : \"\"}\n ${conf.implementationReportURI\n ? html`\n <dt>${l10n.implementation_report}</dt>\n <dd>\n <a href=\"${conf.implementationReportURI}\"\n >${conf.implementationReportURI}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.prevED\n ? html`\n <dt>${l10n.prev_editor_draft}</dt>\n <dd><a href=\"${conf.prevED}\">${conf.prevED}</a></dd>\n `\n : \"\"}\n ${conf.showPreviousVersion\n ? html`\n <dt>${l10n.prev_version}</dt>\n <dd><a href=\"${conf.prevVersion}\">${conf.prevVersion}</a></dd>\n `\n : \"\"}\n ${!conf.prevRecURI\n ? \"\"\n : conf.isRec\n ? html`\n <dt>${l10n.prev_recommendation}</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `\n : html`\n <dt>${l10n.latest_recommendation}</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `}\n ${conf.editors.length\n ? html`\n <dt>${conf.editors.length > 1 ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n `\n : \"\"}\n ${conf.formerEditors.length\n ? html`\n <dt>\n ${conf.formerEditors.length > 1\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors.length\n ? html`\n <dt>${conf.authors.length > 1 ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.github || conf.wgPublicList\n ? html`<dt>${l10n.feedback}</dt>\n ${renderFeedback(conf)}`\n : \"\"}\n ${conf.errata\n ? html`<dt>Errata:</dt>\n <dd><a href=\"${conf.errata}\">Errata exists</a>.</dd>`\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n </details>\n ${conf.isRec\n ? html`<p>\n See also\n <a\n href=\"${`https://www.w3.org/Translations/?technology=${conf.shortName}`}\"\n >\n <strong>translations</strong></a\n >.\n </p>`\n : \"\"}\n ${conf.alternateFormats\n ? html`<p>\n ${l10n.multiple_alternates(options.multipleAlternates)}\n ${options.alternatesHTML}\n </p>`\n : \"\"}\n ${renderCopyright(conf)}\n <hr title=\"Separator for header\" />\n </div>`;\n};\n\nexport function renderFeedback(conf) {\n const definitions = [];\n // Github feedback...\n if (conf.github) {\n const { repoURL, issuesURL, newIssuesURL, pullsURL, fullName } =\n conf.github;\n definitions.push(\n html`<dd>\n <a href=\"${repoURL}\">GitHub ${fullName}</a>\n (<a href=\"${pullsURL}\">pull requests</a>,\n <a href=\"${newIssuesURL}\">new issue</a>,\n <a href=\"${issuesURL}\">open issues</a>)\n </dd>`\n );\n }\n\n // The <a href=\"mailto:list?subject\"> link for the public list\n if (conf.wgPublicList) {\n const mailToURL = new URL(`mailto:${conf.wgPublicList}@w3.org`);\n const subject =\n conf.subjectPrefix ?? `[${conf.shortName}] ${l10n.your_topic_here}`;\n const mailingListLink = html`<a\n href=\"${mailToURL.href}?subject=${encodeURIComponent(subject)}\"\n >${mailToURL.pathname}</a\n >`;\n\n // The subject line...\n const subjectLine =\n conf.subjectPrefix ||\n html`[${conf.shortName}] <em>${l10n.message_topic}</em>`;\n const emailSubject = html`${l10n.with_subject_line}${\" \"}\n <kbd>${subjectLine}</kbd>`;\n\n // Archives link\n const archiveURL = new URL(\n conf.wgPublicList,\n \"https://lists.w3.org/Archives/Public/\"\n );\n const archiveLink = html`(<a href=\"${archiveURL}\" rel=\"discussion\"\n >${l10n.archives}</a\n >)`;\n\n definitions.push(\n html`<dd>${mailingListLink} ${emailSubject} ${archiveLink}</dd>`\n );\n }\n return definitions;\n}\n\nfunction renderSpecTitle(conf) {\n const specType = conf.isCR || conf.isCRY ? conf.longStatus : conf.textStatus;\n const preamble = conf.prependW3C\n ? html`<a href=\"https://www.w3.org/standards/types#${conf.specStatus}\"\n >W3C ${specType}</a\n >`\n : html`${specType}`;\n return html`${preamble}${\" \"}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${W3CDate.format(conf.publishDate)}</time\n >${conf.modificationDate\n ? html`, ${l10n.edited_in_place}${\" \"}\n <time\n class=\"dt-modified\"\n datetime=\"${ISODate.format(conf.modificationDate)}\"\n >${W3CDate.format(conf.modificationDate)}</time\n >`\n : \"\"}`;\n}\n\n/**\n * @param { LicenseInfo } licenseInfo license information\n */\nfunction linkLicense(licenseInfo) {\n const { url, short, name } = licenseInfo;\n if (name === \"unlicensed\") {\n return html`. <span class=\"issue\">THIS DOCUMENT IS UNLICENSED</span>.`;\n }\n return html` and\n <a rel=\"license\" href=\"${url}\" title=\"${name}\">${short}</a> rules apply.`;\n}\n\nfunction renderCopyright(conf) {\n // If there is already a copyright, let's relocate it.\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n return existingCopyright;\n }\n if (conf.isUnofficial && conf.licenseInfo) {\n return html`<p class=\"copyright\">\n Copyright ©\n ${conf.copyrightStart ? `${conf.copyrightStart}-` : \"\"}${conf.publishYear}\n the document editors/authors.\n ${conf.licenseInfo.name !== \"unlicensed\"\n ? html`Text is available under the\n <a rel=\"license\" href=\"${conf.licenseInfo.url}\"\n >${conf.licenseInfo.name}</a\n >; additional terms may apply.`\n : \"\"}\n </p>`;\n }\n return renderOfficialCopyright(conf);\n}\n\nfunction renderOfficialCopyright(conf) {\n return html`<p class=\"copyright\">\n <a href=\"https://www.w3.org/policies/#copyright\">Copyright</a>\n ©\n ${conf.copyrightStart ? `${conf.copyrightStart}-` : \"\"}${conf.publishYear}\n ${conf.additionalCopyrightHolders\n ? html` ${[conf.additionalCopyrightHolders]} & `\n : \"\"}\n <a href=\"https://www.w3.org/\">World Wide Web Consortium</a>.\n <abbr title=\"World Wide Web Consortium\">W3C</abbr><sup>®</sup>\n <a href=\"https://www.w3.org/policies/#Legal_Disclaimer\">liability</a>,\n <a href=\"https://www.w3.org/policies/#W3C_Trademarks\">trademark</a\n >${linkLicense(conf.licenseInfo)}\n </p>`;\n}\n","// @ts-check\nimport { getSpecSubTitleElem, l10n, renderFeedback } from \"./headers.js\";\nimport { W3CDate } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nexport default (conf, options) => {\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n }\n\n const specTitleElem = document.querySelector(\"h1#title\");\n const specTitleElemClone = specTitleElem.cloneNode(true);\n\n return html`<div class=\"head\">\n ${conf.logos.length\n ? html`<p class=\"logos\">${conf.logos.map(showLogo)}</p>`\n : \"\"}\n ${specTitleElem} ${getSpecSubTitleElem(conf)}\n <p id=\"w3c-state\">\n <a href=\"https://www.w3.org/standards/types#reports\"\n >${conf.longStatus}</a\n >\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${W3CDate.format(conf.publishDate)}</time\n >\n </p>\n <dl>\n ${conf.thisVersion\n ? html`<dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>`\n : \"\"}\n ${\"latestVersion\" in conf // latestVersion can be falsy\n ? html`<dt>${l10n.latest_published_version}</dt>\n <dd>\n ${conf.latestVersion\n ? html`<a href=\"${conf.latestVersion}\"\n >${conf.latestVersion}</a\n >`\n : \"none\"}\n </dd>`\n : \"\"}\n ${conf.edDraftURI\n ? html`\n <dt>${l10n.latest_editors_draft}</dt>\n <dd><a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a></dd>\n `\n : \"\"}\n ${conf.testSuiteURI\n ? html`\n <dt>Test suite:</dt>\n <dd><a href=\"${conf.testSuiteURI}\">${conf.testSuiteURI}</a></dd>\n `\n : \"\"}\n ${conf.implementationReportURI\n ? html`\n <dt>Implementation report:</dt>\n <dd>\n <a href=\"${conf.implementationReportURI}\"\n >${conf.implementationReportURI}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.prevVersion\n ? html`\n <dt>Previous version:</dt>\n <dd><a href=\"${conf.prevVersion}\">${conf.prevVersion}</a></dd>\n `\n : \"\"}\n ${!conf.isCGFinal\n ? html`\n ${conf.prevED\n ? html`\n <dt>Previous editor's draft:</dt>\n <dd><a href=\"${conf.prevED}\">${conf.prevED}</a></dd>\n `\n : \"\"}\n `\n : \"\"}\n ${conf.editors.length\n ? html`\n <dt>${conf.editors.length > 1 ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n `\n : \"\"}\n ${conf.formerEditors.length\n ? html`\n <dt>\n ${conf.formerEditors.length > 1\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors.length\n ? html`\n <dt>${conf.authors.length > 1 ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.github || conf.wgPublicList\n ? html`<dt>${l10n.feedback}</dt>\n ${renderFeedback(conf)}`\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${conf.alternateFormats\n ? html`<p>\n ${options.multipleAlternates\n ? \"This document is also available in these non-normative formats:\"\n : \"This document is also available in this non-normative format:\"}\n ${options.alternatesHTML}\n </p>`\n : \"\"}\n ${existingCopyright\n ? existingCopyright\n : html`<p class=\"copyright\">\n <a href=\"https://www.w3.org/policies/#copyright\">Copyright</a>\n ©\n ${conf.copyrightStart\n ? `${conf.copyrightStart}-`\n : \"\"}${conf.publishYear}\n ${conf.additionalCopyrightHolders\n ? html` ${[conf.additionalCopyrightHolders]} & `\n : \"\"}\n the Contributors to the ${specTitleElemClone.childNodes}\n Specification, published by the\n <a href=\"${conf.wgURI}\">${conf.wg}</a> under the\n ${conf.isCGFinal\n ? html`\n <a href=\"https://www.w3.org/community/about/agreements/fsa/\"\n >W3C Community Final Specification Agreement (FSA)</a\n >. A human-readable\n <a\n href=\"https://www.w3.org/community/about/agreements/fsa-deed/\"\n >summary</a\n >\n is available.\n `\n : html`\n <a href=\"https://www.w3.org/community/about/agreements/cla/\"\n >W3C Community Contributor License Agreement (CLA)</a\n >. A human-readable\n <a\n href=\"https://www.w3.org/community/about/agreements/cla-deed/\"\n >summary</a\n >\n is available.\n `}\n </p>`}\n <hr title=\"Separator for header\" />\n </div>`;\n};\n","// @ts-check\nimport { W3CDate, getIntlData, htmlJoinAnd } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport { status2track } from \"../headers.js\";\nconst localizationStrings = {\n en: {\n sotd: \"Status of This Document\",\n status_at_publication: html`This section describes the status of this\n document at the time of its publication. A list of current W3C\n publications and the latest revision of this technical report can be found\n in the <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> at\n https://www.w3.org/TR/.`,\n },\n ko: {\n sotd: \"ķ˜„ģž¬ ė¬øģ„œģ˜ ģƒķƒœ\",\n status_at_publication: html`ģ“ ė¶€ė¶„ģ€ ķ˜„ģž¬ ė¬øģ„œģ˜ ė°œķ–‰ ė‹¹ģ‹œ ģƒķƒœģ— ėŒ€ķ•“\n źø°ģˆ ķ•©ė‹ˆė‹¤. W3C ė°œķ–‰ ė¬øģ„œģ˜ ģµœģ‹  ėŖ©ė” ė° ķ…Œķ¬ė‹ˆģ»¬ ė¦¬ķ¬ķŠø ģµœģ‹ ķŒģ„\n https://www.w3.org/TR/ ģ˜\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> ģ—ģ„œ\n ģ—“ėžŒķ•  ģˆ˜ ģžˆģŠµė‹ˆė‹¤.`,\n },\n zh: {\n sotd: \"关äŗŽęœ¬ę–‡ę”£\",\n // eslint-disable-next-line prettier/prettier\n status_at_publication: html`ęœ¬ē« čŠ‚ꏏčæ°äŗ†ęœ¬ę–‡ę”£ēš„发åøƒēŠ¶ę€ć€‚W3Cēš„ę–‡ę”£åˆ—č”Øå’Œęœ€ę–°ē‰ˆęœ¬åÆ通čæ‡<a\n href=\"https://www.w3.org/TR/\"\n >W3CꊀęœÆęŠ„å‘Š</a\n >ē“¢å¼•č®æ问怂`,\n },\n ja: {\n sotd: \"恓恮ꖇę›øć®ä½ē½®ä»˜ć‘\",\n status_at_publication: html`恓恮ēÆ€ć«ćÆć€å…¬é–‹ę™‚ē‚¹ć§ć®ć“恮ꖇę›øć®ä½ē½®ć„恑恌čØ˜ć•ć‚Œć¦ć„ć‚‹ć€‚ē¾ę™‚ē‚¹ć§ć®W3C恮ē™ŗč”Œę–‡ę›øćØć“ć®ćƒ†ć‚Æćƒ‹ć‚«ćƒ«ćƒ¬ćƒćƒ¼ćƒˆć®ęœ€ę–°ē‰ˆćÆ态äø‹čØ˜ć‹ć‚‰å‚ē…§ć§ćć‚‹ć€‚\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a>\n (https://www.w3.org/TR/)`,\n },\n nl: {\n sotd: \"Status van dit document\",\n },\n es: {\n sotd: \"Estado de este Document\",\n status_at_publication: html`Esta secciĆ³n describe el estado del presente\n documento al momento de su publicaciĆ³n. Una lista de las publicaciones\n actuales del W3C y la Ćŗltima revisiĆ³n del presente informe tĆ©cnico puede\n hallarse en http://www.w3.org/TR/\n <a href=\"https://www.w3.org/TR/\">el Ć­ndice de informes tĆ©cnicos</a> del\n W3C.`,\n },\n de: {\n sotd: \"Status dieses Dokuments\",\n status_at_publication: html`Dieser Abschnitt beschreibt den Status des\n Dokuments zum Zeitpunkt der Publikation. Eine Liste der aktuellen\n Publikatinen des W3C und die aktuellste Fassung dieser Spezifikation kann\n im <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> unter\n https://www.w3.org/TR/ abgerufen werden.`,\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nconst processLink = \"https://www.w3.org/policies/process/20231103/\";\n\nfunction prefix(word) {\n return /^[aeiou]/i.test(word) ? `an ${word}` : `a ${word}`;\n}\n\nexport default (conf, opts) => {\n return html`\n <h2>${l10n.sotd}</h2>\n ${conf.isPreview ? renderPreview(conf) : \"\"}\n ${conf.isUnofficial\n ? renderIsUnofficial(opts)\n : conf.isTagFinding\n ? opts.additionalContent\n : conf.isNoTrack\n ? renderIsNoTrack(conf, opts)\n : html`\n <p><em>${l10n.status_at_publication}</em></p>\n ${conf.isMemberSubmission\n ? noteForSubmission(conf, opts)\n : html`\n ${!conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${!conf.overrideStatus\n ? html` ${linkToWorkingGroup(conf)} `\n : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${conf.isRec ? renderIsRec(conf) : renderNotRec(conf)}\n ${renderDeliverer(conf)}\n <p>\n This document is governed by the\n <a id=\"w3c_process_revision\" href=\"${processLink}\"\n >03 November 2023 W3C Process Document</a\n >.\n </p>\n `}\n `}\n ${opts.additionalSections}\n `;\n};\n\nexport function renderPreview(conf) {\n const { prUrl, prNumber, edDraftURI } = conf;\n return html`<details class=\"annoying-warning\" open=\"\">\n <summary>\n This is a\n preview${prUrl && prNumber\n ? html`\n of pull request\n <a href=\"${prUrl}\">#${prNumber}</a>\n `\n : \"\"}\n </summary>\n <p>\n Do not attempt to implement this version of the specification. Do not\n reference this version as authoritative in any way.\n ${edDraftURI\n ? html`\n Instead, see\n <a href=\"${edDraftURI}\">${edDraftURI}</a> for the Editor's draft.\n `\n : \"\"}\n </p>\n </details>`;\n}\n\nfunction renderIsUnofficial(opts) {\n const { additionalContent } = opts;\n return html`\n <p>\n This document is a draft of a potential specification. It has no official\n standing of any kind and does not represent the support or consensus of\n any standards organization.\n </p>\n ${additionalContent}\n `;\n}\n\nfunction renderIsNoTrack(conf, opts) {\n const { isMO } = conf;\n const { additionalContent } = opts;\n return html`\n <p>\n This document is merely a W3C-internal\n ${isMO ? \"member-confidential\" : \"\"} document. It has no official standing\n of any kind and does not represent consensus of the W3C Membership.\n </p>\n ${additionalContent}\n `;\n}\n\nfunction renderNotRec(conf) {\n const updatableRec = document.querySelector(\"#sotd.updateable-rec\");\n let statusExplanation = null;\n let reviewPolicy = null;\n let endorsement = html`Publication as ${prefix(conf.textStatus)} does not\n imply endorsement by W3C and its Members.`;\n let updatePolicy = html`<p>\n This is a draft document and may be updated, replaced or obsoleted by other\n documents at any time. It is inappropriate to cite this document as other\n than work in progress.\n ${updatableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}\n </p>`;\n if (conf.specStatus === \"DISC\") {\n updatePolicy = html`<p>\n Publication as a Discontinued Draft implies that this document is no\n longer intended to advance or to be maintained. It is inappropriate to\n cite this document as other than abandoned work.\n </p>`;\n }\n const lsUpdatePolicy = html`<p>\n This document is maintained and updated at any time. Some parts of this\n document are work in progress.\n </p>`;\n switch (conf.specStatus) {\n case \"STMT\":\n endorsement = html`<p>\n A W3C Statement is a specification that, after extensive\n consensus-building, has received the endorsement of the\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members.\n </p>`;\n break;\n case \"RY\":\n endorsement = html`<p>W3C recommends the wide usage of this registry.</p>\n <p>\n A W3C Registry is a specification that, after extensive\n consensus-building, has received the endorsement of the\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members.\n </p>`;\n break;\n case \"CRD\":\n statusExplanation = html`A Candidate Recommendation Draft integrates\n changes from the previous Candidate Recommendation that the Working Group\n intends to include in a subsequent Candidate Recommendation Snapshot.`;\n if (conf.pubMode === \"LS\") {\n updatePolicy = lsUpdatePolicy;\n }\n break;\n case \"CRYD\":\n statusExplanation = html`A Candidate Registry Draft integrates changes\n from the previous Candidate Registry Snapshot that the Working Group\n intends to include in a subsequent Candidate Registry Snapshot.`;\n if (conf.pubMode === \"LS\") {\n updatePolicy = lsUpdatePolicy;\n }\n break;\n case \"CRY\":\n statusExplanation = html`A Candidate Registry Snapshot has received\n <a href=\"${processLink}#dfn-wide-review\">wide review</a>.`;\n reviewPolicy = html`<p>\n The W3C Membership and other interested parties are invited to review\n the document and send comments through ${conf.humanPREnd}. Advisory\n Committee Representatives should consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >. Note that substantive technical comments were expected during the\n Candidate Recommendation review period that ended ${conf.humanCREnd}.\n </p>`;\n break;\n case \"CR\":\n statusExplanation = html`A Candidate Recommendation Snapshot has received\n <a href=\"${processLink}#dfn-wide-review\">wide review</a>, is intended to\n gather\n <a href=\"${conf.implementationReportURI}\">implementation experience</a>,\n and has commitments from Working Group members to\n <a href=\"https://www.w3.org/policies/patent-policy/#sec-Requirements\"\n >royalty-free licensing</a\n >\n for implementations.`;\n updatePolicy = html`${updatableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}`;\n if (conf.pubMode === \"LS\") {\n reviewPolicy = html`<p>\n Comments are welcome at any time but most especially before\n ${W3CDate.format(conf.crEnd)}.\n </p>`;\n } else {\n reviewPolicy = html`<p>\n This Candidate Recommendation is not expected to advance to Proposed\n Recommendation any earlier than ${W3CDate.format(conf.crEnd)}.\n </p>`;\n }\n break;\n case \"PR\":\n reviewPolicy = html`<p>\n The W3C Membership and other interested parties are invited to review\n the document and send comments through ${W3CDate.format(conf.prEnd)}.\n Advisory Committee Representatives should consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >. Note that substantive technical comments were expected during the\n Candidate Recommendation review period that ended\n ${W3CDate.format(conf.crEnd)}.\n </p>`;\n break;\n case \"DNOTE\":\n endorsement = html`${conf.textStatus}s are not endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> nor its Members.`;\n break;\n case \"NOTE\":\n endorsement = html`This ${conf.textStatus} is endorsed by\n ${getWgHTML(conf)}, but is not endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> itself nor its\n Members.`;\n break;\n }\n return html`<p>${endorsement} ${statusExplanation}</p>\n ${updatePolicy} ${reviewPolicy}`;\n}\n\nfunction renderIsRec(conf) {\n const { revisedRecEnd } = conf;\n const updatableRec = document.querySelector(\"#sotd.updateable-rec\");\n let reviewTarget = \"\";\n if (document.querySelector(\".proposed-addition\")) {\n reviewTarget = \"additions\";\n } else if (document.querySelector(\".proposed-correction\")) {\n reviewTarget = \"corrections\";\n }\n return html`\n <p>\n W3C recommends the wide deployment of this specification as a standard for\n the Web.\n </p>\n\n <p>\n A W3C Recommendation is a specification that, after extensive\n consensus-building, is endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members, and\n has commitments from Working Group members to\n <a href=\"https://www.w3.org/policies/patent-policy/#sec-Requirements\"\n >royalty-free licensing</a\n >\n for implementations.\n ${updatableRec\n ? html`Future updates to this Recommendation may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}\n </p>\n ${document.querySelector(\".addition\")\n ? html`<p class=\"addition\">\n Candidate additions are marked in the document.\n </p>`\n : \"\"}\n ${document.querySelector(\".correction\")\n ? html`<p class=\"correction\">\n Candidate corrections are marked in the document.\n </p>`\n : \"\"}\n ${document.querySelector(\".proposed-addition\")\n ? html`<p class=\"addition proposed\">\n Proposed additions are marked in the document.\n </p>`\n : \"\"}\n ${document.querySelector(\".proposed-correction\")\n ? html`<p class=\"correction proposed\">\n Proposed corrections are marked in the document.\n </p>`\n : \"\"}\n ${reviewTarget\n ? html`<p>\n The W3C Membership and other interested parties are invited to review\n the proposed ${reviewTarget} and send comments through\n ${W3CDate.format(revisedRecEnd)}. Advisory Committee Representatives\n should consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >.\n </p>`\n : \"\"}\n `;\n}\n\nfunction renderDeliverer(conf) {\n const {\n isNote,\n isRegistry,\n wgId,\n multipleWGs,\n wgPatentHTML,\n wgPatentURI,\n wgPatentPolicy,\n } = conf;\n\n const patentPolicyURL =\n wgPatentPolicy === \"PP2017\"\n ? \"https://www.w3.org/Consortium/Patent-Policy-20170801/\"\n : \"https://www.w3.org/policies/patent-policy/\";\n\n const producers = !(isNote || isRegistry)\n ? html`\n This document was produced by ${multipleWGs ? \"groups\" : \"a group\"}\n operating under the\n <a href=\"${patentPolicyURL}\"\n >${wgPatentPolicy === \"PP2017\" ? \"1 August 2017 \" : \"\"}W3C Patent\n Policy</a\n >.\n `\n : html`\n The\n <a href=\"${patentPolicyURL}\"\n >${wgPatentPolicy === \"PP2017\" ? \"1 August 2017 \" : \"\"}W3C Patent\n Policy</a\n >\n does not carry any licensing requirements or commitments on this\n document.\n `;\n return html`<p data-deliverer=\"${isNote || isRegistry ? wgId : null}\">\n ${producers}\n ${!(isNote || isRegistry)\n ? html`\n ${multipleWGs\n ? html` W3C maintains ${wgPatentHTML} `\n : html`\n W3C maintains a\n <a href=\"${[wgPatentURI]}\" rel=\"disclosure\"\n >public list of any patent disclosures</a\n >\n `}\n made in connection with the deliverables of\n ${multipleWGs\n ? \"each group; these pages also include\"\n : \"the group; that page also includes\"}\n instructions for disclosing a patent. An individual who has actual\n knowledge of a patent which the individual believes contains\n <a href=\"${patentPolicyURL}#def-essential\">Essential Claim(s)</a>\n must disclose the information in accordance with\n <a href=\"${patentPolicyURL}#sec-Disclosure\"\n >section 6 of the W3C Patent Policy</a\n >.\n `\n : \"\"}\n </p>`;\n}\n\nfunction noteForSubmission(conf, opts) {\n return html`\n ${opts.additionalContent}\n ${conf.isMemberSubmission ? noteForMemberSubmission(conf) : \"\"}\n `;\n}\n\nfunction noteForMemberSubmission(conf) {\n const teamComment = `https://www.w3.org/Submission/${conf.publishDate.getUTCFullYear()}/${\n conf.submissionCommentNumber\n }/Comment/`;\n\n const patentPolicyURL =\n conf.wgPatentPolicy === \"PP2017\"\n ? \"https://www.w3.org/Consortium/Patent-Policy-20170801/\"\n : \"https://www.w3.org/policies/patent-policy/\";\n\n return html`<p>\n By publishing this document, W3C acknowledges that the\n <a href=\"${conf.thisVersion}\">Submitting Members</a> have made a formal\n Submission request to W3C for discussion. Publication of this document by\n W3C indicates no endorsement of its content by W3C, nor that W3C has, is, or\n will be allocating any resources to the issues addressed by it. This\n document is not the product of a chartered W3C group, but is published as\n potential input to the\n <a href=\"https://www.w3.org/policies/process/\">W3C Process</a>. A\n <a href=\"${teamComment}\">W3C Team Comment</a> has been published in\n conjunction with this Member Submission. Publication of acknowledged Member\n Submissions at the W3C site is one of the benefits of\n <a href=\"https://www.w3.org/Consortium/Prospectus/Joining\">\n W3C Membership</a\n >. Please consult the requirements associated with Member Submissions of\n <a href=\"${patentPolicyURL}#sec-submissions\"\n >section 3.3 of the W3C Patent Policy</a\n >. Please consult the complete\n <a href=\"https://www.w3.org/Submission\"\n >list of acknowledged W3C Member Submissions</a\n >.\n </p>`;\n}\n\nexport function renderPublicList(conf, opts) {\n const { mailToWGPublicListWithSubject, mailToWGPublicListSubscription } =\n opts;\n const { wgPublicList, subjectPrefix } = conf;\n const archivesURL = `https://lists.w3.org/Archives/Public/${wgPublicList}/`;\n return html`<p>\n If you wish to make comments regarding this document, please send them to\n <a href=\"${mailToWGPublicListWithSubject}\">${wgPublicList}@w3.org</a>\n (<a href=\"${mailToWGPublicListSubscription}\">subscribe</a>,\n <a href=\"${archivesURL}\">archives</a>)${subjectPrefix\n ? html` with <code>${subjectPrefix}</code> at the start of your email's\n subject`\n : \"\"}.\n </p>`;\n}\n\nfunction linkToWorkingGroup(conf) {\n if (!conf.wg) {\n return;\n }\n let changes = null;\n const proposedAdditions = document.querySelector(\".proposed-addition\");\n const proposedCorrections = document.querySelector(\".proposed-correction\");\n const additions = document.querySelector(\".addition\");\n const corrections = document.querySelector(\".correction\");\n const hasRevisions =\n proposedAdditions || proposedCorrections || additions || corrections;\n if (conf.isRec && hasRevisions) {\n if (\n (proposedAdditions && proposedCorrections) ||\n (additions && corrections)\n ) {\n changes = html`It includes\n ${proposedAdditions\n ? html`<a href=\"${processLink}#proposed-amendments\">\n proposed amendments</a\n >`\n : html`<a href=\"${processLink}#candidate-amendments\">\n candidate amendments</a\n >`},\n introducing substantive changes and new features since the previous\n Recommendation.`;\n } else if (proposedAdditions || additions) {\n changes = html`It includes\n ${proposedAdditions\n ? html`<a href=\"${processLink}#proposed-addition\">\n proposed additions</a\n >`\n : html`<a href=\"${processLink}#candidate-addition\">\n candidate additions</a\n >`},\n introducing new features since the previous Recommendation.`;\n } else if (proposedCorrections || corrections) {\n changes = html`It includes\n ${proposedCorrections\n ? html`<a href=\"${processLink}#proposed-correction\">\n proposed corrections</a\n >`\n : html`<a href=\"${processLink}#candidate-correction\">\n candidate corrections</a\n >`}.`;\n }\n }\n const track = status2track[conf.specStatus]\n ? html` using the\n <a href=\"${processLink}#recs-and-notes\"\n >${status2track[conf.specStatus]} track</a\n >`\n : \"\";\n return html`<p>\n This document was published by ${getWgHTML(conf)} as\n ${prefix(conf.longStatus)}${track}. ${changes}\n </p>`;\n}\n\nfunction getWgHTML(conf) {\n if (Array.isArray(conf.wg)) {\n return htmlJoinAnd(conf.wg, (wg, idx) => {\n return html`the <a href=\"${conf.wgURI[idx]}\">${wg}</a>`;\n });\n } else if (conf.wg) {\n return html`the <a href=\"${conf.wgURI}\">${conf.wg}</a>`;\n }\n}\n\nexport function linkToCommunity(conf, opts) {\n if (!conf.github && !conf.wgPublicList) {\n return;\n }\n return html`<p>\n ${conf.github\n ? html`\n <a href=\"${conf.issueBase}\">GitHub Issues</a> are preferred for\n discussion of this specification.\n `\n : \"\"}\n ${conf.wgPublicList\n ? html`\n ${conf.github && conf.wgPublicList\n ? \"Alternatively, you can send comments to our mailing list.\"\n : \"Comments regarding this document are welcome.\"}\n Please send them to\n <a href=\"${opts.mailToWGPublicListWithSubject}\"\n >${conf.wgPublicList}@w3.org</a\n >\n (<a href=\"${opts.mailToWGPublicListSubscription}\">subscribe</a>,\n <a\n href=\"${`https://lists.w3.org/Archives/Public/${conf.wgPublicList}/`}\"\n >archives</a\n >)${conf.subjectPrefix\n ? html` with <code>${conf.subjectPrefix}</code> at the start of your\n email's subject`\n : \"\"}.\n `\n : \"\"}\n </p>`;\n}\n","// @ts-check\nimport {\n l10n,\n linkToCommunity,\n renderPreview,\n renderPublicList,\n} from \"./sotd.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nexport default (conf, opts) => {\n return html`\n <h2>${l10n.sotd}</h2>\n ${conf.isPreview ? renderPreview(conf) : \"\"}\n <p>\n This specification was published by the\n <a href=\"${conf.wgURI}\">${conf.wg}</a>. It is not a W3C Standard nor is it\n on the W3C Standards Track.\n ${conf.isCGFinal\n ? html`\n Please note that under the\n <a href=\"https://www.w3.org/community/about/agreements/final/\"\n >W3C Community Final Specification Agreement (FSA)</a\n >\n other conditions apply.\n `\n : html`\n Please note that under the\n <a href=\"https://www.w3.org/community/about/agreements/cla/\"\n >W3C Community Contributor License Agreement (CLA)</a\n >\n there is a limited opt-out and other conditions apply.\n `}\n Learn more about\n <a href=\"https://www.w3.org/community/\"\n >W3C Community and Business Groups</a\n >.\n </p>\n ${!conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${!conf.github && conf.wgPublicList ? renderPublicList(conf, opts) : \"\"}\n ${conf.github ? linkToCommunity(conf, opts) : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${opts.additionalSections}\n `;\n};\n","// @ts-check\n// Module w3c/headers\n// Generate the headers material based on the provided configuration.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n// - shortName: the small name that is used after /TR/ in published reports (required)\n// - editors: an array of people editing the document (at least one is required). People\n// are defined using:\n// - name: the person's name (required)\n// - url: URI for the person's home page\n// - company: the person's company\n// - companyURL: the URI for the person's company\n// - mailto: the person's email\n// - note: a note on the person (e.g. former editor)\n// - authors: an array of people who are contributing authors of the document.\n// - formerEditors: an array of people that had earlier edited the document but no longer edit.\n// - subtitle: a subtitle for the specification\n// - publishDate: the date to use for the publication, default to document.lastModified, and\n// failing that to now. The format is YYYY-MM-DD or a Date object.\n// - previousPublishDate: the date on which the previous version was published.\n// - previousMaturity: the specStatus of the previous version\n// - errata: the URI of the errata document, if any\n// - alternateFormats: a list of alternate formats for the document, each of which being\n// defined by:\n// - uri: the URI to the alternate\n// - label: a label for the alternate\n// - lang: optional language\n// - type: optional MIME type\n// - logos: a list of logos to use instead of the W3C logo, each of which being defined by:\n// - src: the URI to the logo (target of <img src=>)\n// - alt: alternate text for the image (<img alt=>), defaults to \"Logo\" or \"Logo 1\", \"Logo 2\", ...\n// if src is not specified, this is the text of the \"logo\"\n// - height: optional height of the logo (<img height=>)\n// - width: optional width of the logo (<img width=>)\n// - url: the URI to the organization represented by the logo (target of <a href=>)\n// - id: optional id for the logo, permits custom CSS (wraps logo in <span id=>)\n// - each logo element must specify either src or alt\n// - testSuiteURI: the URI to the test suite, if any\n// - implementationReportURI: the URI to the implementation report, if any\n// - noRecTrack: set to true if this document is not intended to be on the Recommendation track\n// - edDraftURI: the URI of the Editor's Draft for this document, if any. Required if\n// specStatus is set to \"ED\".\n// - additionalCopyrightHolders: a copyright owner in addition to W3C (or the only one if specStatus\n// is unofficial)\n// - copyrightStart: the year from which the copyright starts running\n// - prevED: the URI of the previous Editor's Draft if it has moved\n// - prevRecShortname: the short name of the previous Recommendation, if the name has changed\n// - prevRecURI: the URI of the previous Recommendation if not directly generated from\n// prevRecShortname.\n// - wg: the name of the WG in charge of the document. This may be an array in which case wgURI\n// and wgPatentURI need to be arrays as well, of the same length and in the same order\n// - wgURI: the URI to the group's page, or an array of such\n// - wgPatentURI: the URI to the group's patent information page, or an array of such. NOTE: this\n// is VERY IMPORTANT information to provide and get right, do not just paste this without checking\n// that you're doing it right\n// - wgPublicList: the name of the mailing list where discussion takes place. Note that this cannot\n// be an array as it is assumed that there is a single list to discuss the document, even if it\n// is handled by multiple groups\n// - charterDisclosureURI: used for IGs (when publishing IG-NOTEs) to provide a link to the IPR commitment\n// defined in their charter.\n// - thisVersion: the URI to the dated current version of the specification. ONLY ever use this for CG/BG\n// documents, for all others it is autogenerated.\n// - latestVersion: the URI to the latest version of the specification.\n// - prevVersion: the URI to the previous (dated) version of the specification. ONLY ever use this for CG/BG\n// documents, for all others it is autogenerated.\n// - subjectPrefix: the string that is expected to be used as a subject prefix when posting to the mailing\n// list of the group.\n// - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc).\n// Example of usage: [{key: \"foo\", href:\"https://b\"}, {key: \"bar\", href:\"https://\"}].\n// Allowed values are:\n// - key: the key for the <dt> (e.g., \"Bug Tracker\"). Required.\n// - value: The value that will appear in the <dd> (e.g., \"GitHub\"). Optional.\n// - href: a URL for the value (e.g., \"https://foo.com/issues\"). Optional.\n// - class: a string representing CSS classes. Optional.\n// - license: can be one of the following\n// - \"cc-by\", which is experimentally available in some groups (but likely to be phased out).\n// Note that this is a dual licensing regime.\n// - \"document\", which is the old, but still available, document license.\n// - \"dual\", dual license.\n// - \"cc0\", an extremely permissive license. It is only recommended if you are working on a document that is\n// intended to be pushed to the WHATWG.\n// - \"w3c-software\", a permissive and attributions license (but GPL-compatible).\n// - \"w3c-software-doc\", (default) the W3C Software and Document License\n// https://www.w3.org/copyright/software-license-2023/\nimport {\n ISODate,\n codedJoinAnd,\n codedJoinOr,\n concatDate,\n docLink,\n htmlJoinAnd,\n norm,\n showError,\n showWarning,\n} from \"../core/utils.js\";\nimport cgbgHeadersTmpl from \"./templates/cgbg-headers.js\";\nimport cgbgSotdTmpl from \"./templates/cgbg-sotd.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { pub } from \"../core/pubsubhub.js\";\nimport sotdTmpl from \"./templates/sotd.js\";\n\nexport const name = \"w3c/headers\";\n\n/**\n * Resolves against https://www.w3.org.\n * @param {string} href\n */\nfunction w3Url(href) {\n return new URL(href, \"https://www.w3.org/\").href;\n}\n\nconst status2maturity = {\n LS: \"WD\",\n LD: \"WD\",\n FPWD: \"WD\",\n \"Member-SUBM\": \"SUBM\",\n};\n\nexport const status2text = {\n DNOTE: \"Group Draft Note\",\n NOTE: \"Group Note\",\n STMT: \"Statement\",\n \"Member-SUBM\": \"Member Submission\",\n MO: \"Member-Only Document\",\n ED: \"Editor's Draft\",\n LS: \"Living Standard\",\n LD: \"Living Document\",\n FPWD: \"First Public Working Draft\",\n WD: \"Working Draft\",\n CR: \"Candidate Recommendation\",\n CRD: \"Candidate Recommendation\",\n PR: \"Proposed Recommendation\",\n REC: \"Recommendation\",\n DISC: \"Discontinued Draft\",\n RSCND: \"Rescinded Recommendation\",\n DRY: \"Draft Registry\",\n CRYD: \"Candidate Registry\",\n CRY: \"Candidate Registry\",\n RY: \"Registry\",\n unofficial: \"Unofficial Draft\",\n UD: \"Unofficial Draft\",\n base: \"\",\n finding: \"TAG Finding\",\n \"draft-finding\": \"Draft TAG Finding\",\n \"editor-draft-finding\": \"Draft TAG Finding\",\n \"CG-DRAFT\": \"Draft Community Group Report\",\n \"CG-FINAL\": \"Final Community Group Report\",\n \"BG-DRAFT\": \"Draft Business Group Report\",\n \"BG-FINAL\": \"Final Business Group Report\",\n};\nconst status2long = {\n ...status2text,\n CR: \"Candidate Recommendation Snapshot\",\n CRD: \"Candidate Recommendation Draft\",\n CRY: \"Candidate Registry Snapshot\",\n CRYD: \"Candidate Registry Draft\",\n};\nexport const status2track = {\n DNOTE: \"Note\",\n NOTE: \"Note\",\n STMT: \"Note\",\n \"WG-NOTE\": \"Note\",\n \"IG-NOTE\": \"Note\",\n FPWD: \"Recommendation\",\n WD: \"Recommendation\",\n CR: \"Recommendation\",\n CRD: \"Recommendation\",\n PR: \"Recommendation\",\n REC: \"Recommendation\",\n DISC: \"Recommendation\",\n RSCND: \"Recommendation\",\n DRY: \"Registry\",\n CRYD: \"Registry\",\n CRY: \"Registry\",\n RY: \"Registry\",\n};\nexport const W3CNotes = [\"DNOTE\", \"NOTE\", \"STMT\"];\nexport const recTrackStatus = [\n \"CR\",\n \"CRD\",\n \"DISC\",\n \"FPWD\",\n \"PR\",\n \"REC\",\n \"RSCND\",\n \"WD\",\n];\nexport const registryTrackStatus = [\"DRY\", \"CRY\", \"CRYD\", \"RY\"];\nexport const tagStatus = [\"draft-finding\", \"finding\", \"editor-draft-finding\"];\nexport const cgStatus = [\"CG-DRAFT\", \"CG-FINAL\"];\nexport const bgStatus = [\"BG-DRAFT\", \"BG-FINAL\"];\nexport const cgbgStatus = [...cgStatus, ...bgStatus];\nexport const trStatus = [\n ...W3CNotes,\n ...recTrackStatus,\n ...registryTrackStatus,\n];\nexport const noTrackStatus = [\n \"base\",\n ...cgStatus,\n ...bgStatus,\n \"editor-draft-finding\",\n \"draft-finding\",\n \"finding\",\n \"MO\",\n \"unofficial\",\n];\n/** @type {Map<string, LicenseInfo>} */\nexport const licenses = new Map([\n [\n \"cc0\",\n {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n ],\n [\n \"w3c-software\",\n {\n name: \"W3C Software Notice and License\",\n short: \"W3C Software\",\n url: \"https://www.w3.org/copyright/software-license-2002/\",\n },\n ],\n [\n \"w3c-software-doc\",\n {\n name: \"W3C Software and Document Notice and License\",\n short: \"permissive document license\",\n url: \"https://www.w3.org/copyright/software-license-2023/\",\n },\n ],\n [\n \"cc-by\",\n {\n name: \"Creative Commons Attribution 4.0 International Public License\",\n short: \"CC-BY\",\n url: \"https://creativecommons.org/licenses/by/4.0/legalcode\",\n },\n ],\n [\n \"document\",\n {\n name: \"W3C Document License\",\n short: \"document use\",\n url: \"https://www.w3.org/copyright/document-license/\",\n },\n ],\n [\n \"dual\",\n {\n name: \"W3C Dual License\",\n short: \"dual license\",\n url: \"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html\",\n },\n ],\n [\n undefined,\n {\n name: \"unlicensed\",\n url: null,\n short: \"UNLICENSED\",\n },\n ],\n]);\n\nconst patentPolicies = [\"PP2017\", \"PP2020\"];\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg = docLink`${prop} is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nfunction deriveLicenseInfo(conf) {\n let license = undefined;\n if (typeof conf.license === \"string\") {\n const lCaseLicense = conf.license.toLowerCase();\n if (!licenses.has(lCaseLicense)) {\n const msg = `The license \"\\`${conf.license}\\`\" is not supported.`;\n const choices = codedJoinOr(\n [...licenses.keys()].filter(k => k),\n {\n quotes: true,\n }\n );\n const hint = docLink`Please set\n ${\"[license]\"} to one of: ${choices}. If in doubt, remove \\`license\\` and let ReSpec pick one for you.`;\n showError(msg, name, { hint });\n } else {\n license = lCaseLicense;\n }\n }\n\n if (conf.isUnofficial && !license) {\n license = \"cc-by\";\n }\n\n // W3C docs can't be CC-BY or CC0\n if (!conf.isUnofficial && [\"cc-by\", \"cc0\"].includes(license)) {\n const msg = docLink`License \"\\`${conf.license}\\`\" is not allowed for W3C Specifications.`;\n const hint = docLink`Please set ${\"[license]\"} to \\`\"w3c-software-doc\"\\` instead.`;\n showError(msg, name, { hint });\n }\n const licenseInfo = licenses.get(license);\n return licenseInfo;\n}\n\nexport async function run(conf) {\n conf.isBasic = conf.specStatus === \"base\";\n conf.isCGBG = cgbgStatus.includes(conf.specStatus);\n conf.isCGFinal = conf.isCGBG && conf.specStatus.endsWith(\"G-FINAL\");\n conf.isCR = conf.specStatus === \"CR\" || conf.specStatus === \"CRD\";\n conf.isCRDraft = conf.specStatus === \"CRD\";\n conf.isCRY = conf.specStatus === \"CRY\" || conf.specStatus === \"CRYD\";\n conf.isEd = conf.specStatus === \"ED\";\n conf.isMemberSubmission = conf.specStatus === \"Member-SUBM\";\n conf.isMO = conf.specStatus === \"MO\";\n conf.isNote = W3CNotes.includes(conf.specStatus);\n conf.isNoTrack = noTrackStatus.includes(conf.specStatus);\n conf.isPR = conf.specStatus === \"PR\";\n conf.isRecTrack = recTrackStatus.includes(conf.specStatus);\n conf.isRec = conf.isRecTrack && conf.specStatus === \"REC\";\n conf.isRegistry = registryTrackStatus.includes(conf.specStatus);\n conf.isRegular = !conf.isCGBG && !conf.isBasic;\n conf.isTagEditorFinding = conf.specStatus === \"editor-draft-finding\";\n conf.isTagFinding = tagStatus.includes(conf.specStatus);\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n conf.licenseInfo = deriveLicenseInfo(conf);\n conf.prependW3C = !conf.isBasic && !conf.isUnofficial;\n conf.longStatus = status2long[conf.specStatus];\n conf.textStatus = status2text[conf.specStatus];\n conf.showPreviousVersion = false;\n\n if (conf.isRegular && !conf.shortName) {\n const msg = docLink`The ${\"[shortName]\"} configuration option is required for this kind of document.`;\n const hint = docLink`Please set ${\"[shortName]\"} to a short name for the specification.`;\n showError(msg, name, { hint });\n }\n\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.publishYear = conf.publishDate.getUTCFullYear();\n if (conf.modificationDate) {\n conf.modificationDate = validateDateAndRecover(\n conf,\n \"modificationDate\",\n document.lastModified\n );\n }\n\n if (conf.isRecTrack && !conf.github && !conf.wgPublicList) {\n const msg =\n \"W3C Process requires a either a link to a public repository or mailing list.\";\n const hint = docLink`Use the ${\"[github]\"} configuration option to add a link to a repository. Alternatively use ${\"[wgPublicList]\"} to link to a mailing list.`;\n showError(msg, name, {\n hint,\n });\n }\n\n if (conf.isEd && !conf.edDraftURI) {\n const msg = docLink`Editor's Drafts should set ${\"[edDraftURI]\"} configuration option.`;\n const hint = docLink`Please set ${\"[edDraftURI]\"} to the URL of the Editor's Draft. Alternatively, use the set ${\"[github]\"} option, which automatically sets it for you.`;\n showWarning(msg, name, { hint });\n }\n\n const pubSpace = derivePubSpace(conf);\n if (pubSpace && !conf.thisVersion) {\n const maturity = status2maturity[conf.specStatus] || conf.specStatus;\n const { shortName, publishDate } = conf;\n const date = concatDate(publishDate);\n const docVersion = `${maturity}-${shortName}-${date}`;\n const year = [...trStatus, \"Member-SUBM\"].includes(conf.specStatus)\n ? `${publishDate.getUTCFullYear()}/`\n : \"\";\n conf.thisVersion = w3Url(`${pubSpace}/${year}${docVersion}/`);\n }\n\n if (conf.isEd) conf.thisVersion = conf.edDraftURI;\n if (conf.isCGBG) validateCGBG(conf);\n if (conf.latestVersion !== null) {\n conf.latestVersion = conf.latestVersion\n ? w3Url(conf.latestVersion)\n : w3Url(`${pubSpace}/${conf.shortName}/`);\n }\n\n if (conf.latestVersion) validateIfAllowedOnTR(conf);\n\n const latestPath = `${pubSpace}/${conf.shortName}`;\n if (conf.previousPublishDate) {\n if (!conf.previousMaturity && !conf.isTagFinding) {\n const msg = docLink`${\"[`previousPublishDate`]\"} is set, but missing ${\"[`previousMaturity`]\"}.`;\n showError(msg, name);\n }\n\n conf.previousPublishDate = validateDateAndRecover(\n conf,\n \"previousPublishDate\"\n );\n\n const prevMaturity =\n status2maturity[conf.previousMaturity] ?? conf.previousMaturity;\n if (conf.isTagFinding && conf.latestVersion) {\n const pubDate = ISODate.format(conf.publishDate);\n conf.thisVersion = w3Url(`${latestPath}-${pubDate}`);\n const prevPubDate = ISODate.format(conf.previousPublishDate);\n conf.prevVersion = w3Url(`${latestPath}-${prevPubDate}}`);\n } else if (conf.isCGBG || conf.isBasic) {\n conf.prevVersion = conf.prevVersion || \"\";\n } else {\n const year = conf.previousPublishDate.getUTCFullYear();\n const { shortName } = conf;\n const date = concatDate(conf.previousPublishDate);\n conf.prevVersion = w3Url(\n `${pubSpace}/${year}/${prevMaturity}-${shortName}-${date}/`\n );\n }\n }\n if (conf.prevRecShortname && !conf.prevRecURI)\n conf.prevRecURI = w3Url(`${pubSpace}/${conf.prevRecShortname}`);\n\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n\n if (conf.editors.length === 0) {\n const msg = \"At least one editor is required.\";\n const hint = docLink`Add one or more editors using the ${\"[editors]\"} configuration option.`;\n showError(msg, name, { hint });\n } else if (conf.editors.length && conf.isRecTrack) {\n // check that every editor has w3cid\n conf.editors.forEach((editor, i) => {\n if (editor.w3cid) return;\n const msg = docLink`Editor ${\n editor.name ? `\"${editor.name}\"` : `number ${i + 1}`\n } is missing their ${\"[w3cid]\"}.`;\n const hint = docLink`See ${\"[w3cid]\"} for instructions for how to retrieve it and add it.`;\n showError(msg, name, { hint });\n });\n }\n\n if (conf.alternateFormats?.some(({ uri, label }) => !uri || !label)) {\n const msg = docLink`Every ${\"[`alternateFormats`]\"} entry must have a \\`uri\\` and a \\`label\\`.`;\n showError(msg, name);\n }\n if (conf.copyrightStart == conf.publishYear) conf.copyrightStart = \"\";\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n conf.shortISODate = ISODate.format(conf.publishDate);\n validatePatentPolicies(conf);\n await deriveHistoryURI(conf);\n if (conf.isTagEditorFinding) {\n delete conf.thisVersion;\n delete conf.latestVersion;\n }\n if (conf.isTagFinding) {\n conf.showPreviousVersion = conf.previousPublishDate ? true : false;\n }\n // configuration done - yay!\n\n const options = {\n get multipleAlternates() {\n return conf.alternateFormats && conf.alternateFormats.length > 1;\n },\n get alternatesHTML() {\n return (\n conf.alternateFormats &&\n htmlJoinAnd(\n // We need to pass a string here...\n conf.alternateFormats.map(({ label }) => label),\n (_, i) => {\n const alt = conf.alternateFormats[i];\n return html`<a\n rel=\"alternate\"\n href=\"${alt.uri}\"\n hreflang=\"${alt?.lang ?? null}\"\n type=\"${alt?.type ?? null}\"\n >${alt.label}</a\n >`;\n }\n )\n );\n },\n };\n\n // insert into document\n const header = (conf.isCGBG ? cgbgHeadersTmpl : headersTmpl)(conf, options);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // handle SotD\n const sotd =\n document.getElementById(\"sotd\") || document.createElement(\"section\");\n if ((conf.isCGBG || !conf.isNoTrack || conf.isTagFinding) && !sotd.id) {\n const msg =\n \"A Status of This Document must include at least on custom paragraph.\";\n const hint =\n \"Add a `<p>` in the 'sotd' section that reflects the status of this specification.\";\n showError(msg, name, { elements: [sotd], hint });\n }\n sotd.id = sotd.id || \"sotd\";\n sotd.classList.add(\"introductory\");\n // NOTE:\n // When arrays, wg and wgURI have to be the same length (and in the same order).\n // Technically wgURI could be longer but the rest is ignored.\n // However wgPatentURI can be shorter. This covers the case where multiple groups\n // publish together but some aren't used for patent policy purposes (typically this\n // happens when one is foolish enough to do joint work with the TAG). In such cases,\n // the groups whose patent policy applies need to be listed first, and wgPatentURI\n // can be shorter ā€” but it still needs to be an array.\n const wgPotentialArray = [conf.wg, conf.wgURI, conf.wgPatentURI];\n if (\n wgPotentialArray.some(item => Array.isArray(item)) &&\n !wgPotentialArray.every(item => Array.isArray(item))\n ) {\n const msg = docLink`If one of ${\"[wg]\"}, ${\"[wgURI]\"}, or ${\"[wgPatentURI]\"} is an array, they all have to be.`;\n const hint = docLink`Use the ${\"[group]\"} option with an array instead.`;\n showError(msg, name, { hint });\n }\n if (Array.isArray(conf.wg)) {\n conf.multipleWGs = conf.wg.length > 1;\n conf.wgPatentHTML = htmlJoinAnd(conf.wg, (wg, i) => {\n return html`a\n <a href=\"${conf.wgPatentURI[i]}\" rel=\"disclosure\"\n >public list of any patent disclosures (${wg})</a\n >`;\n });\n } else {\n conf.multipleWGs = false;\n }\n if (conf.isPR && !conf.crEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PR\" but no ${\"[crEnd]\"} is specified in the ${\"[respecConfig]\"} (needed to indicate end of previous CR).`;\n showError(msg, name);\n }\n\n if (conf.isCR && !conf.crEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"CR\", but no ${\"[crEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.crEnd = validateDateAndRecover(conf, \"crEnd\");\n\n if (conf.isPr && !conf.prEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PR\" but no ${\"[prEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.prEnd = validateDateAndRecover(conf, \"prEnd\");\n\n const isUpdatableRec = sotd.classList.contains(\"updateable-rec\");\n const hasCorrections = document.querySelector(\".correction\") !== null;\n const hasProposedCorrections =\n document.querySelector(\".proposed-correction\") !== null;\n const hasAdditions = document.querySelector(\".addition\") !== null;\n const hasProposedAdditions =\n document.querySelector(\".proposed-addition\") !== null;\n const hasRevisions =\n hasCorrections ||\n hasAdditions ||\n hasProposedAdditions ||\n hasProposedCorrections;\n\n if (conf.isRec && !conf.errata && !hasRevisions) {\n const msg = \"Recommendations must have an errata link.\";\n const hint = docLink`Add an ${\"[errata]\"} URL to your ${\"[respecConfig]\"}.`;\n showError(msg, name, { hint });\n }\n\n if (!isUpdatableRec && (hasAdditions || hasCorrections)) {\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with proposed additions but the Recommendation is not marked as allowing new features.`;\n showError(msg, name);\n }\n\n if (\n conf.isRec &&\n isUpdatableRec &&\n (hasProposedAdditions || hasProposedCorrections) &&\n !conf.revisedRecEnd\n ) {\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with proposed corrections or additions but no ${\"[revisedRecEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.revisedRecEnd = validateDateAndRecover(conf, \"revisedRecEnd\");\n\n if (conf.noRecTrack && recTrackStatus.includes(conf.specStatus)) {\n const msg = docLink`Document configured as ${\"[noRecTrack]\"}, but its status (\"${conf.specStatus}\") puts it on the W3C Rec Track.`;\n const notAllowed = codedJoinOr(recTrackStatus, { quotes: true });\n const hint = `Status **can't** be any of: ${notAllowed}.`;\n showError(msg, name, { hint });\n }\n if (!sotd.classList.contains(\"override\")) {\n html.bind(sotd)`${populateSoTD(conf, sotd)}`;\n }\n\n if (!conf.implementationReportURI && conf.isCR) {\n const msg = docLink`Missing ${\"[implementationReportURI]\"} configuration option in ${\"[respecConfig]\"}.`;\n const hint = docLink`CR documents must have an ${\"[implementationReportURI]\"} that describes the [implementation experience](https://www.w3.org/policies/process/#implementation-experience).`;\n showError(msg, name, { hint });\n }\n if (!conf.implementationReportURI && conf.isPR) {\n const msg = docLink`PR documents should include an ${\"[implementationReportURI]\"}, which needs to link to a document that describes the [implementation experience](https://www.w3.org/policies/process-20190301/#implementation-experience).`;\n showWarning(msg, name);\n }\n\n // Requested by https://github.com/speced/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: norm(\n document.getElementById(\"w3c-state\")?.textContent ?? \"\"\n ),\n });\n}\n\nfunction validateIfAllowedOnTR(conf) {\n const latestVersionURL = new URL(conf.latestVersion);\n const isW3C =\n latestVersionURL.origin === \"https://www.w3.org\" ||\n latestVersionURL.origin === \"https://w3.org/\";\n if (\n isW3C &&\n latestVersionURL.pathname.startsWith(\"/TR/\") &&\n [\"ED\", ...trStatus].includes(conf.specStatus) === false\n ) {\n const msg = docLink`Documents with a status of \\`\"${conf.specStatus}\"\\` can't be published on the W3C's /TR/ (Technical Report) space.`;\n const hint = docLink`Ask a W3C Team Member for a W3C URL where the report can be published and change ${\"[latestVersion]\"} to something else.`;\n showError(msg, name, { hint });\n return;\n }\n}\n\nfunction derivePubSpace(conf) {\n const { specStatus, group } = conf;\n if (trStatus.includes(specStatus) || conf.groupType === \"wg\") {\n return `/TR`;\n }\n\n switch (specStatus) {\n case \"CG-FINAL\":\n case \"BG-FINAL\":\n return `/community/reports/${group}`;\n case \"finding\":\n case \"draft-finding\":\n return \"/2001/tag/doc\";\n case \"Member-SUBM\":\n return `/Submission`;\n }\n\n return \"\";\n}\n\nfunction validateCGBG(conf) {\n const reportType = status2text[conf.specStatus];\n const latestVersionURL = conf.latestVersion\n ? new URL(w3Url(conf.latestVersion))\n : null;\n\n if (!conf.wg) {\n const msg = docLink`The ${\"[group]\"} configuration option is required for this kind of document (${reportType}).`;\n showError(msg, name);\n return;\n }\n\n // Deal with final reports\n if (conf.isCGFinal) {\n // Final report require a w3.org URL.\n const isW3C =\n latestVersionURL?.origin === \"https://www.w3.org\" ||\n latestVersionURL?.origin === \"https://w3.org/\";\n if (isW3C === false) {\n const msg = docLink`For ${reportType}, the ${\"[latestVersion]\"} URL must point to somewhere at https://www.w3.org/.`;\n const hint = `Ask a W3C Team Member for a W3C URL where the report can be published.`;\n showError(msg, name, { hint });\n return;\n }\n }\n}\n\nasync function deriveHistoryURI(conf) {\n if (!conf.shortName || conf.historyURI === null || !conf.latestVersion) {\n return; // Nothing to do\n }\n\n const canShowHistory = conf.isEd || trStatus.includes(conf.specStatus);\n\n if (conf.historyURI && !canShowHistory) {\n const msg = docLink`The ${\"[historyURI]\"} can't be used with non /TR/ documents.`;\n const hint = docLink`Please remove ${\"[historyURI]\"}.`;\n showError(msg, name, { hint });\n conf.historyURI = null;\n return;\n }\n\n const historyURL = new URL(\n conf.historyURI ?? `${conf.shortName}/`,\n \"https://www.w3.org/standards/history/\"\n );\n\n // If it's on the Rec Track or it's TR worthy, then allow history override.\n // Also make a an exception for FPWD, DNOTE, NOTE and DRY.\n if (\n (conf.historyURI && canShowHistory) ||\n [\"FPWD\", \"DNOTE\", \"NOTE\", \"DRY\"].includes(conf.specStatus)\n ) {\n conf.historyURI = historyURL.href;\n return;\n }\n\n // Let's get the history from the W3C.\n // Do a fetch HEAD request to see if the history exists...\n // We don't discriminate... if it's on the W3C website with a history,\n // we show it.\n try {\n const response = await fetch(historyURL, { method: \"HEAD\" });\n if (response.ok) {\n conf.historyURI = response.url;\n }\n } catch {\n // Ignore fetch errors\n }\n}\n\nfunction validatePatentPolicies(conf) {\n if (!conf.wgPatentPolicy) return;\n const policies = new Set([].concat(conf.wgPatentPolicy));\n if (\n policies.size &&\n ![...policies].every(policy => patentPolicies.includes(policy))\n ) {\n const invalidPolicies = [...policies].filter(\n policy => !patentPolicies.includes(policy)\n );\n const msg = docLink`Invalid ${\"[wgPatentPolicy]\"} value(s): ${codedJoinAnd(\n invalidPolicies\n )}.`;\n const hint = `Please use one of: ${codedJoinOr(patentPolicies)}.`;\n showError(msg, name, { hint });\n }\n if (policies.size !== 1) {\n const msg =\n \"When collaborating across multiple groups, they must use the same patent policy.\";\n const hint = docLink`For ${\"[wgPatentPolicy]\"}, please check the patent policies of each group. The patent policies were: ${[\n ...policies,\n ].join(\", \")}.`;\n showError(msg, name, { hint });\n }\n // We take the first policy\n conf.wgPatentPolicy = [...policies][0];\n}\n\n/**\n * @param {*} conf\n * @param {HTMLElement} sotd\n */\nfunction populateSoTD(conf, sotd) {\n const options = {\n ...collectSotdContent(sotd, conf),\n\n get mailToWGPublicList() {\n return `mailto:${conf.wgPublicList}@w3.org`;\n },\n get mailToWGPublicListWithSubject() {\n const fragment = conf.subjectPrefix\n ? `?subject=${encodeURIComponent(conf.subjectPrefix)}`\n : \"\";\n return this.mailToWGPublicList + fragment;\n },\n get mailToWGPublicListSubscription() {\n return `mailto:${conf.wgPublicList}-request@w3.org?subject=subscribe`;\n },\n };\n const template = conf.isCGBG ? cgbgSotdTmpl : sotdTmpl;\n return template(conf, options);\n}\n\n/**\n * @param {HTMLElement} sotd\n */\nfunction collectSotdContent(sotd, { isTagFinding = false }) {\n const sotdClone = sotd.cloneNode(true);\n const additionalContent = document.createDocumentFragment();\n // we collect everything until we hit a section,\n // that becomes the custom content.\n while (sotdClone.hasChildNodes()) {\n if (\n sotdClone.nodeType === Node.ELEMENT_NODE &&\n // @ts-ignore\n sotdClone.firstChild.localName === \"section\"\n ) {\n break;\n }\n additionalContent.appendChild(sotdClone.firstChild);\n }\n if (isTagFinding && !additionalContent.hasChildNodes()) {\n const msg = docLink`ReSpec does not support automated SotD generation for TAG findings.`;\n const hint = `Please add the prerequisite content in the 'sotd' section.`;\n showWarning(msg, name, { hint });\n }\n return {\n additionalContent,\n // Whatever sections are left, we throw at the end.\n additionalSections: sotdClone.childNodes,\n };\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for W3C specs\n */\nexport const name = \"w3c/defaults\";\nimport {\n W3CNotes,\n bgStatus,\n cgStatus,\n recTrackStatus,\n registryTrackStatus,\n status2text,\n tagStatus,\n trStatus,\n} from \"./headers.js\";\nimport { codedJoinOr, docLink, showError } from \"../core/utils.js\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst w3cLogo = {\n src: \"https://www.w3.org/StyleSheets/TR/2021/logos/W3C\",\n alt: \"W3C\",\n height: 48,\n width: 72,\n url: \"https://www.w3.org/\",\n};\n\nconst memSubmissionLogo = {\n alt: \"W3C Member Submission\",\n href: \"https://www.w3.org/Submission/\",\n src: \"https://www.w3.org/Icons/member_subm-v.svg\",\n width: \"211\",\n height: \"48\",\n};\n\nconst w3cDefaults = {\n lint: {\n \"privsec-section\": false,\n \"required-sections\": true,\n \"wpt-tests-exist\": false,\n \"informative-dfn\": \"warn\",\n \"no-unused-dfns\": \"warn\",\n a11y: false,\n },\n doJsonLd: false,\n logos: [],\n xref: true,\n wgId: \"\",\n otherLinks: [],\n excludeGithubLinks: true,\n subtitle: \"\",\n prevVersion: \"\",\n formerEditors: [],\n editors: [],\n authors: [],\n};\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...w3cDefaults.lint,\n ...conf.lint,\n };\n\n Object.assign(conf, {\n ...coreDefaults,\n ...w3cDefaults,\n ...conf,\n lint,\n });\n\n if (conf.specStatus !== \"unofficial\" && !conf.hasOwnProperty(\"license\")) {\n conf.license = \"w3c-software-doc\";\n }\n\n validateStatusForGroup(conf);\n processLogos(conf);\n}\n\nfunction processLogos(conf) {\n // Primarily include the W3C logo and license for W3C Recommendation track\n // that have an actual working group.\n const { specStatus, wg } = conf;\n const isWgStatus = [\n ...recTrackStatus,\n ...registryTrackStatus,\n ...W3CNotes,\n ...tagStatus,\n \"ED\",\n ].includes(specStatus);\n const inWorkingGroup = wg && wg.length && isWgStatus;\n // Member submissions don't need to be in a Working Group.\n const doesNotNeedWG = [\"Member-SUBM\"].includes(specStatus);\n const canShowW3CLogo = inWorkingGroup || doesNotNeedWG;\n if (canShowW3CLogo) {\n conf.logos.unshift(w3cLogo);\n if (specStatus === \"Member-SUBM\") {\n conf.logos.push(memSubmissionLogo);\n }\n }\n}\n\nfunction validateStatusForGroup(conf) {\n const { specStatus, groupType, group } = conf;\n\n if (!specStatus) {\n const msg = docLink`The ${\"[specStatus]\"} configuration option is required.`;\n const hint = docLink`Select an appropriate status from ${\"[specStatus]\"} based on your W3C group. If in doubt, use \\`\"unofficial\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"base\";\n return;\n }\n\n if (status2text[specStatus] === undefined) {\n const msg = docLink`The ${\"[specStatus]\"} \"\\`${specStatus}\\`\" is not supported at for this type of document.`;\n const choices = codedJoinOr(Object.keys(status2text), { quotes: true });\n const hint = docLink`set ${\"[specStatus]\"} to one of: ${choices}.`;\n showError(msg, name, { hint });\n conf.specStatus = \"base\";\n return;\n }\n\n switch (groupType) {\n case \"cg\": {\n if (![...cgStatus, \"unofficial\", \"UD\"].includes(specStatus)) {\n const msg = docLink`W3C Community Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr(cgStatus, { quotes: true });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"CG-DRAFT\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"CG-DRAFT\";\n }\n break;\n }\n case \"bg\": {\n if (![...bgStatus, \"unofficial\", \"UD\"].includes(specStatus)) {\n const msg = docLink`W3C Business Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr(bgStatus, { quotes: true });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"BG-DRAFT\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"BG-DRAFT\";\n }\n break;\n }\n case \"wg\": {\n if (![...trStatus, \"unofficial\", \"UD\", \"ED\"].includes(specStatus)) {\n const msg = docLink`W3C Working Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const hint = docLink`Pleas see ${\"[specStatus]\"} for appropriate status for W3C Working Group documents.`;\n showError(msg, name, { hint });\n }\n break;\n }\n case \"other\":\n if (\n group === \"tag\" &&\n ![\"ED\", ...trStatus, ...tagStatus].includes(specStatus)\n ) {\n const msg = docLink`The W3C Technical Architecture Group's documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr([\"ED\", ...trStatus, ...tagStatus], {\n quotes: true,\n });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"unofficial\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"unofficial\";\n }\n break;\n default:\n if (\n !conf.wgId &&\n ![\"unofficial\", \"base\", \"UD\", \"Member-SUBM\"].includes(conf.specStatus)\n ) {\n const msg =\n \"Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.\";\n const hint = docLink`Use the ${\"[group]\"} configuration option to associated this document with a W3C group.`;\n conf.specStatus = \"base\";\n showError(msg, name, { hint });\n }\n }\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOF --- */\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"Ā§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// The purpose of this module is to insert the default ReSpec CSS into the document.\n// If you don't want to use the default ReSpec CSS, set the `noReSpecCSS` configuration\n// option to `true`. If you want to use your own styles, create a ReSpec profile that\n// includes your own styles and sets the `noReSpecCSS` configuration option to `true`.\n\n/**\n * Module Name.\n * @type {string}\n */\nexport const name = \"core/style\";\n\nimport css from \"../styles/respec.css.js\";\n\n// Opportunistically inserts the style to reduce some FOUC.\n/** @type {HTMLStyleElement} */\nconst styleElement = insertStyle();\n\n/**\n * Inserts the ReSpec CSS as a `style` element into the document's `head`.\n * @return {HTMLStyleElement} The `style` element that was inserted.\n */\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\n/**\n * Removes the ReSpec CSS if the `noReSpecCSS` configuration option is `true`.\n * @param {Conf} conf The document configuration object.\n */\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n/**\n * Module w3c/style\n * Inserts a link to the appropriate W3C style for the specification's maturity level.\n * */\n\nimport { W3CNotes, recTrackStatus, registryTrackStatus } from \"./headers.js\";\nimport { createResourceHint } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { sub } from \"../core/pubsubhub.js\";\n\nexport const name = \"w3c/style\";\n\nfunction attachFixupScript() {\n const script = document.createElement(\"script\");\n script.src = \"https://www.w3.org/scripts/TR/2021/fixup.js\";\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n document.body.appendChild(script);\n}\n\n// Creates a collection of resource hints to improve the loading performance\n// of the W3C resources.\nfunction createResourceHints() {\n /** @type {ResourceHintOption[]} */\n const opts = [\n {\n hint: \"preconnect\", // for W3C styles and scripts.\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2021/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: getStyleUrl(\"base.css\").href,\n as: \"style\",\n },\n {\n hint: \"preload\",\n href: getStyleUrl(\"dark.css\").href,\n as: \"style\",\n },\n {\n hint: \"preload\", // all specs show the logo.\n href: \"https://www.w3.org/StyleSheets/TR/2021/logos/W3C\",\n as: \"image\",\n corsMode: \"anonymous\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// Opportunistically apply base style\nelements.appendChild(\n html`<link\n rel=\"stylesheet\"\n href=\"https://www.w3.org/StyleSheets/TR/2021/base.css\"\n class=\"removeOnSave\"\n />`\n);\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(\n html`<meta\n name=\"viewport\"\n content=\"width=device-width, initial-scale=1, shrink-to-fit=no\"\n />`\n );\n}\n\ndocument.head.prepend(elements);\n\n/**\n * @param {URL|string} linkURL\n * @returns {(exportDoc: Document) => void}\n */\nfunction styleMover(linkURL) {\n return exportDoc => {\n const w3cStyle = exportDoc.querySelector(`head link[href=\"${linkURL}\"]`);\n exportDoc.querySelector(\"head\").append(w3cStyle);\n };\n}\n\n/**\n * @param {Conf} conf\n */\nexport function run(conf) {\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\"end-all\", attachFixupScript, { once: true });\n }\n\n const finalStyleURL = getStyleUrl(getStyleFile(conf));\n document.head.appendChild(\n html`<link rel=\"stylesheet\" href=\"${finalStyleURL.href}\" />`\n );\n // Make sure the W3C stylesheet is the last stylesheet, as required by W3C Pub Rules.\n sub(\"beforesave\", styleMover(finalStyleURL));\n\n // Add color scheme meta tag and style\n /** @type HTMLMetaElement */\n let colorScheme = document.querySelector(\"head meta[name=color-scheme]\");\n if (!colorScheme) {\n // Default to light mode during transitional period.\n colorScheme = html`<meta name=\"color-scheme\" content=\"light\" />`;\n document.head.appendChild(colorScheme);\n }\n if (colorScheme.content.includes(\"dark\")) {\n const darkModeStyleUrl = getStyleUrl(\"dark.css\");\n document.head.appendChild(\n html`<link\n rel=\"stylesheet\"\n href=\"${darkModeStyleUrl.href}\"\n media=\"(prefers-color-scheme: dark)\"\n />`\n );\n // As required by W3C Pub Rules.\n sub(\"beforesave\", styleMover(darkModeStyleUrl));\n }\n}\n\n/** @param {Conf} conf */\nfunction getStyleFile(conf) {\n const canonicalStatus = conf.specStatus?.toUpperCase() ?? \"\";\n let styleFile = \"\";\n const canUseW3CStyle =\n [\n ...recTrackStatus,\n ...registryTrackStatus,\n ...W3CNotes,\n \"ED\",\n \"MEMBER-SUBM\",\n ].includes(canonicalStatus) && conf.wgId;\n\n // Figure out which style file to use.\n switch (canonicalStatus) {\n case \"WD\":\n case \"FPWD\":\n styleFile = canUseW3CStyle ? \"W3C-WD\" : \"base.css\";\n break;\n case \"CG-DRAFT\":\n case \"CG-FINAL\":\n case \"BG-DRAFT\":\n case \"BG-FINAL\":\n styleFile = canonicalStatus.toLowerCase();\n break;\n case \"UD\":\n case \"UNOFFICIAL\":\n styleFile = \"W3C-UD\";\n break;\n case \"FINDING\":\n case \"DRAFT-FINDING\":\n case \"EDITOR-DRAFT-FINDING\":\n case \"BASE\":\n styleFile = \"base.css\";\n break;\n case \"MEMBER-SUBM\":\n styleFile = \"W3C-Member-SUBM\";\n break;\n default:\n styleFile = canUseW3CStyle ? `W3C-${conf.specStatus}` : \"base.css\";\n }\n\n return styleFile;\n}\n\nfunction getStyleUrl(styleFile = \"base.css\") {\n return new URL(`/StyleSheets/TR/2021/${styleFile}`, \"https://www.w3.org/\");\n}\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/speced/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"ģ°øģ—¬\",\n },\n zh: {\n file_a_bug: \"反馈错čÆÆ\",\n participate: \"参äøŽļ¼š\",\n },\n ja: {\n commit_history: \"å¤‰ę›“å±„ę­“\",\n file_a_bug: \"問锌報告\",\n participate: \"å‚åŠ ę–¹ę³•ļ¼š\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${ghURL.href}).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n console.error(msg, el, err);\n showError(msg, name, { elements: [el] });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","// @ts-check\n/**\n * @module core/reindent\n *\n * Normalizes indents across the pre elements in the document,\n * so that indentation inside <pre> won't affect the rendered result.\n */\nimport { reindent } from \"./utils.js\";\nexport const name = \"core/reindent\";\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","/**\n * This module handles the creation of the h1#title of a spec and\n * makes sure the <title> always matches the h1.\n *\n * If no h1#title is included, then the <title> becomes the h1#title.\n *\n * When a h1#title is included, it always takes precedence over the\n * <title> of a spec. An error will be displayed in case of\n * any mismatch.\n *\n */\n\nimport { getIntlData, norm, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/title\";\n\nconst localizationStrings = {\n en: {\n default_title: \"No Title\",\n },\n de: {\n default_title: \"Kein Titel\",\n },\n zh: {\n default_title: \"ę— ę ‡é¢˜\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {HTMLElement} */\n const h1Elem =\n document.querySelector(\"h1#title\") || html`<h1 id=\"title\"></h1>`;\n\n // check existing element is ok to use\n if (h1Elem.isConnected && h1Elem.textContent.trim() === \"\") {\n const msg =\n \"The document is missing a title, so using a default title. \" +\n \"To fix this, please give your document a `<title>`. \" +\n \"If you need special markup in the document's title, \" +\n 'please use a `<h1 id=\"title\">`.';\n const title = \"Document is missing a title\";\n showError(msg, name, { title, elements: [h1Elem] });\n }\n\n // Decorate the spec title\n if (!h1Elem.id) h1Elem.id = \"title\";\n h1Elem.classList.add(\"title\");\n\n setDocumentTitle(conf, h1Elem);\n\n // This will get relocated by a template later.\n document.body.prepend(h1Elem);\n}\n\nfunction setDocumentTitle(conf, h1Elem) {\n // If the h1 is newly created, it won't be connected. In this case\n // we use the <title> or a localized fallback.\n if (!h1Elem.isConnected) {\n h1Elem.textContent = document.title || `${l10n.default_title}`;\n }\n // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.textContent);\n\n if (conf.isPreview && conf.prNumber) {\n const prUrl = conf.prUrl || `${conf.github.repoURL}pull/${conf.prNumber}`;\n const { childNodes } = html`\n Preview of PR <a href=\"${prUrl}\">#${conf.prNumber}</a>:\n `;\n h1Elem.prepend(...childNodes);\n documentTitle = `Preview of PR #${conf.prNumber}: ${documentTitle}`;\n }\n\n document.title = documentTitle;\n\n // conf.title is deperecated - we are keeping this here just to\n // retain backwards compat as we think the ePub generator\n // relies on it.\n conf.title = documentTitle;\n}\n","/**\n * This module updates the title and shortName\n * of a spec when there is a valid level configuration.\n *\n * Levels should be integers >= 0.\n *\n * @module w3c/level\n */\n\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"w3c/level\";\n/** @type {LocalizationStrings} */\nconst localizationStrings = {\n en: {\n level: \"Level\",\n },\n ja: {\n level: \"ćƒ¬ćƒ™ćƒ«\",\n },\n nl: {\n level: \"Niveau\",\n },\n de: {\n level: \"Stufe\",\n },\n zh: {\n level: \"ēŗ§åˆ«\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * Updates the title and shortName of a spec based on the level configuration.\n *\n * @param {Conf} conf - The configuration object.\n */\nexport function run(conf) {\n if (!conf.hasOwnProperty(\"level\")) return;\n\n const h1Elem = document.querySelector(\"h1#title\");\n\n const level = parseInt(conf.level);\n if (!Number.isInteger(level) || level < 0) {\n const msg = `The \\`level\\` configuration option must be a number greater or equal to 0. It is currently set to \\`${level}\\``;\n const title = \"Invalid level config.\";\n showError(msg, name, { title, elements: [h1Elem] });\n return;\n }\n\n h1Elem.append(` ${l10n.level} ${level}`);\n document.title = `${document.title} ${l10n.level} ${level}`;\n conf.shortName = `${conf.shortName}-${level}`;\n conf.level = level;\n}\n","/**\n * Module w3c/abstract\n *\n * This module handles the abstract section properly by adding necessary elements and\n * performing validations.\n *\n * @module w3c/abstract\n */\n\nimport { getIntlData, norm, renameElement, showError } from \"../core/utils.js\";\nimport { lang as docLang } from \"../core/l10n.js\";\nimport { html } from \"../core/import-maps.js\";\n\nexport const name = \"w3c/abstract\";\n\n/** @type {LocalizationStrings} */\nconst localizationStrings = {\n en: { abstract: \"Abstract\" },\n ko: { abstract: \"ģš”ģ•½\" },\n zh: { abstract: \"ę‘˜č¦\" },\n ja: { abstract: \"要ē“„\" },\n nl: { abstract: \"Samenvatting\" },\n es: { abstract: \"Resumen\" },\n de: { abstract: \"Zusammenfassung\" },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * Handles the abstract section of the document.\n */\nexport async function run() {\n const abstract = findAbstract();\n if (!abstract) {\n showError('Document must have one `<section id=\"abstract\">`.', name);\n return;\n }\n\n abstract.classList.add(\"introductory\");\n abstract.id = \"abstract\";\n if (!abstract.querySelector(\"h2\")) {\n abstract.prepend(html`<h2>${l10n.abstract}</h2>`);\n }\n}\n\n/**\n * Finds the abstract section in the document.\n *\n * @returns {HTMLElement | null} The abstract section element.\n */\nfunction findAbstract() {\n const abstract = document.getElementById(\"abstract\");\n if (abstract) {\n switch (abstract.localName) {\n case \"section\":\n return abstract;\n case \"div\":\n return renameElement(abstract, \"section\");\n default:\n showError(\"The abstract should be a `<section>` element.\", name, {\n elements: [abstract],\n });\n return abstract;\n }\n }\n\n const searchString = l10n.abstract.toLocaleLowerCase(docLang);\n for (const header of document.querySelectorAll(\"h2, h3, h4, h5, h6\")) {\n if (norm(header.textContent).toLocaleLowerCase(docLang) === searchString) {\n return header.closest(\"section\");\n }\n }\n\n return abstract;\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Module core/data-abbr\n// - Finds all elements with data-abbr attribute and processes them.\nimport { showError } from \"./utils.js\";\nexport const name = \"core/dfn-abbr\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = document.querySelectorAll(\"[data-abbr]\");\n for (const elem of elements) {\n const { localName } = elem;\n switch (localName) {\n case \"dfn\":\n processDfnElement(elem);\n break;\n default: {\n const msg = `\\`data-abbr\\` attribute not supported on \\`${localName}\\` elements.`;\n showError(msg, name, {\n elements: [elem],\n title: \"Error: unsupported.\",\n });\n }\n }\n }\n}\n/**\n * @param {HTMLElement} dfn\n */\nfunction processDfnElement(dfn) {\n const abbr = generateAbbreviation(dfn);\n // get normalized <dfn> textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (<abbr title=\"${fullForm}\">${abbr}</abbr>)`\n );\n const lt = dfn.dataset.lt || \"\";\n dfn.dataset.lt = lt\n .split(\"|\")\n .filter(i => i.trim())\n .concat(abbr)\n .join(\"|\");\n}\n\nfunction generateAbbreviation(elem) {\n if (elem.dataset.abbr) return elem.dataset.abbr;\n // Generates abbreviation from textContent\n // e.g., \"Permanent Account Number\" -> \"PAN\"\n return elem.textContent\n .match(/\\b([a-z])/gi)\n .join(\"\")\n .toUpperCase();\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/speced/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"ģ°øģ”°\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参ē…§ē”Øå‚č€ƒę–‡ēŒ®\",\n norm_references: \"č¦ēƄēš„å‚č€ƒę–‡ēŒ®\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n de: {\n info_references: \"WeiterfĆ¼hrende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"éžč§„čŒƒę€§å¼•ē”Ø\",\n norm_references: \"č§„čŒƒę€§å¼•ē”Ø\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMƜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NƖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDƜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKƖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;\"?<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn or a `a`, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn,a\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn|abstract-op\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n /** @param {string} str */\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","// @ts-check\n// Module w3c/conformance\n// Handle the conformance section properly.\nimport { getIntlData, htmlJoinAnd, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"w3c/conformance\";\n\nconst localizationStrings = {\n en: {\n conformance: \"Conformance\",\n normativity:\n \"As well as sections marked as non-normative, all authoring guidelines, \" +\n \"diagrams, examples, and notes in this specification are non-normative. \" +\n \"Everything else in this specification is normative.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n The key word${plural ? \"s\" : \"\"} ${keywords} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n when, and only when, they appear in all capitals, as shown here.\n </p>`;\n },\n },\n de: {\n conformance: \"Anforderungen\",\n normativity:\n \"Neben den explizit als nicht-normativ gekennzeichneten Abschnitten \" +\n \"sind auch alle Diagramme, Beispiele und Hinweise in diesem Dokument \" +\n \"nicht normativ. Alle anderen Angaben sind normativ.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n ${plural ? \"Die SchlĆ¼sselwƶrter\" : \"Das SchlĆ¼sselwort\"} ${keywords} in\n diesem Dokument ${plural ? \"sind\" : \"ist\"} gemƤƟ\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n und unter BerĆ¼cksichtigung von\n <a href=\"https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst\"\n >2119de</a\n >\n zu interpretieren, wenn und nur wenn ${plural ? \"sie\" : \"es\"} wie hier\n gezeigt durchgehend groƟ geschrieben wurde${plural ? \"n\" : \"\"}.\n </p>`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = [...Object.keys(rfc2119Usage)];\n // Add RFC2119 to bibliography\n if (terms.length) {\n conf.normativeReferences.add(\"RFC2119\");\n conf.normativeReferences.add(\"RFC8174\");\n }\n // Put in the 2119 clause and reference\n const keywords = htmlJoinAnd(\n terms.sort(),\n item => html`<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h1>${l10n.conformance}</h1>\n <p>${l10n.normativity}</p>\n ${terms.length ? l10n.keywordInterpretation(keywords, plural) : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance && !conformance.classList.contains(\"override\")) {\n processConformance(conformance, conf);\n }\n // Warn when there are RFC2119/RFC8174 keywords, but not conformance section\n if (!conformance && Object.keys(rfc2119Usage).length) {\n const msg = `Document uses RFC2119 keywords but lacks a conformance section.`;\n const hint = 'Please add a `<section id=\"conformance\">`.';\n showWarning(msg, name, { hint });\n }\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"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`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"ģ˜ˆģ‹œ\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-color: var(--warning-border, #f11);\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n background: var(--warning-bg, #fbe9e9);\n color: black;\n color: var(--text, black);\n}\n\n.warning-title:before {\n content: \"āš \"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"ę³Ø\",\n editors_note: \"ē·Ø者ę³Ø\",\n feature_at_risk: \"(å¤‰ę›“ć®åÆčƒ½ę€§ć®ć‚ć‚‹ę©Ÿčƒ½) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 恮要ē“„\",\n no_issues_in_spec: \"ć“ć®ä»•ę§˜ć«ćÆęœŖč§£ę±ŗ恮 issues ćÆå«ć¾ć‚Œć¦ć„ć¾ć›ć‚“ļ¼Ž\",\n warning: \"č­¦å‘Š\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"CuestiĆ³n\",\n issue_summary: \"Resumen de la cuestiĆ³n\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificaciĆ³n.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthƤlt keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"ē¼–者ę³Ø\",\n feature_at_risk: \"ļ¼ˆęœ‰åÆčƒ½å˜åŠØēš„ē‰¹ę€§ļ¼‰Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue ꀻē»“\",\n no_issues_in_spec: \"ęœ¬č§„čŒƒäø­ęœŖ列å‡ŗ任何 issue怂\",\n note: \"ę³Ø\",\n warning: \"č­¦å‘Š\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"꜀č‰Æå®Ÿę–½ä¾‹ \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"ęœ€ä½³å®žč·µ \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"å›³ć®ćƒŖć‚¹ćƒˆ\",\n },\n ko: {\n fig: \"ź·øė¦¼ \",\n list_of_figures: \"ź·øė¦¼ ėŖ©ė”\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范äø­åŒ…含ēš„图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n// Module core/tables\n// Handles tables in the document.\n// Generates a List of Tables wherever there is a #list-of-tables element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/tables\";\n\nconst localizationStrings = {\n en: {\n list_of_tables: \"List of Tables\",\n table: \"Table \",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n const listOfTables = collectTables();\n const listOfTablesElement = document.querySelector(\"section#list-of-tables\");\n if (listOfTables.length && listOfTablesElement) {\n decorateListOfTables(listOfTablesElement);\n listOfTablesElement.append(\n html`<h1>${l10n.list_of_tables}</h1>`,\n html`<ul class=\"list-of-tables\">\n ${listOfTables}\n </ul>`\n );\n }\n}\n\n/**\n * process all tables\n */\nfunction collectTables() {\n /** @type {HTMLLIElement[]} */\n const listOfTables = [];\n /** @type {NodeListOf<HTMLTableElement>} */\n const tables = document.querySelectorAll(\"table.numbered\");\n [...tables]\n // there is a separate linter rule to catch numbered tables without captions\n .filter(table => !!table.querySelector(\"caption\"))\n .forEach((table, i) => {\n const caption = table.querySelector(\"caption\");\n decorateTable(table, caption, i);\n listOfTables.push(getListOfTablesListItem(table.id, caption));\n });\n return listOfTables;\n}\n\n/**\n * @param {HTMLTableElement} table\n * @param {HTMLTableCaptionElement} caption\n * @param {number} i\n */\nfunction decorateTable(table, caption, i) {\n const title = caption.textContent;\n addId(table, \"table\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"table-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${table.id}\"\n >${l10n.table}<bdi class=\"tableno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} tableId\n * @param {HTMLTableCaptionElement} caption\n * @return {HTMLLIElement}\n */\nfunction getListOfTablesListItem(tableId, caption) {\n const listOfTablesCaption = caption.cloneNode(true);\n for (const anchor of listOfTablesCaption.querySelectorAll(\"a\")) {\n renameElement(anchor, \"span\", { copyAttributes: false });\n }\n return html`<li>\n <a class=\"tocxref\" href=\"${`#${tableId}`}\"\n >${listOfTablesCaption.childNodes}</a\n >\n </li>`;\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} listOfTablesElement\n */\nfunction decorateListOfTables(listOfTablesElement) {\n if (\n listOfTablesElement.matches(\".appendix, .introductory\") ||\n listOfTablesElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(listOfTablesElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n listOfTablesElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n listOfTablesElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\nimport { definitionMap, registerDefinition } from \"./dfn-map.js\";\nimport { showError, wrapInner } from \"./utils.js\";\n\nconst topLevelEntities = new Set([\n \"callback interface\",\n \"callback\",\n \"dictionary\",\n \"enum\",\n \"interface mixin\",\n \"interface\",\n \"typedef\",\n]);\n\n/**\n * This function looks for a <dfn> element whose title is 'name' and\n * that is \"for\" 'parent', which is the empty string when 'name'\n * refers to a top-level entity. For top-level entities, <dfn>\n * elements that inherit a non-empty [dfn-for] attribute are also\n * counted as matching.\n *\n * When a matching <dfn> is found, it's given <code> formatting,\n * marked as an IDL definition, and returned. If no <dfn> is found,\n * the function returns 'undefined'.\n * @param {*} defn\n * @param {string} name\n */\nexport function findDfn(defn, name, { parent = \"\" } = {}) {\n switch (defn.type) {\n case \"constructor\":\n case \"operation\":\n return findOperationDfn(defn, parent, name);\n default:\n return findNormalDfn(defn, parent, name);\n }\n}\n\n/**\n * @param {{ type: string, arguments: any[] }} idlAst\n * @param {string} parent\n * @param {string} name\n */\nfunction getAlternativeNames(idlAst, parent, name) {\n const { type } = idlAst;\n const asQualifiedName = `${parent}.${name}`;\n switch (type) {\n case \"constructor\":\n case \"operation\": {\n // Allow linking to \"method()\", method(arg) and \"method\" name.\n const asMethodName = `${name}()`;\n const asFullyQualifiedName = `${asQualifiedName}()`;\n const asMethodWithArgs = generateMethodNamesWithArgs(\n name,\n idlAst.arguments\n );\n return {\n local: [asQualifiedName, asFullyQualifiedName, name],\n exportable: [asMethodName, ...asMethodWithArgs],\n };\n }\n case \"attribute\":\n return {\n local: [asQualifiedName],\n exportable: [name],\n };\n }\n}\n\n/**\n * Generates all possible permutations of a method name based\n * on what arguments they method accepts.\n\n * Required arguments are always present, and optional ones\n * are stacked one by one.\n *\n * For examples: foo(req1, req2), foo(req1, req2, opt1) and so on.\n *\n * @param {String} operationName\n * @param {*} argsAst\n */\nfunction generateMethodNamesWithArgs(operationName, argsAst) {\n const operationNames = [];\n if (argsAst.length === 0) {\n return operationNames;\n }\n const required = []; // required arguments\n const optional = []; // optional arguments, including variadic ones\n for (const { name, optional: isOptional, variadic } of argsAst) {\n if (isOptional || variadic) {\n optional.push(name);\n } else {\n required.push(name);\n }\n }\n const requiredArgs = required.join(\", \");\n const requiredOperation = `${operationName}(${requiredArgs})`;\n operationNames.push(requiredOperation);\n const optionalOps = optional.map((_, index) => {\n const args = [...required, ...optional.slice(0, index + 1)].join(\", \");\n const result = `${operationName}(${args})`;\n return result;\n });\n operationNames.push(...optionalOps);\n return operationNames;\n}\n\n/**\n * @param {*} defn\n * @param {string} parent\n * @param {string} name\n */\nfunction findOperationDfn(defn, parent, name) {\n // Overloads all have unique names\n if (name.includes(\"!overload\")) {\n return findNormalDfn(defn, parent, name);\n }\n const asMethodName = `${name}()`;\n return findNormalDfn(defn, parent, asMethodName, name);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {Record<\"local\" | \"exportable\", string[]>} names\n */\nfunction addAlternativeNames(dfn, names) {\n const { local, exportable } = names;\n const lt = dfn.dataset.lt ? new Set(dfn.dataset.lt.split(\"|\")) : new Set();\n for (const item of exportable) {\n lt.add(item);\n }\n // Fix any ill-placed ones - local ones don't belong here\n local.filter(item => lt.has(item)).forEach(item => lt.delete(item));\n dfn.dataset.lt = [...lt].join(\"|\");\n dfn.dataset.localLt = local.join(\"|\");\n registerDefinition(dfn, [...local, ...exportable]);\n}\n\n/**\n * @param {*} defn\n * @param {string} parent\n * @param {...string} names\n */\nfunction findNormalDfn(defn, parent, ...names) {\n const { type } = defn;\n for (const name of names) {\n let resolvedName =\n type === \"enum-value\" && name === \"\" ? \"the-empty-string\" : name;\n let dfns = getDfns(resolvedName, parent, name, type);\n // If we haven't found any definitions with explicit [for]\n // and [title], look for a dotted definition, \"parent.name\".\n if (dfns.length === 0 && parent !== \"\") {\n resolvedName = `${parent}.${resolvedName}`;\n const alternativeDfns = definitionMap.get(resolvedName);\n if (alternativeDfns && alternativeDfns.size === 1) {\n dfns = [...alternativeDfns];\n registerDefinition(dfns[0], [resolvedName]);\n }\n } else {\n resolvedName = name;\n }\n if (dfns.length > 1) {\n const msg = `WebIDL identifier \\`${name}\\` ${\n parent ? `for \\`${parent}\\`` : \"\"\n } is defined multiple times`;\n const title = \"Duplicate definition.\";\n showError(msg, name, { title, elements: dfns });\n }\n if (dfns.length) {\n return dfns[0];\n }\n }\n}\n\n/**\n * @param {HTMLElement} dfnElem\n * @param {*} idlAst\n * @param {string} parent\n * @param {string} name\n */\nexport function decorateDfn(dfnElem, idlAst, parent, name) {\n if (!dfnElem.id) {\n const lCaseParent = parent.toLowerCase();\n const middle = lCaseParent ? `${lCaseParent}-` : \"\";\n let last = name.toLowerCase().replace(/[()]/g, \"\").replace(/\\s/g, \"-\");\n if (last === \"\") {\n last = \"the-empty-string\";\n dfnElem.setAttribute(\"aria-label\", \"the empty string\");\n }\n dfnElem.id = `dom-${middle}${last}`;\n }\n dfnElem.dataset.idl = idlAst.type;\n dfnElem.dataset.title = dfnElem.textContent;\n dfnElem.dataset.dfnFor = parent;\n // Derive the data-type for dictionary members, interface attributes,\n // and methods\n switch (idlAst.type) {\n case \"operation\":\n case \"attribute\":\n case \"field\":\n dfnElem.dataset.type = getDataType(idlAst);\n break;\n }\n\n // Mark the definition as code.\n if (\n !dfnElem.querySelector(\"code\") &&\n !dfnElem.closest(\"code\") &&\n dfnElem.children\n ) {\n wrapInner(dfnElem, dfnElem.ownerDocument.createElement(\"code\"));\n }\n\n // Add data-lt and data-local-lt values and register them\n switch (idlAst.type) {\n case \"attribute\":\n case \"constructor\":\n case \"operation\":\n addAlternativeNames(dfnElem, getAlternativeNames(idlAst, parent, name));\n break;\n }\n\n return dfnElem;\n}\n\n/**\n * @param {string} name\n * @param {string} parent data-dfn-for\n * @param {string} originalName\n * @param {string} type\n */\nfunction getDfns(name, parent, originalName, type) {\n const foundDfns = definitionMap.get(name);\n if (!foundDfns || foundDfns.size === 0) {\n return [];\n }\n const dfnForArray = [...foundDfns];\n // Definitions that have a name and [data-dfn-for] that exactly match the\n // IDL entity:\n const dfns = dfnForArray.filter(dfn => {\n // This is explicitly marked as a concept, so we can't use it\n if (dfn.dataset.dfnType === \"dfn\") return false;\n\n /** @type {HTMLElement} */\n const closestDfnFor = dfn.closest(`[data-dfn-for]`);\n return closestDfnFor && closestDfnFor.dataset.dfnFor === parent;\n });\n\n if (dfns.length === 0 && parent === \"\" && dfnForArray.length === 1) {\n // Make sure the name exactly matches\n return dfnForArray[0].textContent === originalName ? dfnForArray : [];\n } else if (topLevelEntities.has(type) && dfnForArray.length) {\n const dfn = dfnForArray.find(\n dfn => dfn.textContent.trim() === originalName\n );\n if (dfn) return [dfn];\n }\n return dfns;\n}\n\n/**\n * @return {string}\n */\nfunction getDataType(idlStruct = {}) {\n const { idlType, generic, union } = idlStruct;\n if (idlType === undefined) return \"\";\n if (typeof idlType === \"string\") return idlType;\n if (generic) return generic;\n // join on \"|\" handles for \"unsigned short\" etc.\n if (union) return idlType.map(getDataType).join(\"|\");\n return getDataType(idlType);\n}\n","// @ts-check\n/**\n * Module core/webidl-clipboard\n *\n * This module adds a button to each IDL pre making it possible to copy\n * well-formatted IDL to the clipboard.\n *\n */\nexport const name = \"core/webidl-clipboard\";\n\nfunction createButton() {\n const copyButton = document.createElement(\"button\");\n copyButton.innerHTML =\n '<svg height=\"16\" viewBox=\"0 0 14 16\" width=\"14\"><path fill-rule=\"evenodd\" d=\"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z\"/></svg>';\n copyButton.title = \"Copy IDL to clipboard\";\n copyButton.classList.add(\"respec-button-copy-paste\", \"removeOnSave\");\n return copyButton;\n}\n\nconst copyButton = createButton();\n\n/**\n * Adds a HTML button that copies WebIDL to the clipboard.\n *\n * @param {HTMLSpanElement} idlHeader\n */\nexport function addCopyIDLButton(idlHeader) {\n // There may be multiple <span>s of IDL, so we take everything\n // apart from the idl header.\n const pre = idlHeader.closest(\"pre.idl\");\n const idl = pre.cloneNode(true);\n idl.querySelector(\".idlHeader\").remove();\n const { textContent: idlText } = idl;\n const button = copyButton.cloneNode(true);\n button.addEventListener(\"click\", () => {\n navigator.clipboard.writeText(idlText);\n });\n idlHeader.append(button);\n}\n","/* --- WEB IDL --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\npre.idl {\n padding: 1em;\n position: relative;\n}\n\npre.idl > code {\n color: black;\n color: var(--text, black);\n}\n\n@media print {\n pre.idl {\n white-space: pre-wrap;\n }\n}\n\n.idlHeader {\n display: block;\n width: 150px;\n background: #8ccbf2;\n background: var(--def-border, #8ccbf2);\n color: #fff;\n /* TODO: need a better color here */\n color: var(--defrow-border, #fff);\n font-family: sans-serif;\n font-weight: bold;\n margin: -1em 0 1em -1em;\n height: 28px;\n line-height: 28px;\n}\n\n.idlHeader a.self-link {\n margin-left: 0.3cm;\n text-decoration: none;\n border-bottom: none;\n color: inherit;\n}\n\n.idlID {\n font-weight: bold;\n color: #005a9c;\n}\n\n.idlType {\n color: #005a9c;\n}\n\n.idlName {\n color: #ff4500;\n}\n\n.idlName a {\n color: #ff4500;\n border-bottom: 1px dotted #ff4500;\n text-decoration: none;\n}\n\na.idlEnumItem {\n color: #000;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\n.idlSuperclass {\n font-style: italic;\n color: #005a9c;\n}\n\n/*.idlParam*/\n\n.idlParamName,\n.idlDefaultValue {\n font-style: italic;\n}\n\n.extAttr {\n color: #666;\n}\n\n/*.idlSectionComment*/\n\n.idlSectionComment {\n color: gray;\n}\n\n.idlIncludes a {\n font-weight: bold;\n}\n\n.respec-button-copy-paste:focus {\n text-decoration: none;\n border-color: #51a7e8;\n outline: none;\n box-shadow: 0 0 5px rgba(81, 167, 232, 0.5);\n}\n\n.respec-button-copy-paste:is(:focus:hover,.selected:focus) {\n border-color: #51a7e8;\n}\n\n.respec-button-copy-paste:is(:hover,:active,.zeroclipboard-is-hover,.zeroclipboard-is-active) {\n text-decoration: none;\n background-color: #ddd;\n background-image: linear-gradient(#eee, #ddd);\n border-color: #ccc;\n}\n\n.respec-button-copy-paste:is(:active,.selected,.zeroclipboard-is-active) {\n background-color: #dcdcdc;\n background-image: none;\n border-color: #b5b5b5;\n box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);\n}\n\n.respec-button-copy-paste.selected:hover {\n background-color: #cfcfcf;\n}\n\n.respec-button-copy-paste:is(:disabled,:disabled:hover,.disabled,.disabled:hover) {\n color: rgba(102, 102, 102, 0.5);\n cursor: default;\n background-color: rgba(229, 229, 229, 0.5);\n background-image: none;\n border-color: rgba(197, 197, 197, 0.5);\n box-shadow: none;\n}\n\n@media print {\n .respec-button-copy-paste {\n visibility: hidden;\n }\n}\n`;\n","// Module core/webidl\n// Highlights and links WebIDL marked up inside <pre class=\"idl\">.\n\n// TODO:\n// - It could be useful to report parsed IDL items as events\n// - don't use generated content in the CSS!\nimport {\n addHashId,\n docLink,\n showError,\n showWarning,\n wrapInner,\n xmlEscape,\n} from \"./utils.js\";\nimport { decorateDfn, findDfn } from \"./dfn-finder.js\";\nimport { html, webidl2 } from \"./import-maps.js\";\nimport { addCopyIDLButton } from \"./webidl-clipboard.js\";\nimport css from \"../styles/webidl.css.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/webidl\";\nconst pluginName = name;\n\nconst operationNames = {};\nconst idlPartials = {};\n\nconst templates = {\n wrap(items) {\n return items\n .flat()\n .filter(x => x !== \"\")\n .map(x => (typeof x === \"string\" ? new Text(x) : x));\n },\n trivia(t) {\n if (!t.trim()) {\n return t;\n }\n return html`<span class=\"idlSectionComment\">${t}</span>`;\n },\n generic(keyword) {\n // Shepherd classifies \"interfaces\" as starting with capital letters,\n // like Promise, FrozenArray, etc.\n return /^[A-Z]/.test(keyword)\n ? html`<a data-xref-type=\"interface\" data-cite=\"WEBIDL\">${keyword}</a>`\n : // Other keywords like sequence, maplike, etc...\n html`<a data-xref-type=\"dfn\" data-cite=\"WEBIDL\">${keyword}</a>`;\n },\n reference(wrapped, unescaped, context) {\n if (context.type === \"extended-attribute\") {\n return wrapped;\n }\n let type = \"_IDL_\";\n let cite = null;\n let lt;\n switch (unescaped) {\n case \"object\":\n type = \"interface\";\n cite = \"WEBIDL\";\n break;\n }\n return html`<a\n data-link-type=\"${type === \"_IDL_\" ? \"idl\" : type}\"\n data-xref-type=\"${type}\"\n data-cite=\"${cite}\"\n data-lt=\"${lt}\"\n >${wrapped}</a\n >`;\n },\n name(escaped, { data, parent }) {\n if (data.idlType && data.idlType.type === \"argument-type\") {\n return html`<span class=\"idlParamName\">${escaped}</span>`;\n }\n const idlLink = defineIdlName(escaped, data, parent);\n if (data.type !== \"enum-value\") {\n const className = parent ? \"idlName\" : \"idlID\";\n idlLink.classList.add(className);\n }\n return idlLink;\n },\n nameless(escaped, { data, parent }) {\n switch (data.type) {\n case \"operation\":\n case \"constructor\":\n return defineIdlName(escaped, data, parent);\n default:\n return escaped;\n }\n },\n type(contents) {\n return html`<span class=\"idlType\">${contents}</span>`;\n },\n inheritance(contents) {\n return html`<span class=\"idlSuperclass\">${contents}</span>`;\n },\n definition(contents, { data, parent }) {\n const className = getIdlDefinitionClassName(data);\n switch (data.type) {\n case \"includes\":\n case \"enum-value\":\n return html`<span class=\"${className}\">${contents}</span>`;\n }\n const parentName = parent ? parent.name : \"\";\n const { name, idlId } = getNameAndId(data, parentName);\n return html`<span\n class=\"${className}\"\n id=\"${idlId}\"\n data-idl\n data-title=\"${name}\"\n >${contents}</span\n >`;\n },\n extendedAttribute(contents) {\n const result = html`<span class=\"extAttr\">${contents}</span>`;\n return result;\n },\n extendedAttributeReference(name) {\n return html`<a data-xref-type=\"extended-attribute\">${name}</a>`;\n },\n};\n\n/**\n * Returns a link to existing <dfn> or creates one if doesnā€™t exists.\n */\nfunction defineIdlName(escaped, data, parent) {\n const parentName = parent ? parent.name : \"\";\n const { name } = getNameAndId(data, parentName);\n const dfn = findDfn(data, name, {\n parent: parentName,\n });\n const linkType = getDfnType(data.type);\n if (dfn) {\n if (!data.partial) {\n if (!dfn.matches(\"[data-noexport]\")) dfn.dataset.export = \"\";\n dfn.dataset.dfnType = linkType;\n }\n decorateDfn(dfn, data, parentName, name);\n const href = `#${dfn.id}`;\n return html`<a\n data-link-for=\"${parentName}\"\n data-link-type=\"${linkType}\"\n href=\"${href}\"\n class=\"internalDFN\"\n ><code>${escaped}</code></a\n >`;\n }\n\n const isDefaultJSON =\n data.type === \"operation\" &&\n data.name === \"toJSON\" &&\n data.extAttrs.some(({ name }) => name === \"Default\");\n if (isDefaultJSON) {\n return html`<a data-link-type=\"dfn\" data-lt=\"default toJSON steps\"\n >${escaped}</a\n >`;\n }\n if (!data.partial) {\n const dfn = html`<dfn data-export data-dfn-type=\"${linkType}\"\n >${escaped}</dfn\n >`;\n registerDefinition(dfn, [name]);\n decorateDfn(dfn, data, parentName, name);\n return dfn;\n }\n\n const unlinkedAnchor = html`<a\n data-idl=\"${data.partial ? \"partial\" : null}\"\n data-link-type=\"${linkType}\"\n data-title=\"${data.name}\"\n data-xref-type=\"${linkType}\"\n >${escaped}</a\n >`;\n\n const showWarnings =\n name && data.type !== \"typedef\" && !(data.partial && !dfn);\n if (showWarnings) {\n const styledName = data.type === \"operation\" ? `${name}()` : name;\n const ofParent = parentName ? ` \\`${parentName}\\`'s` : \"\";\n const msg = `Missing \\`<dfn>\\` for${ofParent} \\`${styledName}\\` ${data.type}.`;\n const hint = docLink`See ${\"using `data-dfn-for`|#data-dfn-for\"} in ReSpec's documentation.`;\n showWarning(msg, pluginName, { elements: [unlinkedAnchor], hint });\n }\n return unlinkedAnchor;\n}\n\n/**\n * Map to Shepherd types, for export.\n * @see https://tabatkins.github.io/bikeshed/#dfn-types\n */\nfunction getDfnType(idlType) {\n switch (idlType) {\n case \"operation\":\n return \"method\";\n case \"field\":\n return \"dict-member\";\n case \"callback interface\":\n case \"interface mixin\":\n return \"interface\";\n default:\n return idlType;\n }\n}\n\nfunction getIdlDefinitionClassName(defn) {\n switch (defn.type) {\n case \"callback interface\":\n return \"idlInterface\";\n case \"operation\":\n return \"idlMethod\";\n case \"field\":\n return \"idlMember\";\n case \"enum-value\":\n return \"idlEnumItem\";\n case \"callback function\":\n return \"idlCallback\";\n }\n return `idl${defn.type[0].toUpperCase()}${defn.type.slice(1)}`;\n}\n\nconst nameResolverMap = new WeakMap();\nfunction getNameAndId(defn, parent = \"\") {\n if (nameResolverMap.has(defn)) {\n return nameResolverMap.get(defn);\n }\n const result = resolveNameAndId(defn, parent);\n nameResolverMap.set(defn, result);\n return result;\n}\n\nfunction resolveNameAndId(defn, parent) {\n let name = getDefnName(defn);\n // For getters, setters, etc. \"anonymous-getter\",\n const prefix = defn.special && defn.name === \"\" ? \"anonymous-\" : \"\";\n let idlId = getIdlId(prefix + name, parent);\n switch (defn.type) {\n // Top-level entities with linkable members.\n case \"callback interface\":\n case \"dictionary\":\n case \"interface\":\n case \"interface mixin\": {\n idlId += resolvePartial(defn);\n break;\n }\n case \"constructor\":\n case \"operation\": {\n const overload = resolveOverload(name, parent);\n if (overload) {\n name += overload;\n idlId += overload;\n } else if (defn.arguments.length) {\n idlId += defn.arguments\n .map(arg => `-${arg.name.toLowerCase()}`)\n .join(\"\");\n }\n break;\n }\n }\n return { name, idlId };\n}\n\nfunction resolvePartial(defn) {\n if (!defn.partial) {\n return \"\";\n }\n if (!idlPartials[defn.name]) {\n idlPartials[defn.name] = 0;\n }\n idlPartials[defn.name] += 1;\n return `-partial-${idlPartials[defn.name]}`;\n}\n\nfunction resolveOverload(name, parentName) {\n const qualifiedName = `${parentName}.${name}`;\n const fullyQualifiedName = `${qualifiedName}()`;\n let overload;\n if (!operationNames[fullyQualifiedName]) {\n operationNames[fullyQualifiedName] = 0;\n }\n if (!operationNames[qualifiedName]) {\n operationNames[qualifiedName] = 0;\n } else {\n overload = `!overload-${operationNames[qualifiedName]}`;\n }\n operationNames[fullyQualifiedName] += 1;\n operationNames[qualifiedName] += 1;\n return overload || \"\";\n}\n\nfunction getIdlId(name, parentName) {\n if (!parentName) {\n return `idl-def-${name.toLowerCase()}`;\n }\n return `idl-def-${parentName.toLowerCase()}-${name.toLowerCase()}`;\n}\n\nfunction getDefnName(defn) {\n switch (defn.type) {\n case \"enum-value\":\n return defn.value;\n case \"operation\":\n return defn.name || defn.special;\n default:\n return defn.name || defn.type;\n }\n}\n\n// IDL types that never need a data-dfn-for\nconst topLevelIdlTypes = [\n \"interface\",\n \"interface mixin\",\n \"dictionary\",\n \"namespace\",\n \"enum\",\n \"typedef\",\n \"callback\",\n];\n\n/**\n * @param {Element} idlElement\n * @param {number} index\n */\nfunction renderWebIDL(idlElement, index) {\n let parse;\n try {\n parse = webidl2.parse(idlElement.textContent, {\n sourceName: String(index),\n });\n } catch (e) {\n const msg = `Failed to parse WebIDL: ${e.bareMessage}.`;\n showError(msg, pluginName, {\n title: e.bareMessage,\n details: `<pre>${e.context}</pre>`,\n elements: [idlElement],\n });\n // Skip this <pre> and move on to the next one.\n return [];\n }\n // we add \"idl\" as the canonical match, so both \"webidl\" and \"idl\" work\n idlElement.classList.add(\"def\", \"idl\");\n const highlights = webidl2.write(parse, { templates });\n html.bind(idlElement)`${highlights}`;\n wrapInner(idlElement, document.createElement(\"code\"));\n idlElement.querySelectorAll(\"[data-idl]\").forEach(elem => {\n if (elem.dataset.dfnFor) {\n return;\n }\n const title = elem.dataset.title;\n // Select the nearest ancestor element that can contain members.\n const idlType = elem.dataset.dfnType;\n\n const parent = elem.parentElement.closest(\"[data-idl][data-title]\");\n if (parent && !topLevelIdlTypes.includes(idlType)) {\n elem.dataset.dfnFor = parent.dataset.title;\n }\n if (elem.localName === \"dfn\") {\n registerDefinition(elem, [title]);\n }\n });\n // cross reference\n const closestCite = idlElement.closest(\"[data-cite], body\");\n const { dataset } = closestCite;\n if (!dataset.cite) dataset.cite = \"WEBIDL\";\n // includes webidl in some form\n if (!/\\bwebidl\\b/i.test(dataset.cite)) {\n const cites = dataset.cite.trim().split(/\\s+/);\n dataset.cite = [\"WEBIDL\", ...cites].join(\" \");\n }\n addIDLHeader(idlElement);\n return parse;\n}\n/**\n * Adds a \"WebIDL\" decorative header/permalink to a block of WebIDL.\n * @param {HTMLPreElement} pre\n */\nexport function addIDLHeader(pre) {\n addHashId(pre, \"webidl\");\n const header = html`<span class=\"idlHeader\"\n ><a class=\"self-link\" href=\"${`#${pre.id}`}\">WebIDL</a></span\n >`;\n pre.prepend(header);\n addCopyIDLButton(header);\n}\n\nexport async function run() {\n const idls = document.querySelectorAll(\"pre.idl, pre.webidl\");\n if (!idls.length) {\n return;\n }\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.querySelector(\"head link, head > *:last-child\").before(style);\n\n const astArray = [...idls].map(renderWebIDL);\n\n const validations = webidl2.validate(astArray);\n for (const validation of validations) {\n let details = `<pre>${xmlEscape(validation.context)}</pre>`;\n if (validation.autofix) {\n validation.autofix();\n const idlToFix = webidl2.write(astArray[validation.sourceName]);\n const escaped = xmlEscape(idlToFix);\n details += `Try fixing as:\n <pre>${escaped}</pre>`;\n }\n const msg = `WebIDL validation error: ${validation.bareMessage}`;\n showError(msg, pluginName, {\n details,\n elements: [idls[validation.sourceName]],\n title: validation.bareMessage,\n });\n }\n document.normalize();\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of the specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n *\n * @module core/data-cite\n */\n\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to the current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n * @type {string}\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * Gets the link properties for the given citation details.\n * @param {CiteDetails} citeDetails - The citation details.\n * @returns {Promise<LinkProps|null>} The link properties or null if not found.\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/speced/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n\n return { href, title };\n}\n\n/**\n * Links the given element with the provided link properties and citation details.\n * @param {HTMLElement} elem - The element to link.\n * @param {LinkProps} linkProps - The link properties.\n * @param {CiteDetails} citeDetails - The citation details.\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n anchor.dataset.cite = citeDetails.key;\n anchor.dataset.citePath = citeDetails.path;\n anchor.dataset.citeFrag = citeDetails.frag;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting a linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * Converts the given raw key to citation details.\n * @param {HTMLElement} elem - The element containing the citation details.\n * @returns {CiteDetails} The citation details.\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as a fragment\n return toCiteDetails(elem);\n }\n\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\n/**\n * Runs the data-cite processing on elements with the data-cite attribute.\n */\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetches and updates `biblio` with entries corresponding to the given elements.\n * @param {HTMLElement[]} elems - The elements requiring biblio entries.\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/**\n * Cleans up the data-cite attributes from the document.\n * @param {Document} doc - The document to cleanup.\n */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ć®é‡č¤‡å®šē¾©`;\n },\n duplicateTitle: \"恓恮ꖇę›øå†…ć§č¤‡ę•°å›žå®šē¾©ć•ć‚Œć¦ć„ć¾ć™ļ¼Ž\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthƤlt mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ēš„重复定义`;\n },\n duplicateTitle: \"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n for (const type of linkType.split(\"|\")) {\n if (dfnsByType.get(type)) {\n return dfnsByType.get(type);\n }\n }\n return dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\nimport { API_URL } from \"./xref.js\";\nimport { idb } from \"./import-maps.js\";\n\n/**\n * @typedef {import('core/xref').RequestEntry} RequestEntry\n * @typedef {import('core/xref').Response} Response\n * @typedef {import('core/xref').SearchResultEntry} SearchResultEntry\n * @typedef {import('core/xref').XrefDatabase} XrefDatabase\n */\n\nconst STORE_NAME = \"xrefs\";\nconst VERSION_CHECK_WAIT = 5 * 60 * 1000; // 5 min\n\nasync function getIdbCache() {\n /** @type {XrefDatabase} */\n const db = await idb.openDB(\"xref\", 2, {\n upgrade(db) {\n [...db.objectStoreNames].forEach(s => db.deleteObjectStore(s));\n const store = db.createObjectStore(STORE_NAME, { keyPath: \"query.id\" });\n store.createIndex(\"byTerm\", \"query.term\", { unique: false });\n },\n });\n return db;\n}\n\n/** @param {RequestEntry[]} queries */\nexport async function resolveXrefCache(queries) {\n /** @type {Map<string, SearchResultEntry[]>} */\n const cachedData = new Map();\n\n const bustCache = await shouldBustCache();\n if (bustCache) {\n await clearXrefData();\n return cachedData;\n }\n\n const requiredKeySet = new Set(queries.map(query => query.id));\n try {\n const cache = await getIdbCache();\n let cursor = await cache.transaction(STORE_NAME).store.openCursor();\n while (cursor) {\n if (requiredKeySet.has(cursor.key)) {\n cachedData.set(cursor.key, cursor.value.result);\n }\n cursor = await cursor.continue();\n }\n } catch (err) {\n console.error(err);\n }\n return cachedData;\n}\n\n/**\n * Get last updated timestamp from server and bust cache based on that. This\n * way, we prevent dirty/erroneous/stale data being kept on a client (which is\n * possible if we use a `MAX_AGE` based caching strategy).\n */\nasync function shouldBustCache() {\n const key = \"XREF:LAST_VERSION_CHECK\";\n const lastChecked = parseInt(localStorage.getItem(key), 10);\n const now = Date.now();\n\n if (!lastChecked) {\n localStorage.setItem(key, now.toString());\n return false;\n }\n if (now - lastChecked < VERSION_CHECK_WAIT) {\n // avoid checking network for any data update if old cache \"fresh\"\n return false;\n }\n\n const url = new URL(\"meta/version\", API_URL).href;\n const res = await fetch(url);\n if (!res.ok) return false;\n const lastUpdated = await res.text();\n localStorage.setItem(key, now.toString());\n return parseInt(lastUpdated, 10) > lastChecked;\n}\n\n/**\n * @param {RequestEntry[]} queries\n * @param {Map<string, SearchResultEntry[]>} results\n */\nexport async function cacheXrefData(queries, results) {\n try {\n const cache = await getIdbCache();\n const tx = cache.transaction(STORE_NAME, \"readwrite\");\n for (const query of queries) {\n const result = results.get(query.id);\n tx.objectStore(STORE_NAME).add({ query, result });\n }\n await tx.done;\n } catch (e) {\n console.error(e);\n }\n}\n\nexport async function clearXrefData() {\n try {\n await getIdbCache().then(db => db.clear(STORE_NAME));\n } catch (e) {\n console.error(e);\n }\n}\n","// @ts-check\n/**\n * @module core/xref\n *\n * Automatically adds external references.\n *\n * Searches for the terms which do not have a local definition at xref API and\n * for each query, adds `data-cite` attributes to respective elements.\n * `core/data-cite` later converts these data-cite attributes to actual links.\n * https://github.com/speced/respec/issues/1662\n */\n/**\n * @typedef {import('core/xref').RequestEntry} RequestEntry\n * @typedef {import('core/xref').Response} Response\n * @typedef {import('core/xref').SearchResultEntry} SearchResultEntry\n * @typedef {Map<string, { elems: HTMLElement[], results: SearchResultEntry[], query: RequestEntry }>} ErrorCollection\n * @typedef {{ ambiguous: ErrorCollection, notFound: ErrorCollection }} Errors\n */\nimport { cacheXrefData, resolveXrefCache } from \"./xref-db.js\";\nimport {\n createResourceHint,\n docLink,\n joinAnd,\n joinOr,\n nonNormativeSelector,\n norm as normalize,\n showError,\n} from \"./utils.js\";\nimport { possibleExternalLinks } from \"./link-to-dfn.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/xref\";\n\nconst profiles = {\n \"web-platform\": [\"HTML\", \"INFRA\", \"URL\", \"WEBIDL\", \"DOM\", \"FETCH\"],\n};\n\nexport const API_URL = \"https://respec.org/xref/\";\n\n/** @type {{ term: string; spec: string; element: HTMLElement }[]} */\nexport const informativeRefsInNormative = [];\n\nif (\n !document.querySelector(\"link[rel='preconnect'][href='https://respec.org']\")\n) {\n const link = createResourceHint({\n hint: \"preconnect\",\n href: \"https://respec.org\",\n });\n document.head.appendChild(link);\n}\n\n/**\n * @param {Object} conf respecConfig\n */\nexport async function run(conf) {\n if (!conf.xref) {\n return;\n }\n\n const xref = normalizeConfig(conf.xref);\n if (xref.specs) {\n const bodyCite = document.body.dataset.cite\n ? document.body.dataset.cite.split(/\\s+/)\n : [];\n document.body.dataset.cite = bodyCite.concat(xref.specs).join(\" \");\n }\n\n const elems = possibleExternalLinks.concat(findExplicitExternalLinks());\n if (!elems.length) return;\n\n /** @type {RequestEntry[]} */\n const queryKeys = [];\n for (const elem of elems) {\n const entry = getRequestEntry(elem);\n entry.id = await objectHash(entry);\n queryKeys.push(entry);\n }\n\n const data = await getData(queryKeys, xref.url);\n addDataCiteToTerms(elems, queryKeys, data, conf);\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Find additional references that need to be looked up externally.\n * Examples: a[data-cite=\"spec\"], dfn[data-cite=\"spec\"], dfn.externalDFN\n */\nfunction findExplicitExternalLinks() {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n \":is(a,dfn)[data-cite]:not([data-cite=''],[data-cite*='#'])\"\n );\n /** @type {NodeListOf<HTMLElement>} */\n const externalDFNs = document.querySelectorAll(\"dfn.externalDFN\");\n return [...links]\n .filter(el => {\n // ignore empties\n if (el.textContent.trim() === \"\") return false;\n /** @type {HTMLElement} */\n const closest = el.closest(\"[data-cite]\");\n return !closest || closest.dataset.cite !== \"\";\n })\n .concat(...externalDFNs);\n}\n\n/**\n * converts conf.xref to object with url and spec properties\n */\nfunction normalizeConfig(xref) {\n const defaults = {\n url: new URL(\"search/\", API_URL).href,\n specs: null,\n };\n\n const config = Object.assign({}, defaults);\n\n const type = Array.isArray(xref) ? \"array\" : typeof xref;\n switch (type) {\n case \"boolean\":\n // using defaults already, as above\n break;\n case \"string\":\n if (xref.toLowerCase() in profiles) {\n Object.assign(config, { specs: profiles[xref.toLowerCase()] });\n } else {\n invalidProfileError(xref);\n }\n break;\n case \"array\":\n Object.assign(config, { specs: xref });\n break;\n case \"object\":\n Object.assign(config, xref);\n if (xref.profile) {\n const profile = xref.profile.toLowerCase();\n if (profile in profiles) {\n const specs = (xref.specs ?? []).concat(profiles[profile]);\n Object.assign(config, { specs });\n } else {\n invalidProfileError(xref.profile);\n }\n }\n break;\n default: {\n const msg = `Invalid value for \\`xref\\` configuration option. Received: \"${xref}\".`;\n showError(msg, name);\n }\n }\n return config;\n\n function invalidProfileError(profile) {\n const supportedProfiles = joinOr(Object.keys(profiles), s => `\"${s}\"`);\n const msg =\n `Invalid profile \"${profile}\" in \\`respecConfig.xref\\`. ` +\n `Please use one of the supported profiles: ${supportedProfiles}.`;\n showError(msg, name);\n }\n}\n\n/**\n * get xref API request entry (term and context) for given xref element\n * @param {HTMLElement} elem\n */\nfunction getRequestEntry(elem) {\n const isIDL = \"xrefType\" in elem.dataset;\n\n let term = getTermFromElement(elem);\n if (!isIDL) term = term.toLowerCase();\n\n const specs = getSpecContext(elem);\n const types = getTypeContext(elem, isIDL);\n const forContext = getForContext(elem, isIDL);\n\n return {\n // Add an empty `id` to ensure the shape of object returned stays same when\n // actual `id` is added later (minor perf optimization, also makes\n // TypeScript happy).\n id: \"\",\n term,\n types,\n ...(specs.length && { specs }),\n ...(typeof forContext === \"string\" && { for: forContext }),\n };\n}\n\n/** @param {HTMLElement} elem */\nexport function getTermFromElement(elem) {\n const { lt: linkingText } = elem.dataset;\n let term = linkingText ? linkingText.split(\"|\", 1)[0] : elem.textContent;\n term = normalize(term);\n return term === \"the-empty-string\" ? \"\" : term;\n}\n\n/**\n * Get spec context as a fallback chain, where each level (sub-array) represents\n * decreasing priority.\n * @param {HTMLElement} elem\n */\nfunction getSpecContext(elem) {\n /** @type {string[][]} */\n const specs = [];\n\n /** @type {HTMLElement} */\n let dataciteElem = elem.closest(\"[data-cite]\");\n\n // Traverse up towards the root element, adding levels of lower priority specs\n while (dataciteElem) {\n const cite = dataciteElem.dataset.cite.toLowerCase().replace(/[!?]/g, \"\");\n const cites = cite.split(/\\s+/).filter(s => s);\n if (cites.length) {\n specs.push(cites);\n }\n if (dataciteElem === elem) break;\n dataciteElem = dataciteElem.parentElement.closest(\"[data-cite]\");\n }\n\n // If element itself contains data-cite, we don't take inline context into\n // account. The inline bibref context has lowest priority, if available.\n if (dataciteElem !== elem) {\n const closestSection = elem.closest(\"section\");\n /** @type {Iterable<HTMLElement>} */\n const bibrefs = closestSection\n ? closestSection.querySelectorAll(\"a.bibref\")\n : [];\n const inlineRefs = [...bibrefs].map(el => el.textContent.toLowerCase());\n if (inlineRefs.length) {\n specs.push(inlineRefs);\n }\n }\n\n const uniqueSpecContext = dedupeSpecContext(specs);\n return uniqueSpecContext;\n}\n\n/**\n * If we already have a spec in a higher priority level (closer to element) of\n * fallback chain, skip it from low priority levels, to prevent duplication.\n * @param {string[][]} specs\n * */\nfunction dedupeSpecContext(specs) {\n /** @type {string[][]} */\n const unique = [];\n for (const level of specs) {\n const higherPriority = unique[unique.length - 1] || [];\n const uniqueSpecs = [...new Set(level)].filter(\n spec => !higherPriority.includes(spec)\n );\n unique.push(uniqueSpecs.sort());\n }\n return unique;\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {boolean} isIDL\n */\nfunction getForContext(elem, isIDL) {\n if (elem.dataset.xrefFor) {\n return normalize(elem.dataset.xrefFor);\n }\n\n if (isIDL) {\n /** @type {HTMLElement} */\n const dataXrefForElem = elem.closest(\"[data-xref-for]\");\n if (dataXrefForElem) {\n return normalize(dataXrefForElem.dataset.xrefFor);\n }\n }\n\n return null;\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {boolean} isIDL\n */\nfunction getTypeContext(elem, isIDL) {\n if (isIDL) {\n if (elem.dataset.xrefType) {\n return elem.dataset.xrefType.split(\"|\");\n }\n return [\"_IDL_\"];\n }\n\n return [\"_CONCEPT_\"];\n}\n\n/**\n * @param {RequestEntry[]} queryKeys\n * @param {string} apiUrl\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nasync function getData(queryKeys, apiUrl) {\n const uniqueIds = new Set();\n const uniqueQueryKeys = queryKeys.filter(key => {\n return uniqueIds.has(key.id) ? false : uniqueIds.add(key.id) && true;\n });\n\n const resultsFromCache = await resolveXrefCache(uniqueQueryKeys);\n\n const termsToLook = uniqueQueryKeys.filter(\n key => !resultsFromCache.get(key.id)\n );\n const fetchedResults = await fetchFromNetwork(termsToLook, apiUrl);\n if (fetchedResults.size) {\n // add data to cache\n await cacheXrefData(uniqueQueryKeys, fetchedResults);\n }\n\n return new Map([...resultsFromCache, ...fetchedResults]);\n}\n\n/**\n * @param {RequestEntry[]} queries\n * @param {string} url\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nasync function fetchFromNetwork(queries, url) {\n if (!queries.length) return new Map();\n\n const options = {\n method: \"POST\",\n body: JSON.stringify({ queries }),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n };\n const response = await fetch(url, options);\n const json = await response.json();\n return new Map(json.results.map(({ id, result }) => [id, result]));\n}\n\n/**\n * Figures out from the tree structure if the reference is\n * normative (true) or informative (false).\n * @param {HTMLElement} elem\n */\nfunction isNormative(elem) {\n const closestNormative = elem.closest(\".normative\");\n const closestInform = elem.closest(nonNormativeSelector);\n if (!closestInform || elem === closestNormative) {\n return true;\n }\n return (\n closestNormative &&\n closestInform &&\n closestInform.contains(closestNormative)\n );\n}\n\n/**\n * adds data-cite attributes to elems for each term for which results are found.\n * adds citations to references section.\n * collects and shows linking errors if any.\n * @param {HTMLElement[]} elems\n * @param {RequestEntry[]} queryKeys\n * @param {Map<string, SearchResultEntry[]>} data\n * @param {any} conf\n */\nfunction addDataCiteToTerms(elems, queryKeys, data, conf) {\n /** @type {Errors} */\n const errors = { ambiguous: new Map(), notFound: new Map() };\n\n for (let i = 0, l = elems.length; i < l; i++) {\n if (elems[i].closest(\"[data-no-xref]\")) continue;\n\n const elem = elems[i];\n const query = queryKeys[i];\n\n const { id } = query;\n const results = data.get(id);\n if (results.length === 1) {\n addDataCite(elem, query, results[0], conf);\n } else {\n const collector = errors[results.length === 0 ? \"notFound\" : \"ambiguous\"];\n if (!collector.has(id)) {\n collector.set(id, { elems: [], results, query });\n }\n collector.get(id).elems.push(elem);\n }\n }\n\n showErrors(errors);\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {RequestEntry} query\n * @param {SearchResultEntry} result\n * @param {any} conf\n */\nfunction addDataCite(elem, query, result, conf) {\n const { term, specs = [] } = query;\n const { uri, shortname, spec, normative, type, for: forContext } = result;\n // if authored spec context had `result.spec`, use it instead of shortname\n const cite = specs.flat().includes(spec) ? spec : shortname;\n // we use this \"partial\" URL to resolve parts of urls...\n // but sometimes we get lucky and we get an absolute URL from xref\n // which we can then use in other places (e.g., data-cite.js)\n const url = new URL(uri, \"https://partial\");\n let { pathname: citePath } = url;\n // final resolution will be against the URL of the spec, which may end with\n // a filename. That filename must be preserved if there's no specific path.\n if (citePath === \"/\") citePath = \"\";\n const citeFrag = url.hash.slice(1);\n const dataset = { cite, citePath, citeFrag, type };\n if (forContext) dataset.linkFor = forContext[0];\n if (url.origin && url.origin !== \"https://partial\") {\n dataset.citeHref = url.href;\n }\n Object.assign(elem.dataset, dataset);\n\n addToReferences(elem, cite, normative, term, conf);\n}\n\n/**\n * add specs for citation (references section)\n * @param {HTMLElement} elem\n * @param {string} cite\n * @param {boolean} normative\n * @param {string} term\n * @param {any} conf\n */\nfunction addToReferences(elem, cite, normative, term, conf) {\n const isNormRef = isNormative(elem);\n if (!isNormRef) {\n // Only add it if not already normative...\n if (!conf.normativeReferences.has(cite)) {\n conf.informativeReferences.add(cite);\n }\n return;\n }\n if (normative) {\n // If it was originally informative, we move the existing\n // key to be normative.\n const existingKey = conf.informativeReferences.has(cite)\n ? conf.informativeReferences.getCanonicalKey(cite)\n : cite;\n conf.normativeReferences.add(existingKey);\n conf.informativeReferences.delete(existingKey);\n return;\n }\n\n // This is used by the informative-dfn linter\n informativeRefsInNormative.push({ term, spec: cite, element: elem });\n}\n\n/** @param {Errors} errors */\nfunction showErrors({ ambiguous, notFound }) {\n const getPrefilledFormURL = (term, query, specs = []) => {\n const url = new URL(API_URL);\n url.searchParams.set(\"term\", term);\n if (query.for) url.searchParams.set(\"for\", query.for);\n url.searchParams.set(\"types\", query.types.join(\",\"));\n if (specs.length) url.searchParams.set(\"specs\", specs.join(\",\"));\n return url.href;\n };\n\n const howToFix = (howToCiteURL, originalTerm) => {\n return docLink`[See search matches for \"${originalTerm}\"](${howToCiteURL}) or ${\"[Learn about this error|#error-term-not-found]\"}.`;\n };\n\n for (const { query, elems } of notFound.values()) {\n const specs = query.specs ? [...new Set(query.specs.flat())].sort() : [];\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query);\n const specsString = joinAnd(specs, s => `**[${s}]**`);\n const hint = howToFix(formUrl, originalTerm);\n const forParent = query.for ? `, for **\"${query.for}\"**, ` : \"\";\n const msg = `Couldn't find \"**${originalTerm}**\"${forParent} in this document or other cited documents: ${specsString}.`;\n const title = \"No matching definition found.\";\n showError(msg, name, { title, elements: elems, hint });\n }\n\n for (const { query, elems, results } of ambiguous.values()) {\n const specs = [...new Set(results.map(entry => entry.shortname))].sort();\n const specsString = joinAnd(specs, s => `**[${s}]**`);\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query, specs);\n const forParent = query.for ? `, for **\"${query.for}\"**, ` : \"\";\n const moreInfo = howToFix(formUrl, originalTerm);\n const hint =\n docLink`To fix, use the ${\"[data-cite]\"} attribute to pick the one you mean from the appropriate specification.` +\n String.raw` ${moreInfo}`;\n const msg = `The term \"**${originalTerm}**\"${forParent} is ambiguous because it's defined in ${specsString}.`;\n const title = \"Definition is ambiguous.\";\n showError(msg, name, { title, elements: elems, hint });\n }\n}\n\nfunction objectHash(obj) {\n const str = JSON.stringify(obj, Object.keys(obj).sort());\n const buffer = new TextEncoder().encode(str);\n return crypto.subtle.digest(\"SHA-1\", buffer).then(bufferToHexString);\n}\n\n/** @param {ArrayBuffer} buffer */\nfunction bufferToHexString(buffer) {\n const byteArray = new Uint8Array(buffer);\n return [...byteArray].map(v => v.toString(16).padStart(2, \"0\")).join(\"\");\n}\n\nfunction cleanup(doc) {\n const elems = doc.querySelectorAll(\n \"a[data-xref-for], a[data-xref-type], a[data-link-for]\"\n );\n const attrToRemove = [\"data-xref-for\", \"data-xref-type\", \"data-link-for\"];\n elems.forEach(el => {\n attrToRemove.forEach(attr => el.removeAttribute(attr));\n });\n}\n","/*\n@module \"core/dfn-index\"\nExtends and overrides some styles from `base.css`.\n*/\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nul.index {\n columns: 30ch;\n column-gap: 1.5em;\n}\n\nul.index li {\n list-style: inherit;\n}\n\nul.index li span {\n color: inherit;\n cursor: pointer;\n white-space: normal;\n}\n\n#index-defined-here ul.index li {\n font-size: 0.9rem;\n}\n\nul.index code {\n color: inherit;\n}\n\n#index-defined-here .print-only {\n display: none;\n}\n\n@media print {\n #index-defined-here .print-only {\n display: initial;\n }\n}\n`;\n","// @ts-check\n/**\n * If a `<section id=\"index\">` exists, it is filled by a list of terms defined\n * (locally) by current document and a list of terms referenced (external) by\n * current document.\n */\n\nimport { addId, getIntlData, norm, xmlEscape } from \"./utils.js\";\nimport css from \"../styles/dfn-index.css.js\";\nimport { getTermFromElement } from \"./xref.js\";\nimport { html } from \"./import-maps.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\nimport { sub } from \"./pubsubhub.js\";\nimport { toCiteDetails } from \"./data-cite.js\";\n\nexport const name = \"core/dfn-index\";\n\nconst localizationStrings = {\n en: {\n heading: \"Index\",\n headingExternal: \"Terms defined by reference\",\n headlingLocal: \"Terms defined by this specification\",\n dfnOf: \"definition of\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Terms of these _types_ are wrapped in `<code>`.\nconst CODE_TYPES = new Set([\n \"attribute\",\n \"callback\",\n \"dict-member\",\n \"dictionary\",\n \"element-attr\",\n \"element\",\n \"enum-value\",\n \"enum\",\n \"exception\",\n \"extended-attribute\",\n \"interface\",\n \"method\",\n \"typedef\",\n]);\n\n/**\n * @typedef {{ term: string, type: string, linkFor: string, elem: HTMLAnchorElement }} Entry\n */\n\nexport function run() {\n const index = document.querySelector(\"section#index\");\n if (!index) {\n // See below...\n sub(\"toc\", () => {}, { once: true });\n return;\n }\n\n const styleEl = document.createElement(\"style\");\n styleEl.textContent = css;\n document.head.appendChild(styleEl);\n\n index.classList.add(\"appendix\");\n if (!index.querySelector(\"h2, h1\")) {\n index.prepend(html`<h1>${l10n.heading}</h1>`);\n }\n\n const localTermIndex = html`<section id=\"index-defined-here\">\n <h3>${l10n.headlingLocal}</h3>\n ${createLocalTermIndex()}\n </section>`;\n index.append(localTermIndex);\n\n const externalTermIndex = html`<section id=\"index-defined-elsewhere\">\n <h3>${l10n.headingExternal}</h3>\n ${createExternalTermIndex()}\n </section>`;\n index.append(externalTermIndex);\n for (const el of externalTermIndex.querySelectorAll(\".index-term\")) {\n addId(el, \"index-term\");\n }\n\n // XXX: This event is used to overcome an edge case with core/structure,\n // related to a circular dependency in plugin run order. We want\n // core/structure to run after dfn-index so the #index can be listed in the\n // TOC, but we also want section numbers in dfn-index. So, we \"split\"\n // core/dfn-index in two parts, one that runs before core/structure (using\n // plugin order in profile) and the other (following) after section numbers\n // are generated in core/structure (this event).\n sub(\"toc\", appendSectionNumbers, { once: true });\n\n sub(\"beforesave\", cleanup);\n}\n\nfunction createLocalTermIndex() {\n const dataSortedByTerm = collectLocalTerms();\n return html`<ul class=\"index\">\n ${dataSortedByTerm.map(([term, dfns]) => renderLocalTerm(term, dfns))}\n </ul>`;\n}\n\nfunction collectLocalTerms() {\n /** @type {Map<string, HTMLElement[]>} */\n const data = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"dfn:not([data-cite])\");\n for (const elem of elems) {\n if (!elem.id) continue;\n const text = norm(elem.textContent);\n const elemsByTerm = data.get(text) || data.set(text, []).get(text);\n elemsByTerm.push(elem);\n }\n\n const dataSortedByTerm = [...data].sort(([a], [b]) =>\n a.slice(a.search(/\\w/)).localeCompare(b.slice(b.search(/\\w/)))\n );\n\n return dataSortedByTerm;\n}\n\n/**\n * @param {string} term\n * @param {HTMLElement[]} dfns\n * @returns {HTMLLIElement}\n */\nfunction renderLocalTerm(term, dfns) {\n const renderItem = (dfn, text, suffix) => {\n const href = `#${dfn.id}`;\n return html`<li data-id=${dfn.id}>\n <a class=\"index-term\" href=\"${href}\">${{ html: text }}</a> ${suffix\n ? { html: suffix }\n : \"\"}\n </li>`;\n };\n\n if (dfns.length === 1) {\n const dfn = dfns[0];\n const type = getLocalTermType(dfn);\n const text = getLocalTermText(dfn, type, term);\n const suffix = getLocalTermSuffix(dfn, type, term);\n return renderItem(dfn, text, suffix);\n }\n return html`<li>\n ${term}\n <ul>\n ${dfns.map(dfn => {\n const type = getLocalTermType(dfn);\n const text = getLocalTermSuffix(dfn, type, term) || l10n.dfnOf;\n return renderItem(dfn, text);\n })}\n </ul>\n </li>`;\n}\n\n/** @param {HTMLElement} dfn */\nfunction getLocalTermType(dfn) {\n const ds = dfn.dataset;\n const type = ds.dfnType || ds.idl || ds.linkType || \"\";\n switch (type) {\n case \"\":\n case \"dfn\":\n return \"\";\n default:\n return type;\n }\n}\n\n/** @param {HTMLElement} dfn */\nfunction getLocalTermParentContext(dfn) {\n /** @type {HTMLElement} */\n const dfnFor = dfn.closest(\"[data-dfn-for]:not([data-dfn-for=''])\");\n return dfnFor ? dfnFor.dataset.dfnFor : \"\";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} type\n * @param {string} term\n */\nfunction getLocalTermText(dfn, type, term) {\n let text = term;\n if (type === \"enum-value\") {\n text = `\"${text}\"`;\n }\n if (CODE_TYPES.has(type) || dfn.dataset.idl || dfn.closest(\"code\")) {\n text = `<code>${text}</code>`;\n }\n return text;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} type\n * @param {string} [term=\"\"]\n */\nfunction getLocalTermSuffix(dfn, type, term = \"\") {\n if (term.startsWith(\"[[\")) {\n const parent = getLocalTermParentContext(dfn);\n return `internal slot for <code>${parent}</code>`;\n }\n\n switch (type) {\n case \"dict-member\":\n case \"method\":\n case \"attribute\":\n case \"enum-value\": {\n const typeText =\n type === \"dict-member\" ? \"member\" : type.replace(\"-\", \" \");\n const parent = getLocalTermParentContext(dfn);\n return `${typeText} for <code>${parent}</code>`;\n }\n case \"interface\":\n case \"dictionary\":\n case \"enum\": {\n return type;\n }\n case \"constructor\": {\n const parent = getLocalTermParentContext(dfn);\n return `for <code>${parent}</code>`;\n }\n default:\n return \"\";\n }\n}\n\nfunction appendSectionNumbers() {\n const getSectionNumber = id => {\n const dfn = document.getElementById(id);\n const sectionNumberEl = dfn.closest(\"section\").querySelector(\".secno\");\n const secNum = `Ā§${sectionNumberEl.textContent.trim()}`;\n return html`<span class=\"print-only\">${secNum}</span>`;\n };\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"#index-defined-here li[data-id]\");\n elems.forEach(el => el.append(getSectionNumber(el.dataset.id)));\n}\n\nfunction createExternalTermIndex() {\n const data = collectExternalTerms();\n const dataSortedBySpec = [...data.entries()].sort(([specA], [specB]) =>\n specA.localeCompare(specB)\n );\n return html`<ul class=\"index\">\n ${dataSortedBySpec.map(([spec, entries]) => {\n return html`<li data-spec=\"${spec}\">\n ${renderInlineCitation(spec)} defines the following:\n <ul>\n ${entries\n .sort((a, b) => a.term.localeCompare(b.term))\n .map(renderExternalTermEntry)}\n </ul>\n </li>`;\n })}\n </ul>`;\n}\n\nfunction collectExternalTerms() {\n /** @type {Set<string>} */\n const uniqueReferences = new Set();\n /** @type {Map<string, Entry[]>} spec => entry[] */\n const data = new Map();\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elements = document.querySelectorAll(`a[data-cite]`);\n for (const elem of elements) {\n if (!elem.dataset.cite) {\n continue;\n }\n const { cite, citeFrag, xrefType, linkType } = elem.dataset;\n if (!(xrefType || linkType || cite.includes(\"#\") || citeFrag)) {\n // Not a reference to a definition\n continue;\n }\n const uniqueID = elem.href;\n if (uniqueReferences.has(uniqueID)) {\n continue;\n }\n\n const { type, linkFor } = elem.dataset;\n const term = getTermFromElement(elem);\n if (!term) {\n continue; // <a data-cite=\"SPEC\"></a>\n }\n const spec = toCiteDetails(elem).key.toUpperCase();\n\n const entriesBySpec = data.get(spec) || data.set(spec, []).get(spec);\n entriesBySpec.push({ term, type, linkFor, elem });\n uniqueReferences.add(uniqueID);\n }\n\n return data;\n}\n\n/**\n * @param {Entry} entry\n * @returns {HTMLLIElement}\n */\nfunction renderExternalTermEntry(entry) {\n const { elem } = entry;\n const text = getTermText(entry);\n const el = html`<li>\n <span class=\"index-term\" data-href=\"${elem.href}\">${{ html: text }}</span>\n </li>`;\n return el;\n}\n\n// Terms of these _types_ are suffixed with their type info.\nconst TYPED_TYPES = new Map([\n [\"attribute\", \"attribute\"],\n [\"element-attr\", \"attribute\"],\n [\"element\", \"element\"],\n [\"enum\", \"enum\"],\n [\"exception\", \"exception\"],\n [\"extended-attribute\", \"extended attribute\"],\n [\"interface\", \"interface\"],\n]);\n\n// These _terms_ have type suffix \"type\".\nconst TYPE_TERMS = new Set([\n // Following are primitive types as per WebIDL spec:\n \"boolean\",\n \"byte\",\n \"octet\",\n \"short\",\n \"unsigned short\",\n \"long\",\n \"unsigned long\",\n \"long long\",\n \"unsigned long long\",\n \"float\",\n \"unrestricted float\",\n \"double\",\n \"unrestricted double\",\n // Following are not primitive types, but aren't interfaces either.\n \"undefined\",\n \"any\",\n \"object\",\n \"symbol\",\n]);\n\n/** @param {Entry} entry */\nfunction getTermText(entry) {\n const { term, type, linkFor } = entry;\n let text = xmlEscape(term);\n\n if (CODE_TYPES.has(type)) {\n if (type === \"extended-attribute\") {\n text = `[${text}]`;\n }\n text = `<code>${text}</code>`;\n }\n\n const typeSuffix = TYPE_TERMS.has(term) ? \"type\" : TYPED_TYPES.get(type);\n if (typeSuffix) {\n text += ` ${typeSuffix}`;\n }\n\n if (linkFor) {\n let linkForText = linkFor;\n if (!/\\s/.test(linkFor)) {\n // If linkFor is a single word, highlight it.\n linkForText = `<code>${linkForText}</code>`;\n }\n if (type === \"element-attr\") {\n linkForText += \" element\";\n }\n text += ` (for ${linkForText})`;\n }\n\n return text;\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n doc\n .querySelectorAll(\"#index-defined-elsewhere li[data-spec]\")\n .forEach(el => el.removeAttribute(\"data-spec\"));\n\n doc\n .querySelectorAll(\"#index-defined-here li[data-id]\")\n .forEach(el => el.removeAttribute(\"data-id\"));\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name);\n console.error(error);\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n/**\n * Module: core/webidl-index\n * constructs a summary of WebIDL in the document by\n * cloning all the generated WebIDL nodes and\n * appending them to pre element.\n *\n * Usage\n * Add a <section id=\"idl-index\"> to the document.\n * It also supports title elements to generate a header.\n * Or if a header element is an immediate child, then\n * that is preferred.\n */\nexport const name = \"core/webidl-index\";\nimport { nonNormativeSelector, wrapInner } from \"./utils.js\";\nimport { addIDLHeader } from \"./webidl.js\";\n\nexport function run() {\n /** @type {HTMLElement | null} */\n const idlIndexSec = document.querySelector(\"section#idl-index\");\n if (!idlIndexSec) {\n return;\n }\n // Query for decedents headings, e.g., \"h2:first-child, etc..\"\n const query = [2, 3, 4, 5, 6].map(level => `h${level}:first-child`).join(\",\");\n if (!idlIndexSec.querySelector(query)) {\n const header = document.createElement(\"h2\");\n if (idlIndexSec.title) {\n header.textContent = idlIndexSec.title;\n idlIndexSec.removeAttribute(\"title\");\n } else {\n header.textContent = \"IDL Index\";\n }\n idlIndexSec.prepend(header);\n }\n\n // filter out the IDL marked with class=\"exclude\" and the IDL in non-normative sections\n const idlIndex = Array.from(\n document.querySelectorAll(\"pre.idl:not(.exclude) > code\")\n ).filter(idl => !idl.closest(nonNormativeSelector));\n\n if (idlIndex.length === 0) {\n const text = \"This specification doesn't normatively declare any Web IDL.\";\n idlIndexSec.append(text);\n return;\n }\n\n const pre = document.createElement(\"pre\");\n pre.classList.add(\"idl\", \"def\");\n pre.id = \"actual-idl-index\";\n idlIndex\n .map(elem => {\n const fragment = document.createDocumentFragment();\n for (const child of elem.children) {\n fragment.appendChild(child.cloneNode(true));\n }\n return fragment;\n })\n .forEach(elem => {\n if (pre.lastChild) {\n pre.append(\"\\n\\n\");\n }\n pre.appendChild(elem);\n });\n // Remove duplicate IDs\n pre.querySelectorAll(\"*[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n\n // Add our own IDL header\n idlIndexSec.appendChild(pre);\n wrapInner(pre, document.createElement(\"code\"));\n addIDLHeader(pre);\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大ēŗ²\",\n },\n ko: {\n toc: \"ėŖ©ģ°Ø\",\n },\n ja: {\n toc: \"ē›®ę¬”\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at Ā§1, we will keep Ā§1.1 but not Ā§1.1.1\n // Similarly, `data-max-toc=1` will keep Ā§1, but not Ā§1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"ģ“ ė¶€ė¶„ģ€ ė¹„ź·œė²”ģ ģž…ė‹ˆė‹¤.\",\n },\n ja: {\n informative: \"恓恮ēƀćÆä»•ę§˜ć«ćÆå«ć¾ć‚Œć¾ć›ć‚“ļ¼Ž\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","/* container for stats */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n\n.caniuse-stats {\n display: flex;\n column-gap: 2em;\n}\n\n.caniuse-group {\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: flex-end;\n flex-basis: auto;\n}\n\n.caniuse-browsers {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n flex-wrap: wrap;\n margin-top: .2em;\n column-gap: .4em;\n border-bottom: 1px solid #ccc;\n row-gap: .4em;\n padding-bottom: .4cm;\n}\n\n.caniuse-type {\n align-self: center;\n border-top: none;\n text-transform: capitalize;\n font-size: .8em;\n margin-top: -.8em;\n font-weight: bold;\n}\n\n.caniuse-type span {\n background-color: var(--bg, white);\n padding: 0 0.4em;\n}\n\n/* a browser version */\n.caniuse-cell {\n align-items: center;\n border-radius: 1cm;\n color: #fff;\n display: flex;\n font-size: 90%;\n min-width: 1.5cm;\n padding: .3rem;\n justify-content: space-evenly;\n --supported: #2a8436dd;\n --no-support: #c44230dd;\n --no-support-alt: #b43b2bdd;\n --partial: #807301dd;\n --partial-alt: #746c00dd;\n --unknown: #757575;\n\n background: repeating-linear-gradient(\n var(--caniuse-angle, 45deg),\n var(--caniuse-bg) 0,\n var(--caniuse-bg-alt) 1px,\n var(--caniuse-bg-alt) 0.4em,\n var(--caniuse-bg) calc(0.25em + 1px),\n var(--caniuse-bg) 0.75em\n );\n}\n\nimg.caniuse-browser {\n filter: drop-shadow(0px 0px .1cm #666666);\n background: transparent;\n}\n\n.caniuse-cell span.browser-version {\n margin-left: 0.4em;\n text-shadow: 0 0 0.1em #fff;\n font-weight: 100;\n font-size: .9em;\n}\n\n.caniuse-stats a[href] {\n white-space: nowrap;\n align-self: flex-end;\n}\n\n/* supports */\n.caniuse-cell.y {\n background: var(--supported);\n}\n\n/* no support, disabled by default */\n.caniuse-cell:is(.n,.d) {\n --caniuse-angle: 45deg;\n --caniuse-bg: var(--no-support);\n --caniuse-bg-alt: var(--no-support-alt);\n}\n\n.caniuse-cell.u {\n background: var(--unknown);\n}\n\n.caniuse-cell.d {\n --caniuse-angle: 180deg;\n}\n\n/* not supported by default / partial support etc\nsee https://github.com/Fyrd/caniuse/blob/master/CONTRIBUTING.md for stats */\n.caniuse-cell:is(.a,.x,.p) {\n --caniuse-angle: 90deg;\n --caniuse-bg: var(--partial);\n --caniuse-bg-alt: var(--partial-alt);\n}\n\n/* handle case when printing */\n@media print {\n .caniuse-cell.y::before {\n content: \"āœ”ļø\";\n padding: 0.5em;\n }\n\n .caniuse-cell.n::before {\n content: \"āŒ\";\n padding: 0.5em;\n }\n\n .caniuse-cell:is(.a,.d,.p,.x,.u)::before {\n content: \"āš ļø\";\n padding: 0.5em;\n }\n}\n`;\n","// @ts-check\n/**\n * Module: \"core/caniuse\"\n * Adds a caniuse support table for a \"feature\" #1238\n * Usage options: https://github.com/speced/respec/wiki/caniuse\n */\nimport { codedJoinAnd, docLink, showError, showWarning } from \"./utils.js\";\nimport { pub, sub } from \"./pubsubhub.js\";\nimport css from \"../styles/caniuse.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/caniuse\";\n\nconst API_URL = \"https://respec.org/caniuse/\";\n\nexport const BROWSERS = new Map([\n [\"and_chr\", { name: \"Android Chrome\", path: \"chrome\", type: \"mobile\" }],\n [\"and_ff\", { name: \"Android Firefox\", path: \"firefox\", type: \"mobile\" }],\n [\"and_uc\", { name: \"Android UC\", path: \"uc\", type: \"mobile\" }],\n [\"chrome\", { name: \"Chrome\", type: \"desktop\" }],\n [\"edge\", { name: \"Edge\", type: \"desktop\" }],\n [\"firefox\", { name: \"Firefox\", type: \"desktop\" }],\n [\"ios_saf\", { name: \"iOS Safari\", path: \"safari-ios\", type: \"mobile\" }],\n [\"op_mob\", { name: \"Opera Mobile\", path: \"opera\", type: \"mobile\" }],\n [\"opera\", { name: \"Opera\", type: \"desktop\" }],\n [\"safari\", { name: \"Safari\", type: \"desktop\" }],\n [\n \"samsung\",\n { name: \"Samsung Internet\", path: \"samsung-internet\", type: \"mobile\" },\n ],\n]);\n\nconst statToText = new Map([\n [\"a\", \"almost supported (aka Partial support)\"],\n [\"d\", \"disabled by default\"],\n [\"n\", \"no support, or disabled by default\"],\n [\"p\", \"no support, but has Polyfill\"],\n [\"u\", \"unknown support\"],\n [\"x\", \"requires prefix to work\"],\n [\"y\", \"supported by default\"],\n]);\n\nexport function prepare(conf) {\n if (!conf.caniuse) {\n return; // nothing to do.\n }\n normalizeCaniuseConf(conf);\n validateBrowsers(conf);\n const options = conf.caniuse;\n if (!options.feature) {\n return; // no feature to show\n }\n\n document.head.appendChild(\n html`<style\n id=\"caniuse-stylesheet\"\n class=\"${options.removeOnSave ? \"removeOnSave\" : \"\"}\"\n >\n ${css}\n </style>`\n );\n}\n/**\n * @param {string} browser\n * @returns\n */\nfunction getLogoSrc(browser) {\n const path = BROWSERS.get(browser).path ?? browser;\n return `https://www.w3.org/assets/logos/browser-logos/${path}/${path}.svg`;\n}\n\nexport async function run(conf) {\n const options = conf.caniuse;\n if (!options?.feature) return;\n\n const featureURL = new URL(options.feature, \"https://caniuse.com/\").href;\n const headDlElem = document.querySelector(\".head dl\");\n const contentPromise = fetchStats(conf.caniuse)\n .then(json => processJson(json, options))\n .catch(err => handleError(err, options, featureURL));\n const definitionPair = html`<dt class=\"caniuse-title\">Browser support:</dt>\n <dd class=\"caniuse-stats\">\n ${{\n any: contentPromise,\n placeholder: \"Fetching data from caniuse.com...\",\n }}\n </dd>`;\n headDlElem.append(...definitionPair.childNodes);\n await contentPromise;\n pub(\"amend-user-config\", { caniuse: options.feature });\n if (options.removeOnSave) {\n // Will remove the browser support cells.\n headDlElem\n .querySelectorAll(\".caniuse-browser\")\n .forEach(elem => elem.classList.add(\"removeOnSave\"));\n sub(\"beforesave\", outputDoc => {\n html.bind(outputDoc.querySelector(\".caniuse-stats\"))`\n <a href=\"${featureURL}\">caniuse.com</a>`;\n });\n }\n}\n\nfunction handleError(err, options, featureURL) {\n const msg = `Failed to retrieve feature \"${options.feature}\".`;\n const hint = docLink`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${\"[caniuse]\"}.`;\n showError(msg, name, { hint });\n console.error(err);\n return html`<a href=\"${featureURL}\">caniuse.com</a>`;\n}\n\n/**\n * returns normalized `conf.caniuse` configuration\n * @param {Object} conf configuration settings\n */\nfunction normalizeCaniuseConf(conf) {\n const defaultBrowsers = new Set(BROWSERS.keys());\n defaultBrowsers.delete(\"op_mob\");\n defaultBrowsers.delete(\"opera\");\n const DEFAULTS = { removeOnSave: true, browsers: [...defaultBrowsers] };\n if (typeof conf.caniuse === \"string\") {\n conf.caniuse = { feature: conf.caniuse, ...DEFAULTS };\n return;\n }\n conf.caniuse = { ...DEFAULTS, ...conf.caniuse };\n}\n\nfunction validateBrowsers({ caniuse }) {\n const { browsers } = caniuse;\n const invalidBrowsers = browsers.filter(browser => !BROWSERS.has(browser));\n if (invalidBrowsers.length) {\n const names = codedJoinAnd(invalidBrowsers, { quotes: true });\n const msg = docLink`Invalid browser(s): (${names}) in the \\`browser\\` property of ${\"[caniuse]\"}.`;\n showWarning(msg, name);\n }\n}\n\nasync function processJson(json, { feature }) {\n /** @type {Array} */\n const results = json.result;\n const groups = new Map([\n [\"desktop\", []],\n [\"mobile\", []],\n ]);\n const toBrowserCell = browserCellRenderer(feature);\n results.reduce(toBrowserCell, groups);\n const out = [...groups]\n .filter(([, arr]) => arr.length)\n .map(\n ([key, arr]) =>\n html`<div class=\"caniuse-group\">\n <div class=\"caniuse-browsers\">${arr}</div>\n <div class=\"caniuse-type\"><span>${key}</div>\n </div>`\n );\n out.push(\n html`<a class=\"caniuse-cell\" href=\"https://caniuse.com/${feature}\"\n >More info</a\n >`\n );\n return out;\n}\n\nfunction browserCellRenderer(feature) {\n return (groups, { browser: browserId, version, caniuse }) => {\n const { name, type } = BROWSERS.get(browserId);\n const versionLong = version ? ` version ${version}` : \"\";\n const browserName = `${name}${versionLong}`;\n const supportLevel = statToText.get(caniuse);\n const ariaLabel = `${feature} is ${supportLevel} since ${browserName} on ${type}.`;\n const cssClass = `caniuse-cell ${caniuse}`;\n const title = capitalize(`${supportLevel} since ${browserName}.`);\n const textVersion = version ? version : \"ā€”\";\n const src = getLogoSrc(browserId);\n const result = html`\n <div class=\"${cssClass}\" title=\"${title}\" aria-label=\"${ariaLabel}\">\n <img\n class=\"caniuse-browser\"\n width=\"20\"\n height=\"20\"\n src=\"${src}\"\n alt=\"${name} logo\"\n /><span class=\"browser-version\">${textVersion}</span>\n </div>\n `;\n groups.get(type).push(result);\n return groups;\n };\n}\n\n/**\n * @typedef {Record<string, [string, string[]][]>} ApiResponse\n * @throws {Error} on failure\n */\nasync function fetchStats(options) {\n const { feature, browsers, apiURL } = options;\n const url = new URL(apiURL || `./${feature}`, API_URL);\n browsers.forEach(browser => url.searchParams.append(\"browsers\", browser));\n const response = await fetch(url);\n if (!response.ok) {\n const { status, statusText } = response;\n throw new Error(`Failed to get caniuse data: (${status}) ${statusText}`);\n }\n return response.json();\n}\n\nfunction capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.mdn {\n font-size: 0.75em;\n position: absolute;\n right: 0.3em;\n min-width: 0;\n margin-top: 3rem;\n}\n\n.mdn details {\n width: 100%;\n margin: 1px 0;\n position: relative;\n z-index: 10;\n box-sizing: border-box;\n padding: 0.4em;\n padding-top: 0;\n}\n\n.mdn details[open] {\n min-width: 25ch;\n max-width: 32ch;\n background: #fff;\n background: var(--indextable-hover-bg, #fff);\n color: black;\n color: var(--indextable-hover-text, black);\n box-shadow:\n 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow:\n 0 1em 3em -0.4em var(--tocsidebar-shadow, rgba(0, 0, 0, 0.3)),\n 0 0 1px 1px var(--tocsidebar-shadow, rgba(0, 0, 0, 0.05));\n border-radius: 2px;\n z-index: 11;\n margin-bottom: 0.4em;\n}\n\n.mdn summary {\n text-align: right;\n cursor: default;\n margin-right: -0.4em;\n}\n\n.mdn summary span {\n font-family: zillaslab, Palatino, \"Palatino Linotype\", serif;\n color: #fff;\n color: var(--bg, #fff);\n background-color: #000;\n background-color: var(--text, #000);\n display: inline-block;\n padding: 3px;\n}\n\n.mdn a {\n display: inline-block;\n word-break: break-all;\n}\n\n.mdn p {\n margin: 0;\n}\n\n.mdn .engines-all {\n color: #058b00;\n}\n.mdn .engines-some {\n color: #b00;\n}\n\n.mdn table {\n width: 100%;\n font-size: 0.9em;\n}\n\n.mdn td {\n border: none;\n}\n\n.mdn td:nth-child(2) {\n text-align: right;\n}\n\n.mdn .nosupportdata {\n font-style: italic;\n margin: 0;\n}\n\n.mdn tr::before {\n content: \"\";\n display: table-cell;\n width: 1.5em;\n height: 1.5em;\n background: no-repeat center center / contain;\n font-size: 0.75em;\n}\n\n.mdn .no,\n.mdn .unknown {\n color: #cccccc;\n filter: grayscale(100%);\n}\n\n.mdn .no::before,\n.mdn .unknown::before {\n opacity: 0.5;\n}\n\n.mdn .chrome::before,\n.mdn .chrome_android::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/chrome/chrome.svg);\n}\n\n.mdn .edge::before,\n.mdn .edge_mobile::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/edge/edge.svg);\n}\n\n.mdn .firefox::before,\n.mdn .firefox_android::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/firefox/firefox.svg);\n}\n\n.mdn .opera::before,\n.mdn .opera_android::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/opera/opera.svg);\n}\n\n.mdn .safari::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/safari/safari.svg);\n}\n\n.mdn .safari_ios::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/safari-ios/safari-ios.svg);\n}\n\n.mdn .samsunginternet_android::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/samsung-internet/samsung-internet.svg);\n}\n\n.mdn .webview_android::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/android-webview/android-webview.png);\n}\n`;\n","// @ts-check\nimport { fetchAndCache, getIntlData, showError } from \"./utils.js\";\nimport css from \"../styles/mdn-annotation.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/mdn-annotation\";\n\nconst BASE_JSON_PATH = \"https://w3c.github.io/mdn-spec-links/\";\nconst MDN_URL_BASE = \"https://developer.mozilla.org/en-US/docs/Web/\";\nconst MDN_BROWSERS = {\n // The browser IDs here must match the ones in the imported JSON data.\n // See the list of browser IDs at:\n // https://github.com/mdn/browser-compat-data/blob/master/schemas/compat-data-schema.md#browser-identifiers.\n chrome: \"Chrome\",\n chrome_android: \"Chrome Android\",\n edge: \"Edge\",\n edge_mobile: \"Edge Mobile\",\n firefox: \"Firefox\",\n firefox_android: \"Firefox Android\",\n // nodejs: \"Node.js\", // no data for features in HTML\n opera: \"Opera\",\n opera_android: \"Opera Android\",\n // qq_android: \"QQ Browser\", // not enough data for features in HTML\n safari: \"Safari\",\n safari_ios: \"Safari iOS\",\n samsunginternet_android: \"Samsung Internet\",\n // uc_android: \"UC browser\", // not enough data for features in HTML\n // uc_chinese_android: \"Chinese UC Browser\", // not enough data for features in HTML\n webview_android: \"WebView Android\",\n};\n\nconst localizationStrings = {\n en: {\n inAllEngines: \"This feature is in all major engines.\",\n inSomeEngines: \"This feature has limited support.\",\n },\n zh: {\n inAllEngines: \"ꉀ꜉äø»č¦å¼•ę“Žå‡ę”Æꌁꭤē‰¹ę€§ć€‚\",\n inSomeEngines: \"ę­¤åŠŸčƒ½ę”Æꌁ꜉限怂\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {HTMLElement} node\n */\nfunction insertMDNBox(node) {\n const targetAncestor = node.closest(\"section\");\n if (!targetAncestor) return;\n const { previousElementSibling: targetSibling } = targetAncestor;\n if (targetSibling && targetSibling.classList.contains(\"mdn\")) {\n // If the target ancestor already has a mdnBox inserted, we just use it\n return targetSibling;\n }\n const mdnBox = html`<aside class=\"mdn\"></aside>`;\n targetAncestor.before(mdnBox);\n return mdnBox;\n}\n\n/**\n * @param {MdnEntry} mdnSpec\n * @returns {HTMLDetailsElement}\n */\nfunction attachMDNDetail(mdnSpec) {\n const { name, slug, summary, support, engines } = mdnSpec;\n const mdnSubPath = slug.slice(slug.indexOf(\"/\") + 1);\n const href = `${MDN_URL_BASE}${slug}`;\n const label = `Expand MDN details for ${name}`;\n const engineSupport = getEngineSupportIcons(engines);\n return html`<details>\n <summary aria-label=\"${label}\"><span>MDN</span>${engineSupport}</summary>\n <a title=\"${summary}\" href=\"${href}\">${mdnSubPath}</a>\n ${getEngineSupport(engines)}\n ${support\n ? buildBrowserSupportTable(support)\n : html`<p class=\"nosupportdata\">No support data.</p>`}\n </details>`;\n}\n\n/**\n * @param {MdnEntry['support']} support\n * @returns {HTMLTableElement}\n */\nfunction buildBrowserSupportTable(support) {\n /**\n * @param {string | keyof MDN_BROWSERS} browserId\n * @param {\"Yes\" | \"No\" | \"Unknown\"} yesNoUnknown\n * @param {string} version\n * @returns {HTMLTableRowElement}\n */\n function createRow(browserId, yesNoUnknown, version) {\n const displayStatus = yesNoUnknown === \"Unknown\" ? \"?\" : yesNoUnknown;\n const classList = `${browserId} ${yesNoUnknown.toLowerCase()}`;\n return html`<tr class=\"${classList}\">\n <td>${MDN_BROWSERS[browserId]}</td>\n <td>${version ? version : displayStatus}</td>\n </tr>`;\n }\n\n /**\n * @param {string | keyof MDN_BROWSERS} browserId\n * @param {VersionDetails} versionData\n */\n function createRowFromBrowserData(browserId, versionData) {\n if (versionData.version_removed) {\n return createRow(browserId, \"No\", \"\");\n }\n const versionAdded = versionData.version_added;\n if (typeof versionAdded === \"boolean\") {\n return createRow(browserId, versionAdded ? \"Yes\" : \"No\", \"\");\n } else if (!versionAdded) {\n return createRow(browserId, \"Unknown\", \"\");\n } else {\n return createRow(browserId, \"Yes\", `${versionAdded}+`);\n }\n }\n\n return html`<table>\n ${Object.keys(MDN_BROWSERS).map(browserId => {\n return support[browserId]\n ? createRowFromBrowserData(browserId, support[browserId])\n : createRow(browserId, \"Unknown\", \"\");\n })}\n </table>`;\n}\n\nexport async function run(conf) {\n const mdnKey = getMdnKey(conf);\n if (!mdnKey) return;\n\n const mdnSpecJson = await getMdnData(mdnKey, conf.mdn);\n if (!mdnSpecJson) return;\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.append(style);\n\n for (const elem of findElements(mdnSpecJson)) {\n const mdnSpecArray = mdnSpecJson[elem.id];\n const mdnBox = insertMDNBox(elem);\n if (!mdnBox) continue;\n for (const spec of mdnSpecArray) {\n mdnBox.append(attachMDNDetail(spec));\n }\n }\n}\n\n/** @returns {string} */\nfunction getMdnKey(conf) {\n const { shortName, mdn } = conf;\n if (!mdn) return;\n if (typeof mdn === \"string\") return mdn;\n return mdn.key || shortName;\n}\n\n/**\n * @param {string} key MDN key\n * @param {object} mdnConf\n * @param {string} [mdnConf.specMapUrl]\n * @param {string} [mdnConf.baseJsonPath]\n * @param {number} [mdnConf.maxAge]\n *\n * @typedef {{ version_added: string|boolean|null, version_removed?: string }} VersionDetails\n * @typedef {Record<string | keyof MDN_BROWSERS, VersionDetails>} MdnSupportEntry\n * @typedef {{ name: string, title: string, slug: string, summary: string, support: MdnSupportEntry, engines: string[] }} MdnEntry\n * @typedef {Record<string, MdnEntry[]>} MdnData\n * @returns {Promise<MdnData|undefined>}\n */\nasync function getMdnData(key, mdnConf) {\n const { baseJsonPath = BASE_JSON_PATH, maxAge = 60 * 60 * 24 * 1000 } =\n mdnConf;\n const url = new URL(`${key}.json`, baseJsonPath).href;\n const res = await fetchAndCache(url, maxAge);\n if (res.status === 404) {\n const msg = `Could not find MDN data associated with key \"${key}\".`;\n const hint = \"Please add a valid key to `respecConfig.mdn`\";\n showError(msg, name, { hint });\n return;\n }\n return await res.json();\n}\n\n/**\n * Find elements that can have an annotation box attached.\n * @param {MdnData} data\n */\nfunction findElements(data) {\n /** @type {NodeListOf<HTMLElement>} */\n const elemsWithId = document.body.querySelectorAll(\"[id]:not(script)\");\n return [...elemsWithId].filter(({ id }) => Array.isArray(data[id]));\n}\n\n/**\n * @param {MdnEntry['engines']} engines\n * @returns {HTMLSpanElement}\n */\nfunction getEngineSupportIcons(engines) {\n if (engines.length === 3) {\n return html`<span title=\"${l10n.inAllEngines}\">āœ…</span>`;\n }\n if (engines.length < 2) {\n return html`<span title=\"${l10n.inSomeEngines}\">šŸš«</span>`;\n }\n return html`<span> </span>`;\n}\n\n/**\n * @param {MdnEntry['engines']} engines\n * @returns {HTMLParagraphElement|undefined}\n */\nfunction getEngineSupport(engines) {\n if (engines.length === 3) {\n return html`<p class=\"engines-all\">${l10n.inAllEngines}</p>`;\n }\n if (engines.length < 2) {\n return html`<p class=\"engines-some\">${l10n.inSomeEngines}</p>`;\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"äæå­˜ć™ć‚‹\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"åƼå‡ŗ\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"šŸ’¾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/search-specref\n// Search Specref database\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/specref/\";\n\nconst localizationStrings = {\n en: {\n search_specref: \"Search Specref\",\n },\n nl: {\n search_specref: \"Doorzoek Specref\",\n },\n ja: {\n search_specref: \"ä»•ę§˜ę¤œē“¢\",\n },\n de: {\n search_specref: \"Spezifikationen durchsuchen\",\n },\n zh: {\n search_specref: \"ꐜē“¢ Specref\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst button = ui.addCommand(\n l10n.search_specref,\n show,\n \"Ctrl+Shift+Alt+space\",\n \"šŸ”Ž\"\n);\n\nfunction show() {\n const onLoad = e => e.target.classList.add(\"ready\");\n /** @type {HTMLElement} */\n const specrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=${onLoad}></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.search_specref, specrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/search-xref\n// Search xref database\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/xref/\";\n\nconst localizationStrings = {\n en: {\n title: \"Search definitions\",\n },\n ja: {\n title: \"定ē¾©ę¤œē“¢\",\n },\n de: {\n title: \"Definitionen durchsuchen\",\n },\n zh: {\n title: \"ꐜē“¢å®šä¹‰\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst button = ui.addCommand(l10n.title, show, \"Ctrl+Shift+Alt+x\", \"šŸ“š\");\n\nfunction show() {\n const onLoad = e => e.target.classList.add(\"ready\");\n const xrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=\"${onLoad}\"></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.title, xrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关äŗŽ\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"ć“ć‚Œć«ć¤ć„ć¦\",\n },\n de: {\n about_respec: \"Ɯber\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ā„¹ļø\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/speced/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/speced/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\nimport { html } from \"../core/import-maps.js\";\n\nexport const name = \"core/seo\";\n\nexport function run(conf) {\n if (conf.gitRevision) {\n // This allows to set a git revision of the source used to produce the\n // generated content. Typically, this would be set when generating the\n // static HTML via a build process.\n // 'revision' is the name recommended in https://wiki.whatwg.org/wiki/MetaExtensions\n const metaElem = html`<meta\n name=\"revision\"\n content=\"${conf.gitRevision}\"\n />`;\n document.head.appendChild(metaElem);\n }\n\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","// @ts-check\n// Module w3c/seo\n// Manages SEO information for documents\n// e.g. set the canonical URL for the document if configured\nimport { W3CNotes, recTrackStatus, registryTrackStatus } from \"./headers.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { resolveRef } from \"../core/biblio.js\";\nimport { showWarning } from \"../core/utils.js\";\nexport const name = \"w3c/seo\";\n\nconst status2rdf = {\n NOTE: \"w3p:NOTE\",\n WD: \"w3p:WD\",\n LC: \"w3p:LastCall\",\n CR: \"w3p:CR\",\n CRD: \"w3p:CRD\",\n PR: \"w3p:PR\",\n REC: \"w3p:REC\",\n RSCND: \"w3p:RSCND\",\n};\n\nexport const requiresCanonicalLink = new Set([\n ...W3CNotes,\n ...recTrackStatus,\n ...registryTrackStatus,\n \"BG-FINAL\",\n \"CG-FINAL\",\n \"CRY\",\n \"DRY\",\n \"draft-finding\",\n \"finding\",\n]);\n\nexport async function run(conf) {\n // Don't include a canonical URL for documents that haven't been published.\n if (\n (!conf.canonicalURI && !requiresCanonicalLink.has(conf.specStatus)) ||\n !conf.shortName\n ) {\n return;\n }\n switch (conf.canonicalURI) {\n case \"edDraft\":\n if (conf.edDraftURI) {\n conf.canonicalURI = new URL(\n conf.edDraftURI,\n document.location.href\n ).href;\n } else {\n const msg = `Canonical URI set to edDraft, but no edDraftURI is set in configuration`;\n showWarning(msg, name);\n conf.canonicalURI = null;\n }\n break;\n case \"TR\":\n if (conf.latestVersion) {\n conf.canonicalURI = conf.latestVersion;\n } else {\n const msg = `Canonical URI set to TR, but no shortName is set in configuration`;\n showWarning(msg, name);\n conf.canonicalURI = null;\n }\n break;\n default:\n if (conf.latestVersion && !conf.canonicalURI) {\n conf.canonicalURI = conf.latestVersion;\n }\n }\n if (conf.canonicalURI) {\n const linkElem = html`<link rel=\"canonical\" href=\"${conf.canonicalURI}\" />`;\n document.head.appendChild(linkElem);\n }\n\n if (conf.doJsonLd) {\n await addJSONLDInfo(conf, document);\n }\n}\n\nasync function addJSONLDInfo(conf, doc) {\n const rdfStatus = status2rdf[conf.specStatus];\n // Content for JSON\n const type = [\"TechArticle\"];\n if (rdfStatus) type.push(rdfStatus);\n\n const jsonld = {\n \"@context\": [\n \"http://schema.org\",\n {\n \"@vocab\": \"http://schema.org/\",\n \"@language\": doc.documentElement.lang || \"en\",\n w3p: \"http://www.w3.org/2001/02pd/rec54#\",\n foaf: \"http://xmlns.com/foaf/0.1/\",\n datePublished: { \"@type\": \"http://www.w3.org/2001/XMLSchema#date\" },\n inLanguage: { \"@language\": null },\n isBasedOn: { \"@type\": \"@id\" },\n license: { \"@type\": \"@id\" },\n },\n ],\n id: conf.canonicalURI || conf.thisVersion,\n type,\n name: document.title,\n inLanguage: doc.documentElement.lang || \"en\",\n license: conf.licenseInfo?.url,\n datePublished: conf.dashDate,\n /** @type {{ name: string, url?: string } | { name: string, url?: string }[]} */\n copyrightHolder: {\n name: \"World Wide Web Consortium\",\n url: \"https://www.w3.org/\",\n },\n discussionUrl: conf.issueBase,\n alternativeHeadline: conf.subtitle,\n isBasedOn: conf.prevVersion,\n };\n\n // add any additional copyright holders\n if (conf.additionalCopyrightHolders) {\n const addl = Array.isArray(conf.additionalCopyrightHolders)\n ? conf.additionalCopyrightHolders\n : [conf.additionalCopyrightHolders];\n jsonld.copyrightHolder = [\n jsonld.copyrightHolder,\n ...addl.map(h => ({ name: h })),\n ];\n }\n\n // description from meta description\n const description = doc.head.querySelector(\"meta[name=description]\");\n if (description) {\n jsonld.description = description.content;\n }\n\n // Editors\n if (conf.editors) {\n jsonld.editor = conf.editors.map(addPerson);\n }\n if (conf.authors) {\n jsonld.contributor = conf.authors.map(addPerson);\n }\n\n // normative and informative references\n const citationIds = [\n ...conf.normativeReferences,\n ...conf.informativeReferences,\n ];\n const citationContents = await Promise.all(\n citationIds.map(ref => resolveRef(ref))\n );\n jsonld.citation = citationContents\n .filter(ref => typeof ref === \"object\")\n .map(addRef);\n\n const script = doc.createElement(\"script\");\n script.type = \"application/ld+json\";\n script.textContent = JSON.stringify(jsonld, null, 2);\n doc.head.appendChild(script);\n}\n\n/**\n * Turn editors and authors into a list of JSON-LD relationships\n */\nfunction addPerson({ name, url, mailto, company, companyURL }) {\n const ed = {\n type: \"Person\",\n name,\n url,\n \"foaf:mbox\": mailto,\n };\n if (company || companyURL) {\n ed.worksFor = {\n name: company,\n url: companyURL,\n };\n }\n return ed;\n}\n\n/**\n * Create a reference URL from the ref\n */\nfunction addRef(ref) {\n const { href: id, title: name, href: url } = ref;\n const jsonld = {\n id,\n type: \"TechArticle\",\n name,\n url,\n };\n if (ref.authors) {\n jsonld.creator = ref.authors.map(a => ({ name: a }));\n }\n if (ref.rawDate) {\n jsonld.publishedDate = ref.rawDate;\n }\n if (ref.isbn) {\n jsonld.identifier = ref.isbn;\n }\n if (ref.publisher) {\n jsonld.publisher = { name: ref.publisher };\n }\n return jsonld;\n}\n","/*\nOne Light for ReSpec, with better color contrast\nAdapted from Atom One Light by Daniel Gamage (https://github.com/highlightjs/highlight.js/blob/c0b6ddbaaf7/src/styles/atom-one-light.css>\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n --base: #fafafa;\n --mono-1: #383a42;\n --mono-2: #686b77;\n --mono-3: #717277;\n --hue-1: #0b76c5;\n --hue-2: #336ae3;\n --hue-3: #a626a4;\n --hue-4: #42803c;\n --hue-5: #ca4706;\n --hue-5-2: #c91243;\n --hue-6: #986801;\n --hue-6-2: #9a6a01;\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n .hljs {\n --base: #282c34;\n --mono-1: #abb2bf;\n --mono-2: #818896;\n --mono-3: #5c6370;\n --hue-1: #56b6c2;\n --hue-2: #61aeee;\n --hue-3: #c678dd;\n --hue-4: #98c379;\n --hue-5: #e06c75;\n --hue-5-2: #be5046;\n --hue-6: #d19a66;\n --hue-6-2: #e6c07b;\n }\n}\n\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n color: var(--mono-1, #383a42);\n background: #fafafa;\n background: var(--base, #fafafa);\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n color: var(--mono-3, #717277);\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n color: var(--hue-3, #a626a4);\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n color: var(--hue-5, #ca4706);\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n color: var(--hue-1, #0b76c5);\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n color: var(--hue-4, #42803c);\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n color: var(--hue-6-2, #9a6a01);\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n color: var(--hue-6, #986801);\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n color: var(--hue-2, #336ae3);\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\n/**\n * Module core/data-tests\n *\n * Allows specs to link to test files in a test suite, by adding `details` of where\n * particular tests for a testable assertion can be found.\n *\n * `data-tests` takes a space separated list of URLs, e.g. data-test=\"foo.html bar.html\".\n *\n * Docs: https://respec.org/doc/#data-tests\n */\nimport {\n codedJoinAnd,\n docLink,\n getIntlData,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst localizationStrings = {\n en: {\n missing_test_suite_uri: docLink`Found tests in your spec, but missing ${\"[testSuiteURI]\"} in your ReSpec config.`,\n tests: \"tests\",\n test: \"test\",\n },\n ja: {\n missing_test_suite_uri: docLink`ć“ć®ä»•ę§˜å†…ć«ćƒ†ć‚¹ćƒˆć®é …ē›®ć‚’ę¤œå‡ŗć—ć¾ć—ćŸćŒļ¼ŒReSpec 恮čØ­å®šć« ${\"[testSuiteURI]\"} ćŒč¦‹ć¤ć‹ć‚Šć¾ć›ć‚“ļ¼Ž`,\n tests: \"ćƒ†ć‚¹ćƒˆ\",\n test: \"ćƒ†ć‚¹ćƒˆ\",\n },\n de: {\n missing_test_suite_uri: docLink`Die Spezifikation enthƤlt Tests, aber in der ReSpec-Konfiguration ist keine ${\"[testSuiteURI]\"} angegeben.`,\n tests: \"Tests\",\n test: \"Test\",\n },\n zh: {\n missing_test_suite_uri: docLink`ęœ¬č§„čŒƒäø­åŒ…å«ęµ‹čƕļ¼Œä½†åœØ ReSpec 配ē½®äø­ē¼ŗ少 ${\"[testSuiteURI]\"}怂`,\n tests: \"굋čƕ\",\n test: \"굋čƕ\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport const name = \"core/data-tests\";\n\nfunction toListItem(href) {\n const emojiList = [];\n const [testFile] = new URL(href).pathname.split(\"/\").reverse();\n const testParts = testFile.split(\".\");\n let [testFileName] = testParts;\n\n const isSecureTest = testParts.find(part => part === \"https\");\n if (isSecureTest) {\n const requiresConnectionEmoji = document.createElement(\"span\");\n requiresConnectionEmoji.textContent = \"šŸ”’\";\n requiresConnectionEmoji.setAttribute(\n \"aria-label\",\n \"requires a secure connection\"\n );\n requiresConnectionEmoji.setAttribute(\"title\", \"Test requires HTTPS\");\n testFileName = testFileName.replace(\".https\", \"\");\n emojiList.push(requiresConnectionEmoji);\n }\n\n const isManualTest = testFileName\n .split(\".\")\n .join(\"-\")\n .split(\"-\")\n .find(part => part === \"manual\");\n if (isManualTest) {\n const manualPerformEmoji = document.createElement(\"span\");\n manualPerformEmoji.textContent = \"šŸ’Ŗ\";\n manualPerformEmoji.setAttribute(\n \"aria-label\",\n \"the test must be run manually\"\n );\n manualPerformEmoji.setAttribute(\"title\", \"Manual test\");\n testFileName = testFileName.replace(\"-manual\", \"\");\n emojiList.push(manualPerformEmoji);\n }\n\n const testList = html`\n <li>\n <a href=\"${href}\">${testFileName}</a>\n ${emojiList}\n </li>\n `;\n return testList;\n}\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n if (!testables.length) {\n return;\n }\n if (!conf.testSuiteURI) {\n showError(l10n.missing_test_suite_uri, name);\n return;\n }\n\n for (const elem of testables) {\n const tests = elem.dataset.tests.split(/,/gm).map(url => url.trim());\n const testURLs = toTestURLs(tests, conf.testSuiteURI, elem);\n handleDuplicates(testURLs, elem);\n const details = toHTML(testURLs);\n elem.append(details);\n }\n}\n\n/**\n * @param {string[]} tests\n * @param {string} testSuiteURI\n * @param {HTMLElement} elem\n */\nfunction toTestURLs(tests, testSuiteURI, elem) {\n return tests\n .map(test => {\n try {\n return new URL(test, testSuiteURI).href;\n } catch {\n const msg = docLink`Invalid URL in ${\"[data-tests]\"} attribute: ${test}.`;\n showWarning(msg, name, { elements: [elem] });\n }\n })\n .filter(href => href);\n}\n\n/**\n * @param {string[]} testURLs\n * @param {HTMLElement} elem\n */\nfunction handleDuplicates(testURLs, elem) {\n const duplicates = testURLs.filter(\n (link, i, self) => self.indexOf(link) !== i\n );\n if (duplicates.length) {\n const msg = docLink`Duplicate tests found in the ${\"[data-tests]\"} attribute.`;\n const tests = codedJoinAnd(duplicates, { quotes: true });\n const hint = docLink`To fix, remove duplicates from ${\"[data-tests]\"}: ${tests}.`;\n showWarning(msg, name, { hint, elements: [elem] });\n }\n}\n\n/**\n * @param {string[]} testURLs\n */\nfunction toHTML(testURLs) {\n const uniqueList = [...new Set(testURLs)];\n const details = html`\n <details class=\"respec-tests-details removeOnSave\">\n <summary>tests: ${uniqueList.length}</summary>\n <ul>\n ${uniqueList.map(toListItem)}\n </ul>\n </details>\n `;\n return details;\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n var.respec-hl {\n filter: saturate(0.9) brightness(0.9)\n }\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within the algorithm or the encompassing section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\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","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar {\n position: relative;\n cursor: pointer;\n}\n\nvar[data-type]::before,\nvar[data-type]::after {\n position: absolute;\n left: 50%;\n top: -6px;\n opacity: 0;\n transition: opacity 0.4s;\n pointer-events: none;\n}\n\n/* the triangle or arrow or caret or whatever */\nvar[data-type]::before {\n content: \"\";\n transform: translateX(-50%);\n border-width: 4px 6px 0 6px;\n border-style: solid;\n border-color: transparent;\n border-top-color: #222;\n}\n\n/* actual text */\nvar[data-type]::after {\n content: attr(data-type);\n transform: translateX(-50%) translateY(-100%);\n background: #222;\n text-align: center;\n /* additional styling */\n font-family: \"Dank Mono\", \"Fira Code\", monospace;\n font-style: normal;\n padding: 6px;\n border-radius: 3px;\n color: #daca88;\n text-indent: 0;\n font-weight: normal;\n}\n\nvar[data-type]:hover::after,\nvar[data-type]:hover::before {\n opacity: 1;\n}\n`;\n","// @ts-check\n/**\n * Module core/data-type\n * Propagates data type of a <var> to subsequent instances within a section.\n * Also adds the CSS for the data type tooltip.\n * Set `conf.highlightVars = true` to enable.\n */\nimport css from \"../styles/datatype.css.js\";\n\nexport const name = \"core/data-type\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n\n let section = null;\n const varMap = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const variables = document.querySelectorAll(\"section var\");\n for (const varElem of variables) {\n const currentSection = varElem.closest(\"section\");\n if (section !== currentSection) {\n section = currentSection;\n varMap.clear();\n }\n if (varElem.dataset.type) {\n varMap.set(varElem.textContent.trim(), varElem.dataset.type);\n continue;\n }\n const type = varMap.get(varElem.textContent.trim());\n if (type) varElem.dataset.type = type;\n }\n}\n","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n:root {\n --assertion-border: #aaa;\n --assertion-bg: #eee;\n --assertion-text: black;\n}\n\n.assert {\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n border-color: #aaa;\n border-color: var(--assertion-border);\n background: #eee;\n background: var(--assertion-bg);\n color: black;\n color: var(--assertion-text);\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n :root {\n --assertion-border: #444;\n --assertion-bg: var(--borderedblock-bg);\n --assertion-text: var(--text);\n }\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"Ā§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/speced/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n background: var(--indextable-hover-bg, #fff);\n color: black;\n color: var(--text, black);\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: 0 1em 3em -0.4em var(--tocsidebar-shadow, rgba(0, 0, 0, 0.3)),\n 0 0 1px 1px var(--tocsidebar-shadow, rgba(0, 0, 0, 0.05));\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n border-bottom-color: var(--indextable-hover-bg, #fff);\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n /* TODO: need slightly darker shade */\n border-bottom-color: var(--indextable-hover-bg, #a2a9b1);\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n color: var(--text, #000);\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n color: var(--text, #333);\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => {\n return html`<li>\n ${toLinkProps(entry).map(link => {\n return html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a\n >${\" \"}`;\n })}\n </li>`;\n };\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `Ā§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","// @ts-check\n/**\n * Fetches commits between two commitish (tag or commit) - `from` and `to=HEAD`\n * and shows them as a list of \"changes during\" those commitish. If a filter\n * function is provided by the user, it is used to filter the commits that are\n * to be shown. Otherwise, all commits are shown.\n *\n * @typedef {{message: string, hash: string}} Commit\n */\nimport { github } from \"../github.js\";\nimport { html } from \"../import-maps.js\";\nimport { showError } from \"../utils.js\";\n\nexport const name = \"rs-changelog\";\n\nexport const element = class ChangelogElement extends HTMLElement {\n constructor() {\n super();\n this.props = {\n from: this.getAttribute(\"from\"),\n to: this.getAttribute(\"to\") || \"HEAD\",\n /** @type {(commit: Commit) => boolean} */\n filter:\n typeof window[this.getAttribute(\"filter\")] === \"function\"\n ? window[this.getAttribute(\"filter\")]\n : () => true,\n };\n }\n\n connectedCallback() {\n const { from, to, filter } = this.props;\n html.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error => showError(error.message, name, { elements: [this] }))\n .finally(() => {\n this.dispatchEvent(new CustomEvent(\"done\"));\n }),\n placeholder: \"Loading list of commits...\",\n }}\n </ul>\n `;\n }\n};\n\nasync function fetchCommits(from, to, filter) {\n /** @type {Commit[]} */\n let commits;\n try {\n const gh = await github;\n if (!gh) {\n throw new Error(\"`respecConfig.github` is not set\");\n }\n const url = new URL(\"commits\", `${gh.apiBase}/${gh.fullName}/`);\n url.searchParams.set(\"from\", from);\n url.searchParams.set(\"to\", to);\n\n const res = await fetch(url.href);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n commits = await res.json();\n if (!commits.length) {\n throw new Error(`No commits between ${from}..${to}.`);\n }\n commits = commits.filter(filter);\n } catch (error) {\n const msg = `Error loading commits from GitHub. ${error.message}`;\n console.error(error);\n throw new Error(msg);\n }\n return commits;\n}\n\nasync function toHTML(commits) {\n const { repoURL } = await github;\n return commits.map(commit => {\n const [message, prNumber = null] = commit.message.split(/\\(#(\\d+)\\)/, 2);\n const commitURL = `${repoURL}commit/${commit.hash}`;\n const prURL = prNumber ? `${repoURL}pull/${prNumber}` : null;\n const pr = prNumber && html` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return html`<li><a href=\"${commitURL}\">${message.trim()}</a>${pr}</li>`;\n });\n}\n","// @ts-check\n/**\n * Registers custom elements and waits for them to finish their processing.\n *\n * Every custom element file exports:\n * - `name`: registered name of the custom element, prefixed with `rs-`.\n * - `element`: class defintion of the custom element.\n *\n * Every custom element must dispatch a CustomEvent 'done' that tells the\n * element has finished its processing, with or without errors.\n *\n * @typedef {{ name: string, element: CustomElementConstructor }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements/index\";\n\nexport async function run() {\n // prepare and register elements\n CUSTOM_ELEMENTS.forEach(el => {\n customElements.define(el.name, el.element);\n });\n\n // wait for each element to be ready\n const selectors = CUSTOM_ELEMENTS.map(el => el.name).join(\", \");\n const elems = document.querySelectorAll(selectors);\n const readyPromises = [...elems].map(\n el => new Promise(res => el.addEventListener(\"done\", res, { once: true }))\n );\n await Promise.all(readyPromises);\n}\n","// @ts-check\n/**\n * This module adds a \"monetization\" meta-tag to enable web-monetization.\n *\n * The meta-tag is added only to \"live\" documents, and is removed from generated\n * static documents.\n */\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/web-monetization\";\n\nexport function run(conf) {\n if (conf.monetization === false) {\n return;\n }\n const { monetization } = conf;\n\n const { removeOnSave, paymentPointer } = canonicalizeConfig(monetization);\n\n const cssClass = removeOnSave ? \"removeOnSave\" : null;\n document.head.append(\n html`<meta\n name=\"monetization\"\n content=\"${paymentPointer}\"\n class=\"${cssClass}\"\n />`\n );\n}\n\n/**\n * @param {object|string} rawConfig\n * - {string} paymentPointer - The payment pointer to use.\n * - {boolean} removeOnSave - Whether to remove the meta tag when the document is saved.\n */\nfunction canonicalizeConfig(rawConfig) {\n const config = {\n paymentPointer: \"$respec.org\",\n removeOnSave: true,\n };\n switch (typeof rawConfig) {\n case \"string\":\n config.paymentPointer = rawConfig;\n break;\n case \"object\":\n if (rawConfig.paymentPointer) {\n config.paymentPointer = String(rawConfig.paymentPointer);\n }\n if (rawConfig.removeOnSave === false) {\n config.removeOnSave = false;\n }\n break;\n }\n return config;\n}\n","export const name = \"core/dfn-contract\";\n\nexport function run() {\n addContractDefaults();\n addDefinitionPointers();\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n\n// - Sets data-defines on well-known definition content patterns\nfunction addDefinitionPointers() {\n // A dl with class hasdefinitions associated the dfn in each dt\n // the definition in the following sibling element\n /** @type NodeListOf<HTMLElement> */\n const describedDTs = document.querySelectorAll(\n \"dl.definitions dt:has(dfn[data-dfn-type])\"\n );\n for (const dt of describedDTs) {\n const dfnId = dt.querySelector(\"dfn[data-dfn-type]\").id;\n const dfnContent = /** @type {HTMLElement | null} */ (\n dt.nextElementSibling\n );\n if (dfnContent && !dfnContent.dataset.defines && dfnId) {\n dfnContent.dataset.defines = `#${dfnId}`;\n }\n }\n\n // an element with class \"definition\" is marked as defining the term\n // found in the element\n /** @type NodeListOf<HTMLElement> */\n const definitionContainers = document.querySelectorAll(\n \".definition:has(dfn[data-dfn-type])\"\n );\n for (const el of definitionContainers) {\n const dfn = el.querySelector(\"dfn[data-dfn-type]\");\n if (dfn.id && !el.dataset.defines) {\n el.dataset.defines = `#${dfn.id}`;\n }\n }\n}\n","import { docLink, showError } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/before-save\";\n\nexport function run(conf) {\n if (!conf.beforeSave) return;\n\n if (\n !Array.isArray(conf.beforeSave) ||\n conf.beforeSave.some(\n el => typeof el !== \"function\" || el.constructor.name === \"AsyncFunction\"\n )\n ) {\n const msg = docLink`${\"[beforeSave]\"} configuration option must be an array of synchronous JS functions.`;\n showError(msg, name);\n return;\n }\n\n sub(\n \"beforesave\",\n documentElement => {\n performTransformations(conf.beforeSave, documentElement.ownerDocument);\n },\n { once: true }\n );\n}\n/**\n * @param {Array<Function>} transforms\n * @param {Document}\n */\nfunction performTransformations(transforms, doc) {\n let pos = 0;\n for (const fn of transforms) {\n try {\n fn(doc);\n } catch (err) {\n const nameOrPosition = `\\`${fn.name}\\`` || `at position ${pos}`;\n const msg = docLink`Function ${nameOrPosition}\\` threw an error during processing of ${\"[beforeSave]\"}.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n } finally {\n pos++;\n }\n }\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ \\`<meta>\\` ꠇē­¾`,\n hint: `å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ \\`<head>\\` éƒØ分ā€”ā€” \\`<meta charset=\"utf-8\">\\` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"check-internal-slots\".\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-internal-slots\";\nexport const name = \"core/linter-rules/check-internal-slots\";\n\nconst localizationStrings = {\n en: {\n msg: \"Internal slots should be preceded by a '.'\",\n hint: \"Add a '.' between the elements mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"var+a\");\n const offendingElements = [...elems].filter(\n ({ previousSibling: { nodeName } }) => {\n const isPrevVar = nodeName && nodeName === \"VAR\";\n return isPrevVar;\n }\n );\n\n if (!offendingElements.length) {\n return;\n }\n\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-captionless-tables\".\n *\n * Checks that there are no tables in the document which don't start\n * with a caption element.\n *\n * As some tables may not contain tabular data, this only applies to\n * tables marked with class=\"numbered\".\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-captionless-tables\";\nexport const name = \"core/linter-rules/no-captionless-tables\";\n\nconst localizationStrings = {\n en: {\n msg: \"All tables marked with class='numbered' must start with a caption element.\",\n hint: \"Add a `caption` to the offending table.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const tables = document.querySelectorAll(\"table.numbered\");\n const offendingElements = [...tables].filter(\n table => !(table.firstElementChild instanceof HTMLTableCaptionElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-dfns\".\n *\n * Complains if an internal/un-exported definitions is not linked to.\n */\nimport {\n docLink,\n getIntlData,\n norm,\n showError,\n showWarning,\n} from \"../utils.js\";\n\nconst ruleName = \"no-unused-dfns\";\nexport const name = \"core/linter-rules/no-unused-dfns\";\n\nconst localizationStrings = {\n en: {\n msg(text) {\n return `Found definition for \"${text}\", but nothing links to it. This is usually a spec bug!`;\n },\n get hint() {\n return docLink`\n You can do one of the following...\n\n * Add a \\`class=\"lint-ignore\"\\` attribute the definition.\n * Either remove the definition or change \\`<dfn>\\` to another type of HTML element.\n * If you meant to ${\"[export|#data-export]\"} the definition, add \\`class=\"export\"\\` to the definition.\n\n To silence this warning entirely, set \\`lint: { \"no-unused-dfns\": false }\\` in your \\`respecConfig\\`.`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) return;\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n /** @type NodeListOf<HTMLElement> */\n const definitions = document.querySelectorAll(\n \"dfn:not(.lint-ignore, [data-export], [data-cite])\"\n );\n\n const elements = [...definitions].filter(isDfnUnused);\n\n // These are usually bad spec bugs, so best shown individually.\n elements.forEach(element => {\n const elements = [element];\n const text = norm(element.textContent);\n logger(l10n.msg(text), name, { elements, hint: l10n.hint });\n });\n}\n\nfunction isDfnUnused(dfn) {\n // Not in the index\n // and not the \"self-link\" box\n return !document.querySelector(\n `a[href=\"#${dfn.id}\"]:not(.index-term, .self-link)`\n );\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂\",\n hint: \"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * The W3C Process requires separate Privacy Considerations and Security\n * Considerations sections. This linter checks for the presence of these\n * sections, and reports an error if they are not present.\n */\n\nimport {\n InsensitiveStringSet,\n docLink,\n getIntlData,\n getIntlDataForKey,\n norm,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { W3CNotes, recTrackStatus } from \"../headers.js\";\n\nconst ruleName = \"required-sections\";\nexport const name = \"w3c/linter-rules/required-sections\";\n\nconst localizationStrings = {\n en: {\n msg(sectionTitle) {\n return `W3C Recommendation track documents require a separate \"${sectionTitle}\" section.`;\n },\n hint(sectionTitle) {\n return docLink`Add a \\`<section>\\` with a \"${sectionTitle}\" header. See the [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).\n If the document is not intended for the W3C Recommendation track, set ${\"[noRecTrack]\"} to \\`true\\`\n or turn off the ${`[${ruleName}]`} linter rule.`;\n },\n privacy_considerations: \"Privacy Considerations\",\n security_considerations: \"Security Considerations\",\n },\n es: {\n msg(sectionTitle) {\n return `Documentos que van a ser \"W3C Recommendation\" requieren una secciĆ³n \"${sectionTitle}\" separada.`;\n },\n hint(sectionTitle) {\n return docLink`Agrega una \\`<section>\\` con tĆ­tulo \"${sectionTitle}\". Ver los [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).\n Si el documento no estĆ” destinado a ser un W3C Recommendation, puedes poner ${\"[noRecTrack]\"} a \\`true\\`\n o apaga la regla de linter ${`[${ruleName}]`}.`;\n },\n privacy_considerations: \"Consideraciones de privacidad\",\n security_considerations: \"Consideraciones de Seguridad\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport const requiresSomeSectionStatus = new Set([...recTrackStatus]);\nrequiresSomeSectionStatus.delete(\"DISC\"); // \"Discontinued Draft\"\n// W3C notes do not require privacy or security considerations sections.\nW3CNotes.forEach(note => requiresSomeSectionStatus.delete(note));\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can't check for headers unless we also have a translation\n if (!getIntlDataForKey(localizationStrings, \"privacy_considerations\")) {\n // We can't check for headers unless we also have a translation\n const msg = `Cannot check for required sections as translations are not available.`;\n const hint = `File an issue to add translations or use a supported language.`;\n showWarning(msg, name, { hint });\n return;\n }\n\n if (conf.noRecTrack || !requiresSomeSectionStatus.has(conf.specStatus)) {\n return;\n }\n\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n\n const missingRequiredSections = new InsensitiveStringSet([\n l10n.privacy_considerations,\n l10n.security_considerations,\n ]);\n\n /** @type {NodeListOf<HTMLElement>} */\n const headers = document.querySelectorAll(\"h2, h3, h4, h5, h6\");\n for (const header of headers) {\n const clone = header.cloneNode(true);\n // section number and self-link anchor\n clone.querySelectorAll(\"bdi\")?.forEach(elem => elem.remove());\n const text = norm(clone.textContent);\n if (missingRequiredSections.has(text)) {\n missingRequiredSections.delete(text);\n // Check if we find them all...\n if (missingRequiredSections.size === 0) {\n return; // All present, early return!\n }\n }\n }\n\n // Show the ones we didn't find individually\n for (const title of missingRequiredSections) {\n logger(l10n.msg(title), name, {\n hint: l10n.hint(title),\n });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"wpt-tests-exist\".\n * Warns about nonexistent web platform tests.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"wpt-tests-exist\";\nexport const name = \"core/linter-rules/wpt-tests-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"The following test could not be found in Web Platform Tests:\",\n hint: \"Check [wpt.live](https://wpt.live) to see if it was deleted or renamed.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const filesInWPT = await getFilesInWPT(conf.testSuiteURI, conf.githubAPI);\n if (!filesInWPT) {\n return;\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n for (const elem of testables) {\n elem.dataset.tests\n .split(/,/gm)\n .map(test => test.trim().split(\"#\")[0])\n .filter(test => test && !filesInWPT.has(test))\n .map(missingTest => {\n showWarning(`${l10n.msg} \\`${missingTest}\\`.`, name, {\n hint: l10n.hint,\n elements: [elem],\n });\n });\n }\n}\n\n/**\n * @param {string} testSuiteURI\n * @param {string} githubAPIBase\n */\nasync function getFilesInWPT(testSuiteURI, githubAPIBase) {\n let wptDirectory;\n try {\n const testSuiteURL = new URL(testSuiteURI);\n if (\n testSuiteURL.pathname.startsWith(\"/web-platform-tests/wpt/tree/master/\")\n ) {\n const re = /web-platform-tests\\/wpt\\/tree\\/master\\/(.+)/;\n wptDirectory = testSuiteURL.pathname.match(re)[1].replace(/\\//g, \"\");\n } else {\n wptDirectory = testSuiteURL.pathname.replace(/\\//g, \"\");\n }\n } catch (error) {\n const msg = \"Failed to parse WPT directory from testSuiteURI\";\n showWarning(msg, `linter/${name}`);\n console.error(error);\n return null;\n }\n\n const url = new URL(\"web-platform-tests/wpt/files\", `${githubAPIBase}/`);\n url.searchParams.set(\"path\", wptDirectory);\n\n const response = await fetch(url);\n if (!response.ok) {\n const error = await response.text();\n const msg =\n \"Failed to fetch files from WPT repository. \" +\n `Request failed with error: ${error} (${response.status})`;\n showWarning(msg, `linter/${name}`);\n return null;\n }\n /** @type {{ entries: string[] }} */\n const { entries } = await response.json();\n const files = entries.filter(entry => !entry.endsWith(\"/\"));\n return new Set(files);\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,\n hint: \"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n","// @ts-check\n/**\n * Lints for accessibility issues using axe-core package.\n */\n\nimport { showError, showWarning } from \"../utils.js\";\n\nexport const name = \"core/linter-rules/a11y\";\n\nconst DISABLED_RULES = [\n \"color-contrast\", // too slow šŸ¢\n \"landmark-one-main\", // need to add a <main>, else it marks entire page as errored\n \"landmark-unique\",\n \"region\",\n];\n\nexport async function run(conf) {\n if (!conf.lint?.a11y && /** legacy */ !conf.a11y) {\n return;\n }\n const config = conf.lint?.a11y || /** legacy */ conf.a11y;\n\n const options = config === true ? {} : config;\n const violations = await getViolations(options);\n for (const violation of violations) {\n /**\n * We're grouping by failureSummary as it contains hints to fix the issue.\n * For example, with color-constrast rule, it tells about the present color\n * contrast and how to fix it. If we don't group, errors will be repetitive.\n * @type {Map<string, HTMLElement[]>}\n */\n const groupedBySummary = new Map();\n for (const node of violation.nodes) {\n const { failureSummary, element } = node;\n const elements =\n groupedBySummary.get(failureSummary) ||\n groupedBySummary.set(failureSummary, []).get(failureSummary);\n elements.push(element);\n }\n\n const { id, help, description, helpUrl } = violation;\n const title = `a11y/${id}: ${help}.`;\n for (const [failureSummary, elements] of groupedBySummary) {\n const hints = formatHintsAsMarkdown(failureSummary);\n const details = `\\n\\n${description}.\\n\\n${hints}. ([Learn more](${helpUrl}))`;\n showWarning(title, name, { details, elements });\n }\n }\n}\n\n/**\n * @param {object} opts Options as described at https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter\n */\nasync function getViolations(opts) {\n const { rules, ...otherOptions } = opts;\n const options = {\n rules: {\n ...Object.fromEntries(DISABLED_RULES.map(id => [id, { enabled: false }])),\n ...rules,\n },\n ...otherOptions,\n elementRef: true,\n resultTypes: [\"violations\"],\n reporter: \"v1\", // v1 includes a `failureSummary`\n };\n\n let axe;\n try {\n axe = await importAxe();\n } catch (error) {\n const msg = \"Failed to load a11y linter.\";\n showError(msg, name);\n console.error(error);\n return [];\n }\n\n try {\n const result = await axe.run(document, options);\n return result.violations;\n } catch (error) {\n const msg = \"Error while looking for a11y issues.\";\n showError(msg, name);\n console.error(error);\n return [];\n }\n}\n\n/** @returns {Promise<typeof window.axe>} */\nfunction importAxe() {\n const script = document.createElement(\"script\");\n script.classList.add(\"remove\");\n script.src = \"https://cdn.jsdelivr.net/npm/axe-core@4/axe.min.js\";\n document.head.appendChild(script);\n return new Promise((resolve, reject) => {\n script.onload = () => resolve(window.axe);\n script.onerror = reject;\n });\n}\n\n/** @param {string} text */\nfunction formatHintsAsMarkdown(text) {\n const results = [];\n for (const group of text.split(\"\\n\\n\")) {\n const [msg, ...opts] = group.split(/^\\s{2}/m);\n const options = opts.map(opt => `- ${opt.trimEnd()}`).join(\"\\n\");\n results.push(`${msg}${options}`);\n }\n return results.join(\"\\n\\n\");\n}\n","// @ts-check\n/**\n * Linter rule \"informative-dfn\".\n *\n * Complains if an informative definition is referenced from a normative section.\n */\nimport { docLink, getIntlData, showError, showWarning } from \"../utils.js\";\n\nimport { informativeRefsInNormative } from \"../xref.js\";\n\nconst ruleName = \"informative-dfn\";\nexport const name = \"core/linter-rules/informative-dfn\";\n\nconst localizationStrings = {\n en: {\n msg(term, cite) {\n return `Normative reference to \"${term}\" found but term is defined \"informatively\" in \"${cite}\".`;\n },\n get hint() {\n return docLink`\n You can do one of the following...\n\n * Get the source definition to be made normative\n * Add a \\`class=\"lint-ignore\"\\` attribute to the link.\n * Use a local normative proxy for the definition Ć  la \\`<dfn data-cite=\"spec\">term</dfn>\\`\n\n To silence this warning entirely, set \\`lint: { \"${ruleName}\": false }\\` in your \\`respecConfig\\`.`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) return;\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n\n informativeRefsInNormative.forEach(({ term, spec, element }) => {\n if (element.classList.contains(\"lint-ignore\")) return;\n logger(l10n.msg(term, spec), name, {\n title: \"Normative reference to non-normative term.\",\n elements: [element],\n hint: l10n.hint,\n });\n });\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","instanceOfAny","constructors","some","c","idbProxyableTypes","cursorAdvanceMethods","transactionDoneMap","WeakMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","replaceTraps","wrapFunction","func","IDBCursor","prototype","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","request","transformCachableValue","tx","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","cacheDonePromiseForTransaction","IDBDatabase","IDBObjectStore","IDBIndex","Proxy","IDBRequest","promise","success","result","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","transaction","store","index","shift","oldTraps","advanceMethodProps","methodMap","advanceResults","ittrProxiedCursorToOriginalProxy","cursorIteratorTraps","cachedFunc","iterate","cursor","openCursor","proxiedCursor","delete","isIteratorProp","Symbol","asyncIterator","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","catch","source","position","current","message","kind","level","autofix","ruleName","sliceTokens","count","slice","Math","max","tokensToText","inputs","precedes","text","t","trivia","join","nextToken","type","length","line","precedingLastLine","splitted","split","lastLine","subsequentTokens","subsequentText","sourceContext","repeat","contextType","context","partial","node","hierarchy","unshift","n","base","appendIfExist","contextAsText","bareMessage","sourceName","input","tokens","syntaxError","validationError","token","Base","constructor","Object","defineProperties","writable","toJSON","json","inheritance","proto","descMap","getOwnPropertyDescriptors","key","entries","enumerable","getPrototypeOf","idlTypeIncludesDictionary","idlType","defs","useNullableInner","union","def","unique","typedefIncludesDictionary","cache","reference","dictionary","nullable","subtype","dictionaryIncludesRequiredField","dict","members","field","required","superdict","ArrayBase","Array","super","WrappedToken","parser","tokeniser","consumeKind","unescape","write","w","ts","separator","Eof","parse","tokenName","list","listName","extAttrValueSyntax","renamedLegacies","extAttrListItems","syntax","toks","ExtendedAttributeParameters","assign","consume","ret","autoParenter","asterisk","secondaryName","rhsIsList","argument_list","close","rhsType","reference_token","p","identifier","SimpleExtendedAttribute","params","defineProperty","rhs","arguments","validate","extAttr","arg","extendedAttribute","extendedAttributeReference","ExtendedAttributes","push","unconsume","probe","ea","type_suffix","obj","single_type","typeName","Type","return_type","type_with_extended_attributes","keyType","stringTypes","keyIdlType","valueType","generic_type","primitive_type","typeNameKeywords","generic","typ","or","union_type","extAttrs","Boolean","prefix","postfix","filter","replaceAllowShared","typedef","targetToken","firstToken","ref","unescaped","type_body","indexOf","splice","match","Default","const_value","expression","const_data","negative","Argument","start_position","optional","variadic","argumentNameKeywords","default","autofixOptionalDictionaryDefaultValue","requiredExists","a","isLastRequiredArgument","getFirstToken","name_token","data","Tokeniser","Operation","special","regular","termination","argument","body","definition","nameless","Attribute","noInherit","readonly","idlTypeIncludesEnforceRange","startsWith","allowDangler","first","items","item","num_type","integer_type","decimal_type","voidToken","stringifier","getLastIndentation","str","lines","autofixAddExposedWindow","exposed","existing","test","values","sort","x","y","isArray","tokenRe","decimal","integer","string","whitespace","comment","other","nonRegexTerminals","concat","punctuations","reserved","idl","lastCharIndex","nextChar","charAt","attemptTokenMatch","noFlushTrivia","currentTrivia","pop","lastIndex","WebIDLParseError","punctuation","re","exec","tokenise","probeKind","candidates","consumeIdentifier","EnumValue","Enum","v","Includes","mixin","Typedef","CallbackFunction","Container","instance","inheritable","allowedMembers","colon","mem","member","m","Constant","IterableLike","secondTypeRequired","secondTypeAllowed","argumentAllowed","argsOpen","argsClose","Constructor","static_member","Interface","extMembers","every","oldConstructors","autofixConstructor","factoryFunctions","named","i","opNames","ops","getOperations","statics","Set","op","nonstatics","groupOperationNames","partials","mixins","mixinMap","ext","additions","checkAdditions","forEach","add","existings","addition","checkInterfaceMemberDuplication","interfaceDef","constructorExtAttr","indentation","memberIndent","parentTrivia","indentCh","getMemberIndentation","constructorOp","existingIndex","array","predicate","reverse","findIndex","findLastIndex","removed","trim","Mixin","Field","Dictionary","Namespace","CallbackInterface","parseByTokens","interface_","opts","extensions","interface","productions","production","callbackInterface","namespace","res","eof","concrete","definitions","noop","templates","Writer","raw","wrapper","bind","id","getMixinMap","include","validateIterable","ast","duplicates","groupDefinitions","dup","checkDuplicatedNames","flat","it","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","paramName","paramValue","toLowerCase","_getDefaults","breaks","gfm","hooks","pedantic","renderer","silent","tokenizer","walkTokens","_defaults","changeDefaults","newDefaults","escapeTest","escapeReplace","RegExp","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape$1","encode","unescapeTest","_","fromCharCode","parseInt","substring","caret","edit","regex","opt","val","valSource","getRegex","cleanUrl","href","encodeURI","noopTest","splitCells","tableRow","cells","offset","escaped","curr","rtrim","invert","l","suffLen","currChar","outputLink","cap","link","lexer","title","state","inLink","inlineTokens","_Tokenizer","rules","space","src","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","matchIndentInNode","indentInNode","indentCodeCompensation","inline","anyPunctuation","heading","trimmed","depth","hr","blockquote","top","blockTokens","bull","isordered","ordered","start","loose","itemRegex","itemContents","endsWithBlankLine","endEarly","nextLine","indent","trimStart","search","blankLine","nextBulletRegex","min","hrRegex","fencesBeginRegex","headingBeginRegex","rawLine","ischecked","istask","task","checked","trimEnd","spacers","hasMultipleLineBreaks","pre","tag","table","headers","aligns","rows","header","align","row","cell","lheading","paragraph","escape","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","emStrongLDelim","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","emStrongRDelimAst","emStrongRDelimUnd","lastCharLength","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","bullet","_paragraph","_blockLabel","_tag","_comment","blockNormal","gfmTable","blockGfm","blockPedantic","_punctuation","_inlineComment","_inlineLabel","inlineNormal","blockSkip","reflinkSearch","inlinePedantic","inlineGfm","inlineBreaks","normal","_Lexer","inlineQueue","create","lex","lexInline","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","call","startBlock","startIndex","Infinity","tempSrc","tempStart","getStartIndex","errMsg","charCodeAt","console","keepPrevChar","keys","lastIndexOf","startInline","_Renderer","infostring","quote","listitem","checkbox","tablerow","content","tablecell","flags","strong","em","cleanHref","out","image","_TextRenderer","_Parser","textRenderer","parseInline","renderers","genericToken","headingToken","codeToken","tableToken","j","k","blockquoteToken","listToken","itemBody","htmlToken","paragraphToken","textToken","escapeToken","tagToken","linkToken","imageToken","strongToken","emToken","codespanToken","delToken","_Hooks","static","preprocess","markdown","postprocess","processAllTokens","markedInstance","defaults","setOptions","parseMarkdown","Parser","Renderer","TextRenderer","Lexer","Tokenizer","Hooks","use","childTokens","pack","prevRenderer","extLevel","rendererProp","rendererFunc","tokenizerProp","tokenizerFunc","prevTokenizer","hooksProp","hooksFunc","prevHook","passThroughHooks","packWalktokens","origOpt","warn","throwError","onError","toString","msg","marked","getDefaults","globalThis","global","getDefaultExportFromCjs","__esModule","hasOwnProperty","module","pluralize$1","exports","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","r","configurable","o","random","s","WeakSet","u","insertBefore","selected","selectedIndex","f","querySelectorAll","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","g","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ne","ie","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","setTimeout","addedNodes","removedNodes","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","TypeError","parserMode","inputArray","from","char","fromEntries","parseMimeType","parameters","essence","mimeType","size","paramStr","serialize","_pluralize","webidl2","_webidl2","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","W3CDate","nonNormativeSelector","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","joinOr","xmlEscape","norm","getIntlData","localizationStrings","getIntlDataForKey","concatDate","date","sep","format","runTransforms","flist","funcArgs","methods","meth","showWarning","fetchAndCache","maxAge","Request","cachedResponse","caches","Date","err","response","fetch","ok","clonedResponse","clone","customHeaders","Headers","expiryDate","now","toISOString","cacheResponse","Response","blob","put","htmlJoinComma","joined","htmlJoinAnd","addHashId","hash","imul","hashString","addId","pfx","txt","noLC","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","getElementsByTagName","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","getPreviousSections","sections","previous","previousElementSibling","iteratePreviousElements","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","getCanonicalKey","existingKey","find","makeSafeCopy","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","elements","markAsOffending","details","showError","pluginName","makePluginUtils","toMDCode","codedJoinOr","quotes","addQuotes","codedJoinAnd","docLink","strings","reindent","endsWith","linkingText","indents","leastIndent","mimeTypes","rsDocToDataURL","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","toHTML","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodeURIComponent","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","utils","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$p","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","firstTwo","lastTwo","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","buttonId","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$D","group","style$1","github$1","dataInclude","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","tables","webidl","biblio$1","linkToDfn","xref","dataCite","renderBiblio","dfnIndex","contrib","fixHeaders","webidlIndex","structure","informative","idHeaders","caniuse","mdnAnnotation","saveHtml","searchSpecref","searchXref","aboutRespec","seo$1","seo","highlight","webidlClipboard","dataTests","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","webMonetization","dfnContract","beforeSave","checkCharset","checkPunctuation","checkInternalSlots","localRefsExist","noCaptionlessTables","noUnusedDfns","noHeadinglessSections","noUnusedVars","requiredSections","wptTestsExist","noHttpProps","a11y","informativeDfn","ReSpec.run","newHash","isLegacyFrag","W3C_GROUPS_API","getGroupDetails","shortname","wgId","wg","patentURI","wgPatentURI","patentPolicy","wgPatentPolicy","groupType","wgURI","status","groupDetails","groups","getMultipleGroupDetails","showLink","class","showLinkData","showLogo","logo","alt","height","width","until","es","ko","ja","zh","orcidIcon","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","remainder","Number","reduce","acc","lastDigitInt","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","extras","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","protocol","hCard","companyElem","note","classVal","renderExtra","time","archives","author","authors","commit_history","edited_in_place","editor","editors","feedback","former_editor","former_editors","history","implementation_report","latest_editors_draft","latest_published_version","latest_recommendation","message_topic","more_details_about_this_doc","multiple_alternates","prev_editor_draft","prev_recommendation","prev_version","publication_history","test_suite","this_version","with_subject_line","your_topic_here","nl","getSpecSubTitleElem","specSubTitleElem","subtitle","headersTmpl","logos","specType","isCR","isCRY","longStatus","textStatus","prependW3C","specStatus","dashDate","publishDate","modificationDate","renderSpecTitle","localStorage","getItem","thisVersion","latestVersion","edDraftURI","historyURI","github","commitHistoryURL","testSuiteURI","implementationReportURI","prevED","showPreviousVersion","prevVersion","prevRecURI","isRec","formerEditors","wgPublicList","renderFeedback","errata","otherLinks","shortName","alternateFormats","multipleAlternates","alternatesHTML","existingCopyright","isUnofficial","licenseInfo","copyrightStart","publishYear","additionalCopyrightHolders","short","linkLicense","renderOfficialCopyright","renderCopyright","repoURL","issuesURL","newIssuesURL","pullsURL","fullName","mailToURL","subject","subjectPrefix","mailingListLink","subjectLine","emailSubject","archiveURL","archiveLink","cgbgHeadersTmpl","specTitleElem","specTitleElemClone","isCGFinal","sotd","status_at_publication","processLink","sotdTmpl","isPreview","renderPreview","additionalContent","renderIsUnofficial","isTagFinding","isNoTrack","isMO","renderIsNoTrack","isMemberSubmission","teamComment","getUTCFullYear","submissionCommentNumber","patentPolicyURL","noteForMemberSubmission","noteForSubmission","sotdAfterWGinfo","overrideStatus","changes","proposedAdditions","proposedCorrections","corrections","hasRevisions","track","status2track","getWgHTML","linkToWorkingGroup","revisedRecEnd","updatableRec","reviewTarget","renderIsRec","statusExplanation","reviewPolicy","endorsement","updatePolicy","lsUpdatePolicy","pubMode","humanPREnd","humanCREnd","crEnd","prEnd","renderNotRec","isNote","isRegistry","multipleWGs","wgPatentHTML","producers","renderDeliverer","additionalSections","prUrl","prNumber","idx","cgbgSotdTmpl","mailToWGPublicListWithSubject","mailToWGPublicListSubscription","renderPublicList","issueBase","linkToCommunity","w3Url","status2maturity","LS","LD","FPWD","status2text","DNOTE","NOTE","STMT","MO","ED","WD","CR","CRD","PR","REC","DISC","RSCND","DRY","CRYD","CRY","RY","unofficial","UD","finding","status2long","W3CNotes","recTrackStatus","registryTrackStatus","tagStatus","cgStatus","bgStatus","cgbgStatus","trStatus","noTrackStatus","licenses","patentPolicies","validateDateAndRecover","fallbackDate","isFinite","formattedDate","collectSotdContent","sotdClone","hasChildNodes","isBasic","isCGBG","isCRDraft","isEd","isPR","isRecTrack","isRegular","isTagEditorFinding","license","lCaseLicense","deriveLicenseInfo","lastModified","pubSpace","derivePubSpace","maturity","docVersion","reportType","latestVersionURL","validateCGBG","validateIfAllowedOnTR","latestPath","previousPublishDate","previousMaturity","prevMaturity","pubDate","prevPubDate","prevRecShortname","uri","publishISODate","shortISODate","policies","policy","validatePatentPolicies","canShowHistory","historyURL","deriveHistoryURI","wgPotentialArray","isPr","isUpdatableRec","contains","hasCorrections","hasProposedCorrections","hasAdditions","hasProposedAdditions","noRecTrack","notAllowed","mailToWGPublicList","populateSoTD","generatedSubtitle","coreDefaults","lint","highlightVars","addSectionLinks","w3cLogo","memSubmissionLogo","w3cDefaults","doJsonLd","excludeGithubLinks","supportedStatus","validateStatusForGroup","isWgStatus","inWorkingGroup","doesNotNeedWG","processLogos","css$n","noReSpecCSS","attachFixupScript","getStyleUrl","resourceHints","createResourceHints","styleMover","linkURL","exportDoc","w3cStyle","styleFile","noToc","finalStyleURL","canonicalStatus","canUseW3CStyle","getStyleFile","colorScheme","darkModeStyleUrl","resolveGithubPromise","rejectGithubPromise","file_a_bug","participate","ghURL","tempURL","org","repo","branch","newProps","githubToken","githubUser","atRiskBase","pullBase","githubAPI","hostname","otherLink","normalizedGHObj","apiBase","normalizedConfig","DOMBuilder","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","includeId","default_title","h1Elem","isConnected","tempElem","documentTitle","setDocumentTitle","isInteger","searchString","toLocaleLowerCase","findAbstract","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","renderParent","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","range","IDBKeyRange","lowerBound","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","addAll","aliasesAndRefs","alias","promisesToAdd","flatMap","isInDB","clear","storeNames","stores","clearStorePromises","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","oneHourFromNow","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","normativity","keywordInterpretation","terms","processConformance","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","closestType","computeExport","export","titles","pluralizeDfn","dfnTexts","dfns","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$l","makeTitle","num","report","number","div","inAside","exampleTitle","css$j","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","handleIssues","ins","ghIssues","getIssueNumber","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","issueNumbers","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","decorateTableOfFigures","list_of_tables","listOfTables","decorateTable","tableId","listOfTablesCaption","getListOfTablesListItem","collectTables","listOfTablesElement","decorateListOfTables","topLevelEntities","findDfn","defn","findNormalDfn","asMethodName","findOperationDfn","resolvedName","getDfns","alternativeDfns","decorateDfn","dfnElem","idlAst","lCaseParent","middle","last","getDataType","local","exportable","addAlternativeNames","asQualifiedName","asFullyQualifiedName","asMethodWithArgs","operationName","argsAst","operationNames","isOptional","requiredArgs","requiredOperation","optionalOps","generateMethodNamesWithArgs","getAlternativeNames","originalName","foundDfns","dfnForArray","closestDfnFor","idlStruct","copyButton","createButton","addCopyIDLButton","idlHeader","idlText","clipboard","writeText","css$h","idlPartials","Text","keyword","wrapped","idlLink","defineIdlName","getIdlDefinitionClassName","parentName","idlId","getNameAndId","getDfnType","isDefaultJSON","unlinkedAnchor","nameResolverMap","getDefnName","getIdlId","resolvePartial","overload","qualifiedName","fullyQualifiedName","resolveOverload","resolveNameAndId","topLevelIdlTypes","renderWebIDL","idlElement","highlights","closestCite","cites","addIDLHeader","idls","astArray","validations","validation","THIS_SPEC","getLinkProps","citeDetails","frag","canonicalHref","relPath","linkProps","wrapInCiteEl","citePath","citeFrag","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","STORE_NAME","VERSION_CHECK_WAIT","getIdbCache","resolveXrefCache","queries","cachedData","lastChecked","setItem","API_URL","lastUpdated","shouldBustCache","clearXrefData","requiredKeySet","query","profiles","informativeRefsInNormative","getRequestEntry","getTermFromElement","specs","dataciteElem","closestSection","inlineRefs","uniqueSpecContext","higherPriority","uniqueSpecs","dedupeSpecContext","getSpecContext","types","getTypeContext","dataXrefForElem","getForContext","addDataCite","normative","isNormRef","closestNormative","closestInform","addToReferences","objectHash","buffer","TextEncoder","crypto","subtle","digest","bufferToHexString","Uint8Array","padStart","invalidProfileError","profile","normalizeConfig","bodyCite","externalDFNs","findExplicitExternalLinks","queryKeys","apiUrl","uniqueIds","uniqueQueryKeys","resultsFromCache","termsToLook","fetchedResults","fetchFromNetwork","cacheXrefData","getData","ambiguous","notFound","collector","getPrefilledFormURL","howToFix","howToCiteURL","originalTerm","formUrl","specsString","forParent","moreInfo","showErrors","addDataCiteToTerms","css$f","headingExternal","headlingLocal","dfnOf","CODE_TYPES","getLocalTermType","ds","getLocalTermParentContext","getLocalTermSuffix","appendSectionNumbers","secNum","getSectionNumber","collectExternalTerms","uniqueReferences","uniqueID","renderExternalTermEntry","typeSuffix","TYPE_TERMS","TYPED_TYPES","linkForText","getTermText","styleEl","localTermIndex","dataSortedByTerm","collectLocalTerms","renderItem","suffix","getLocalTermText","renderLocalTerm","createLocalTermIndex","externalTermIndex","dataSortedBySpec","specA","specB","createExternalTermIndex","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","showContributors","getParents","idlIndexSec","idlIndex","lowerHeaderTags","toc","scanSections","maxTocLevel","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","css$d","BROWSERS","statToText","defaultBrowsers","DEFAULTS","removeOnSave","browsers","feature","normalizeCaniuseConf","invalidBrowsers","browser","validateBrowsers","featureURL","headDlElem","contentPromise","statusText","fetchStats","toBrowserCell","browserId","browserName","supportLevel","cssClass","textVersion","getLogoSrc","browserCellRenderer","processJson","handleError","definitionPair","outputDoc","css$b","BASE_JSON_PATH","MDN_URL_BASE","MDN_BROWSERS","chrome","chrome_android","edge","edge_mobile","firefox","firefox_android","opera","opera_android","safari","safari_ios","samsunginternet_android","webview_android","inAllEngines","inSomeEngines","insertMDNBox","targetAncestor","targetSibling","mdnBox","attachMDNDetail","mdnSpec","slug","summary","support","engines","mdnSubPath","engineSupport","getEngineSupportIcons","getEngineSupport","createRow","yesNoUnknown","displayStatus","createRowFromBrowserData","versionData","version_removed","versionAdded","version_added","buildBrowserSupportTable","mdnKey","mdn","getMdnKey","mdnSpecJson","mdnConf","baseJsonPath","getMdnData","findElements","mdnSpecArray","save_snapshot","downloadLinks","epubURL","saveDialog","filename","toDownloadLink","supportsDownload","HTMLAnchorElement","search_specref","specrefSearchUI","xrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","gitRevision","metaElem","firstParagraph","status2rdf","LC","requiresCanonicalLink","addPerson","ed","worksFor","addRef","jsonld","creator","publishedDate","isbn","canonicalURI","rdfStatus","w3p","foaf","datePublished","inLanguage","isBasedOn","copyrightHolder","discussionUrl","alternativeHeadline","addl","description","contributor","citationIds","citationContents","citation","addJSONLDInfo","css$9","fetchBase","_documentCurrentScript","workerPromise","workerScript","respecWorker$1","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","missing_test_suite_uri","tests","toListItem","emojiList","testFile","testParts","testFileName","requiresConnectionEmoji","manualPerformEmoji","toTestURLs","handleDuplicates","testURLs","uniqueList","testables","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","css$5","varMap","variables","currentSection","css$3","textNode","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","monetization","paymentPointer","rawConfig","canonicalizeConfig","dfnsWithNoType","exportableDfns","addContractDefaults","describedDTs","dfnId","dfnContent","defines","definitionContainers","addDefinitionPointers","transforms","pos","performTransformations","metas","meta","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLTableCaptionElement","isDfnUnused","logger","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","sectionTitle","privacy_considerations","security_considerations","requiresSomeSectionStatus","missingRequiredSections","filesInWPT","githubAPIBase","wptDirectory","testSuiteURL","files","getFilesInWPT","missingTest","offendingMembers","getOwnPropertyNames","DISABLED_RULES","formatHintsAsMarkdown","violations","otherOptions","enabled","elementRef","resultTypes","reporter","axe","onload","onerror","importAxe","getViolations","violation","groupedBySummary","nodes","failureSummary","help","helpUrl","hints"],"mappings":"qHACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GA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OACb,CAAC,OAAQ,QACTpW,SAAQ,SAAUoW,GAClB,OAAOR,EAAUyB,cAAcjB,EAAK,GAAIA,EAAK,GAClD,IAKG,CACE,CAAC,MAAO,IACR,CAAC,SAAU,MACX,CAAC,gEAAiE,QAClE,CAAC,kCAAmC,OACpC,CAAC,QAAS,KACV,CAAC,uFAAwF,QACzF,CAAC,oBAAqB,QACtB,CAAC,uBAAwB,UACzB,CAAC,sBAAuB,MACxB,CAAC,2FAA4F,MAC7F,CAAC,qEAAsE,SACvE,CAAC,iCAAkC,MACnC,CAAC,oBAAqB,QACtB,CAAC,4FAA6F,QAC9F,CAAC,yGAA0G,QAC3G,CAAC,8FAA+F,QAChG,CAAC,0BAA2B,OAC5B,CAAC,+BAAgC,QACjC,CAAC,sBAAuB,QACxB,CAAC,oBAAqB,UACtB,CAAC,eAAgB,MACjB,CAAC,YAAa,MACd,CAAC,QAAS,QACVpW,SAAQ,SAAUoW,GAClB,OAAOR,EAAU2B,gBAAgBnB,EAAK,GAAIA,EAAK,GACpD,IAKG,CAEE,YACA,SACA,SACA,MACA,WACA,UACA,OACA,YACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,SACA,WACA,YACA,MACA,SACA,YACA,YACA,YACA,WACA,WACA,MACA,UACA,UACA,WACA,WACA,eACA,SACA,SACA,YACA,WACA,YACA,cACA,QACA,UACA,QACA,SACA,aACA,YACA,WACA,OACA,QACA,OACA,QACA,QACA,MACA,QACA,OACA,OACA,YACA,OACA,WACA,SACA,SACA,YACA,WACA,OACA,WACA,OACA,SACA,WACA,SACA,SACA,WACA,SACA,WACA,UACA,QACA,QACA,SACA,UACA,iBACA,QACA,OACA,SACA,UACA,UACA,aACA,WACA,MACA,eAEA,gBACA,SACA,SACA,YACA,WACA,QACA,WACApW,QAAQ4V,EAAU4B,oBAEb5B,CACV,IAGA,IACIA,GAAyBP,GADNI,GAAYC,SCjgBGiC,GAAU,SA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B1gC,GAAI,CACF6tB,IAAG,CAACy8C,EAAM1R,IACD,2BAA2B0R,oDAAuD1R,MAE3F,QAAIv5B,GACF,OAAOoI,EAAO;;;;;;;2DAOuC3gC,0CACtD,sDAKE,SAAakmC,GAClB,IAAKA,EAAKkc,OAAOpiD,IAAW,OAC5B,MAAM4+E,EAAiC,UAAxB14C,EAAKkc,KAAKpiD,IAAwBmgC,GAAY3F,GAE7DyqC,GAA2BlzD,SAAQ,EAAGyxD,OAAM3R,OAAMl0B,cAC5CA,EAAQ/E,UAAU6oB,SAAS,gBAC/Bm9B,EAAO5lF,GAAK+tB,IAAIy8C,EAAM3R,GAAO76D,GAAM,CACjCmiB,MAAO,6CACP6mB,SAAU,CAACrC,GACXpF,KAAMv/B,GAAKu/B,MACX,GAEN","x_google_ignoreList":[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,39]} \ No newline at end of file +{"version":3,"file":"respec-w3c.js","sources":["../src/core/expose-modules.js","../src/core/l10n.js","../node_modules/idb/build/index.js","../node_modules/webidl2/lib/error.js","../node_modules/webidl2/lib/productions/base.js","../node_modules/webidl2/lib/validators/helpers.js","../node_modules/webidl2/lib/productions/array-base.js","../node_modules/webidl2/lib/productions/token.js","../node_modules/webidl2/lib/productions/extended-attributes.js","../node_modules/webidl2/lib/productions/type.js","../node_modules/webidl2/lib/productions/default.js","../node_modules/webidl2/lib/productions/argument.js","../node_modules/webidl2/lib/productions/operation.js","../node_modules/webidl2/lib/productions/attribute.js","../node_modules/webidl2/lib/productions/helpers.js","../node_modules/webidl2/lib/tokeniser.js","../node_modules/webidl2/lib/productions/enum.js","../node_modules/webidl2/lib/productions/includes.js","../node_modules/webidl2/lib/productions/typedef.js","../node_modules/webidl2/lib/productions/callback.js","../node_modules/webidl2/lib/productions/container.js","../node_modules/webidl2/lib/productions/constant.js","../node_modules/webidl2/lib/productions/iterable.js","../node_modules/webidl2/lib/productions/constructor.js","../node_modules/webidl2/lib/productions/interface.js","../node_modules/webidl2/lib/validators/interface.js","../node_modules/webidl2/lib/productions/mixin.js","../node_modules/webidl2/lib/productions/field.js","../node_modules/webidl2/lib/productions/dictionary.js","../node_modules/webidl2/lib/productions/namespace.js","../node_modules/webidl2/lib/productions/callback-interface.js","../node_modules/webidl2/lib/webidl2.js","../node_modules/webidl2/lib/writer.js","../node_modules/webidl2/lib/validator.js","../node_modules/sniffy-mimetype/index.js","../node_modules/marked/lib/marked.esm.js","../js/deps/builds/pluralize.js","../node_modules/hyperhtml/esm.js","../src/core/import-maps.js","../src/core/utils.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/exporter.js","../src/core/respec-global.js","../src/core/post-process.js","../src/core/pre-process.js","../src/core/base-runner.js","../src/core/override-configuration.js","../src/styles/ui.css.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/w3c.js","../src/core/location-hash.js","../src/w3c/group.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/w3c/templates/headers.js","../src/w3c/templates/cgbg-headers.js","../src/w3c/templates/sotd.js","../src/w3c/templates/cgbg-sotd.js","../src/w3c/headers.js","../src/core/defaults.js","../src/w3c/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/w3c/style.js","../src/core/github.js","../src/core/sections.js","../src/core/data-include.js","../src/core/reindent.js","../src/core/title.js","../src/w3c/level.js","../src/w3c/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/core/inline-idl-parser.js","../src/core/biblio-db.js","../src/core/biblio.js","../src/core/render-biblio.js","../src/core/inlines.js","../src/w3c/conformance.js","../src/core/dfn-validators.js","../src/core/dfn-map.js","../src/core/dfn.js","../src/core/pluralize.js","../src/styles/examples.css.js","../src/core/examples.js","../src/styles/issues-notes.css.js","../src/core/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/core/tables.js","../src/core/dfn-finder.js","../src/core/webidl-clipboard.js","../src/styles/webidl.css.js","../src/core/webidl.js","../src/core/data-cite.js","../src/core/link-to-dfn.js","../src/core/xref-db.js","../src/core/xref.js","../src/styles/dfn-index.css.js","../src/core/dfn-index.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/webidl-index.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/styles/caniuse.css.js","../src/core/caniuse.js","../src/styles/mdn-annotation.css.js","../src/core/mdn-annotation.js","../src/ui/save-html.js","../src/ui/search-specref.js","../src/ui/search-xref.js","../src/ui/about-respec.js","../src/core/seo.js","../src/w3c/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/data-tests.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.js","../src/styles/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/web-monetization.js","../src/core/dfn-contract.js","../src/core/before-save.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.js","../src/core/linter-rules/check-internal-slots.js","../src/core/linter-rules/local-refs-exist.js","../src/core/linter-rules/no-captionless-tables.js","../src/core/linter-rules/no-unused-dfns.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/w3c/linter-rules/required-sections.js","../src/core/linter-rules/wpt-tests-exist.js","../src/core/linter-rules/no-http-props.js","../src/core/linter-rules/a11y.js","../src/core/linter-rules/informative-dfn.js"],"sourcesContent":["// @ts-check\nconst inAmd = !!window.require;\nif (!inAmd) {\n /**\n * @type {any}\n * @param {string[]} deps\n * @param {(...modules: any[]) => void} callback\n */\n const require = function (deps, callback) {\n const modules = deps.map(dep => {\n if (!(dep in window.require.modules)) {\n throw new Error(`Unsupported dependency name: ${dep}`);\n }\n return window.require.modules[dep];\n });\n Promise.all(modules).then(results => callback(...results));\n };\n require.modules = {};\n window.require = require;\n}\n\n/**\n * @param {string} name\n * @param {object | Promise<object>} object\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\n/**\n * Module core/l10n\n *\n * Looks at the lang attribute on the root element and uses it\n * to manage the config.l10n object so that other parts of the system can\n * localize their text.\n */\n\nexport const name = \"core/l10n\";\n\nconst html = document.documentElement;\n// Explicitly default lang and dir on <html> if not set.\n// We assume English and ltr as default for international standards.\nif (!html?.hasAttribute(\"lang\")) {\n html.lang = \"en\";\n if (!html.hasAttribute(\"dir\")) {\n html.dir = \"ltr\";\n }\n}\n\nexport const l10n = {};\n\nexport const lang = html?.lang ?? \"en\";\n\nexport function run(config) {\n config.l10n = l10n[lang] || l10n.en;\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst transactionDoneMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(this.request);\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nconst advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance'];\nconst methodMap = {};\nconst advanceResults = new WeakMap();\nconst ittrProxiedCursorToOriginalProxy = new WeakMap();\nconst cursorIteratorTraps = {\n get(target, prop) {\n if (!advanceMethodProps.includes(prop))\n return target[prop];\n let cachedFunc = methodMap[prop];\n if (!cachedFunc) {\n cachedFunc = methodMap[prop] = function (...args) {\n advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args));\n };\n }\n return cachedFunc;\n },\n};\nasync function* iterate(...args) {\n // tslint:disable-next-line:no-this-assignment\n let cursor = this;\n if (!(cursor instanceof IDBCursor)) {\n cursor = await cursor.openCursor(...args);\n }\n if (!cursor)\n return;\n cursor = cursor;\n const proxiedCursor = new Proxy(cursor, cursorIteratorTraps);\n ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor);\n // Map this double-proxy back to the original, so other cursor methods work.\n reverseTransformCache.set(proxiedCursor, unwrap(cursor));\n while (cursor) {\n yield proxiedCursor;\n // If one of the advancing methods was not called, call continue().\n cursor = await (advanceResults.get(proxiedCursor) || cursor.continue());\n advanceResults.delete(proxiedCursor);\n }\n}\nfunction isIteratorProp(target, prop) {\n return ((prop === Symbol.asyncIterator &&\n instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) ||\n (prop === 'iterate' && instanceOfAny(target, [IDBIndex, IDBObjectStore])));\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get(target, prop, receiver) {\n if (isIteratorProp(target, prop))\n return iterate;\n return oldTraps.get(target, prop, receiver);\n },\n has(target, prop) {\n return isIteratorProp(target, prop) || oldTraps.has(target, prop);\n },\n}));\n\nexport { deleteDB, openDB, unwrap, wrap };\n","/**\n * @param {string} text\n */\nfunction lastLine(text) {\n const splitted = text.split(\"\\n\");\n return splitted[splitted.length - 1];\n}\n\nfunction appendIfExist(base, target) {\n let result = base;\n if (target) {\n result += ` ${target}`;\n }\n return result;\n}\n\nfunction contextAsText(node) {\n const hierarchy = [node];\n while (node && node.parent) {\n const { parent } = node;\n hierarchy.unshift(parent);\n node = parent;\n }\n return hierarchy.map((n) => appendIfExist(n.type, n.name)).join(\" -> \");\n}\n\n/**\n * @typedef {object} WebIDL2ErrorOptions\n * @property {\"error\" | \"warning\"} [level]\n * @property {Function} [autofix]\n * @property {string} [ruleName]\n *\n * @typedef {ReturnType<typeof error>} WebIDLErrorData\n *\n * @param {string} message error message\n * @param {*} position\n * @param {*} current\n * @param {*} message\n * @param {\"Syntax\" | \"Validation\"} kind error type\n * @param {WebIDL2ErrorOptions=} options\n */\nfunction error(\n source,\n position,\n current,\n message,\n kind,\n { level = \"error\", autofix, ruleName } = {}\n) {\n /**\n * @param {number} count\n */\n function sliceTokens(count) {\n return count > 0\n ? source.slice(position, position + count)\n : source.slice(Math.max(position + count, 0), position);\n }\n\n /**\n * @param {import(\"./tokeniser.js\").Token[]} inputs\n * @param {object} [options]\n * @param {boolean} [options.precedes]\n * @returns\n */\n function tokensToText(inputs, { precedes } = {}) {\n const text = inputs.map((t) => t.trivia + t.value).join(\"\");\n const nextToken = source[position];\n if (nextToken.type === \"eof\") {\n return text;\n }\n if (precedes) {\n return text + nextToken.trivia;\n }\n return text.slice(nextToken.trivia.length);\n }\n\n const maxTokens = 5; // arbitrary but works well enough\n const line =\n source[position].type !== \"eof\"\n ? source[position].line\n : source.length > 1\n ? source[position - 1].line\n : 1;\n\n const precedingLastLine = lastLine(\n tokensToText(sliceTokens(-maxTokens), { precedes: true })\n );\n\n const subsequentTokens = sliceTokens(maxTokens);\n const subsequentText = tokensToText(subsequentTokens);\n const subsequentFirstLine = subsequentText.split(\"\\n\")[0];\n\n const spaced = \" \".repeat(precedingLastLine.length) + \"^\";\n const sourceContext = precedingLastLine + subsequentFirstLine + \"\\n\" + spaced;\n\n const contextType = kind === \"Syntax\" ? \"since\" : \"inside\";\n const inSourceName = source.name ? ` in ${source.name}` : \"\";\n const grammaticalContext =\n current && current.name\n ? `, ${contextType} \\`${current.partial ? \"partial \" : \"\"}${contextAsText(\n current\n )}\\``\n : \"\";\n const context = `${kind} error at line ${line}${inSourceName}${grammaticalContext}:\\n${sourceContext}`;\n return {\n message: `${context} ${message}`,\n bareMessage: message,\n context,\n line,\n sourceName: source.name,\n level,\n ruleName,\n autofix,\n input: subsequentText,\n tokens: subsequentTokens,\n };\n}\n\n/**\n * @param {string} message error message\n */\nexport function syntaxError(source, position, current, message) {\n return error(source, position, current, message, \"Syntax\");\n}\n\n/**\n * @param {string} message error message\n * @param {WebIDL2ErrorOptions} [options]\n */\nexport function validationError(\n token,\n current,\n ruleName,\n message,\n options = {}\n) {\n options.ruleName = ruleName;\n return error(\n current.source,\n token.index,\n current,\n message,\n \"Validation\",\n options\n );\n}\n","export class Base {\n /**\n * @param {object} initializer\n * @param {Base[\"source\"]} initializer.source\n * @param {Base[\"tokens\"]} initializer.tokens\n */\n constructor({ source, tokens }) {\n Object.defineProperties(this, {\n source: { value: source },\n tokens: { value: tokens, writable: true },\n parent: { value: null, writable: true },\n this: { value: this }, // useful when escaping from proxy\n });\n }\n\n toJSON() {\n const json = { type: undefined, name: undefined, inheritance: undefined };\n let proto = this;\n while (proto !== Object.prototype) {\n const descMap = Object.getOwnPropertyDescriptors(proto);\n for (const [key, value] of Object.entries(descMap)) {\n if (value.enumerable || value.get) {\n // @ts-ignore - allow indexing here\n json[key] = this[key];\n }\n }\n proto = Object.getPrototypeOf(proto);\n }\n return json;\n }\n}\n","/**\n * @typedef {import(\"../validator.js\").Definitions} Definitions\n * @typedef {import(\"../productions/dictionary.js\").Dictionary} Dictionary\n * @typedef {import(\"../../lib/productions/type\").Type} Type\n *\n * @param {Type} idlType\n * @param {Definitions} defs\n * @param {object} [options]\n * @param {boolean} [options.useNullableInner] use when the input idlType is nullable and you want to use its inner type\n * @return {{ reference: *, dictionary: Dictionary }} the type reference that ultimately includes dictionary.\n */\nexport function idlTypeIncludesDictionary(\n idlType,\n defs,\n { useNullableInner } = {}\n) {\n if (!idlType.union) {\n const def = defs.unique.get(idlType.idlType);\n if (!def) {\n return;\n }\n if (def.type === \"typedef\") {\n const { typedefIncludesDictionary } = defs.cache;\n if (typedefIncludesDictionary.has(def)) {\n // Note that this also halts when it met indeterminate state\n // to prevent infinite recursion\n return typedefIncludesDictionary.get(def);\n }\n defs.cache.typedefIncludesDictionary.set(def, undefined); // indeterminate state\n const result = idlTypeIncludesDictionary(def.idlType, defs);\n defs.cache.typedefIncludesDictionary.set(def, result);\n if (result) {\n return {\n reference: idlType,\n dictionary: result.dictionary,\n };\n }\n }\n if (def.type === \"dictionary\" && (useNullableInner || !idlType.nullable)) {\n return {\n reference: idlType,\n dictionary: def,\n };\n }\n }\n for (const subtype of idlType.subtype) {\n const result = idlTypeIncludesDictionary(subtype, defs);\n if (result) {\n if (subtype.union) {\n return result;\n }\n return {\n reference: subtype,\n dictionary: result.dictionary,\n };\n }\n }\n}\n\n/**\n * @param {Dictionary} dict dictionary type\n * @param {Definitions} defs\n * @return {boolean}\n */\nexport function dictionaryIncludesRequiredField(dict, defs) {\n if (defs.cache.dictionaryIncludesRequiredField.has(dict)) {\n return defs.cache.dictionaryIncludesRequiredField.get(dict);\n }\n // Set cached result to indeterminate to short-circuit circular definitions.\n // The final result will be updated to true or false.\n defs.cache.dictionaryIncludesRequiredField.set(dict, undefined);\n let result = dict.members.some((field) => field.required);\n if (!result && dict.inheritance) {\n const superdict = defs.unique.get(dict.inheritance);\n if (!superdict) {\n // Assume required members in the supertype if it is unknown.\n result = true;\n } else if (dictionaryIncludesRequiredField(superdict, defs)) {\n result = true;\n }\n }\n defs.cache.dictionaryIncludesRequiredField.set(dict, result);\n return result;\n}\n\n/**\n * For now this only checks the most frequent cases:\n * 1. direct inclusion of [EnforceRange]\n * 2. typedef of that\n *\n * More complex cases with dictionaries and records are not covered yet.\n *\n * @param {Type} idlType\n * @param {Definitions} defs\n */\nexport function idlTypeIncludesEnforceRange(idlType, defs) {\n if (idlType.union) {\n // TODO: This should ideally be checked too\n return false;\n }\n\n if (idlType.extAttrs.some((e) => e.name === \"EnforceRange\")) {\n return true;\n }\n\n const def = defs.unique.get(idlType.idlType);\n if (def?.type !== \"typedef\") {\n return false;\n }\n\n return def.idlType.extAttrs.some((e) => e.name === \"EnforceRange\");\n}\n","export class ArrayBase extends Array {\n constructor({ source, tokens }) {\n super();\n Object.defineProperties(this, {\n source: { value: source },\n tokens: { value: tokens },\n parent: { value: null, writable: true },\n });\n }\n}\n","import { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class WrappedToken extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} type\n */\n static parser(tokeniser, type) {\n return () => {\n const value = tokeniser.consumeKind(type);\n if (value) {\n return new WrappedToken({\n source: tokeniser.source,\n tokens: { value },\n });\n }\n };\n }\n\n get value() {\n return unescape(this.tokens.value.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n w.token(this.tokens.value),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\nexport class Eof extends WrappedToken {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consumeKind(\"eof\");\n if (value) {\n return new Eof({ source: tokeniser.source, tokens: { value } });\n }\n }\n\n get type() {\n return \"eof\";\n }\n}\n","import { Base } from \"./base.js\";\nimport { ArrayBase } from \"./array-base.js\";\nimport { WrappedToken } from \"./token.js\";\nimport { list, argument_list, autoParenter, unescape } from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} tokenName\n */\nfunction tokens(tokeniser, tokenName) {\n return list(tokeniser, {\n parser: WrappedToken.parser(tokeniser, tokenName),\n listName: tokenName + \" list\",\n });\n}\n\nconst extAttrValueSyntax = [\"identifier\", \"decimal\", \"integer\", \"string\"];\n\nconst shouldBeLegacyPrefixed = [\n \"NoInterfaceObject\",\n \"LenientSetter\",\n \"LenientThis\",\n \"TreatNonObjectAsNull\",\n \"Unforgeable\",\n];\n\nconst renamedLegacies = new Map([\n .../** @type {[string, string][]} */ (\n shouldBeLegacyPrefixed.map((name) => [name, `Legacy${name}`])\n ),\n [\"NamedConstructor\", \"LegacyFactoryFunction\"],\n [\"OverrideBuiltins\", \"LegacyOverrideBuiltIns\"],\n [\"TreatNullAs\", \"LegacyNullToEmptyString\"],\n]);\n\n/**\n * This will allow a set of extended attribute values to be parsed.\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction extAttrListItems(tokeniser) {\n for (const syntax of extAttrValueSyntax) {\n const toks = tokens(tokeniser, syntax);\n if (toks.length) {\n return toks;\n }\n }\n tokeniser.error(\n `Expected identifiers, strings, decimals, or integers but none found`\n );\n}\n\nexport class ExtendedAttributeParameters extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const tokens = { assign: tokeniser.consume(\"=\") };\n const ret = autoParenter(\n new ExtendedAttributeParameters({ source: tokeniser.source, tokens })\n );\n ret.list = [];\n if (tokens.assign) {\n tokens.asterisk = tokeniser.consume(\"*\");\n if (tokens.asterisk) {\n return ret.this;\n }\n tokens.secondaryName = tokeniser.consumeKind(...extAttrValueSyntax);\n }\n tokens.open = tokeniser.consume(\"(\");\n if (tokens.open) {\n ret.list = ret.rhsIsList\n ? // [Exposed=(Window,Worker)]\n extAttrListItems(tokeniser)\n : // [LegacyFactoryFunction=Audio(DOMString src)] or [Constructor(DOMString str)]\n argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") ||\n tokeniser.error(\"Unexpected token in extended attribute argument list\");\n } else if (tokens.assign && !tokens.secondaryName) {\n tokeniser.error(\"No right hand side to extended attribute assignment\");\n }\n return ret.this;\n }\n\n get rhsIsList() {\n return (\n this.tokens.assign && !this.tokens.asterisk && !this.tokens.secondaryName\n );\n }\n\n get rhsType() {\n if (this.rhsIsList) {\n return this.list[0].tokens.value.type + \"-list\";\n }\n if (this.tokens.asterisk) {\n return \"*\";\n }\n if (this.tokens.secondaryName) {\n return this.tokens.secondaryName.type;\n }\n return null;\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { rhsType } = this;\n return w.ts.wrap([\n w.token(this.tokens.assign),\n w.token(this.tokens.asterisk),\n w.reference_token(this.tokens.secondaryName, this.parent),\n w.token(this.tokens.open),\n ...this.list.map((p) => {\n return rhsType === \"identifier-list\"\n ? w.identifier(p, this.parent)\n : p.write(w);\n }),\n w.token(this.tokens.close),\n ]);\n }\n}\n\nexport class SimpleExtendedAttribute extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const name = tokeniser.consumeKind(\"identifier\");\n if (name) {\n return new SimpleExtendedAttribute({\n source: tokeniser.source,\n tokens: { name },\n params: ExtendedAttributeParameters.parse(tokeniser),\n });\n }\n }\n\n constructor({ source, tokens, params }) {\n super({ source, tokens });\n params.parent = this;\n Object.defineProperty(this, \"params\", { value: params });\n }\n\n get type() {\n return \"extended-attribute\";\n }\n get name() {\n return this.tokens.name.value;\n }\n get rhs() {\n const { rhsType: type, tokens, list } = this.params;\n if (!type) {\n return null;\n }\n const value = this.params.rhsIsList\n ? list\n : this.params.tokens.secondaryName\n ? unescape(tokens.secondaryName.value)\n : null;\n return { type, value };\n }\n get arguments() {\n const { rhsIsList, list } = this.params;\n if (!list || rhsIsList) {\n return [];\n }\n return list;\n }\n\n *validate(defs) {\n const { name } = this;\n if (name === \"LegacyNoInterfaceObject\") {\n const message = `\\`[LegacyNoInterfaceObject]\\` extended attribute is an \\\nundesirable feature that may be removed from Web IDL in the future. Refer to the \\\n[relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more \\\ninformation.`;\n yield validationError(\n this.tokens.name,\n this,\n \"no-nointerfaceobject\",\n message,\n { level: \"warning\" }\n );\n } else if (renamedLegacies.has(name)) {\n const message = `\\`[${name}]\\` extended attribute is a legacy feature \\\nthat is now renamed to \\`[${renamedLegacies.get(name)}]\\`. Refer to the \\\n[relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more \\\ninformation.`;\n yield validationError(this.tokens.name, this, \"renamed-legacy\", message, {\n level: \"warning\",\n autofix: renameLegacyExtendedAttribute(this),\n });\n }\n for (const arg of this.arguments) {\n yield* arg.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n w.ts.trivia(this.tokens.name.trivia),\n w.ts.extendedAttribute(\n w.ts.wrap([\n w.ts.extendedAttributeReference(this.name),\n this.params.write(w),\n ])\n ),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {SimpleExtendedAttribute} extAttr\n */\nfunction renameLegacyExtendedAttribute(extAttr) {\n return () => {\n const { name } = extAttr;\n extAttr.tokens.name.value = renamedLegacies.get(name);\n if (name === \"TreatNullAs\") {\n extAttr.params.tokens = {};\n }\n };\n}\n\n// Note: we parse something simpler than the official syntax. It's all that ever\n// seems to be used\nexport class ExtendedAttributes extends ArrayBase {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const tokens = {};\n tokens.open = tokeniser.consume(\"[\");\n const ret = new ExtendedAttributes({ source: tokeniser.source, tokens });\n if (!tokens.open) return ret;\n ret.push(\n ...list(tokeniser, {\n parser: SimpleExtendedAttribute.parse,\n listName: \"extended attribute\",\n })\n );\n tokens.close =\n tokeniser.consume(\"]\") ||\n tokeniser.error(\n \"Expected a closing token for the extended attribute list\"\n );\n if (!ret.length) {\n tokeniser.unconsume(tokens.close.index);\n tokeniser.error(\"An extended attribute list must not be empty\");\n }\n if (tokeniser.probe(\"[\")) {\n tokeniser.error(\n \"Illegal double extended attribute lists, consider merging them\"\n );\n }\n return ret;\n }\n\n *validate(defs) {\n for (const extAttr of this) {\n yield* extAttr.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n if (!this.length) return \"\";\n return w.ts.wrap([\n w.token(this.tokens.open),\n ...this.map((ea) => ea.write(w)),\n w.token(this.tokens.close),\n ]);\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n return_type,\n primitive_type,\n autoParenter,\n} from \"./helpers.js\";\nimport { stringTypes, typeNameKeywords } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport { idlTypeIncludesDictionary } from \"../validators/helpers.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nfunction generic_type(tokeniser, typeName) {\n const base = tokeniser.consume(\n \"FrozenArray\",\n \"ObservableArray\",\n \"Promise\",\n \"sequence\",\n \"record\"\n );\n if (!base) {\n return;\n }\n const ret = autoParenter(\n new Type({ source: tokeniser.source, tokens: { base } })\n );\n ret.tokens.open =\n tokeniser.consume(\"<\") ||\n tokeniser.error(`No opening bracket after ${base.value}`);\n switch (base.value) {\n case \"Promise\": {\n if (tokeniser.probe(\"[\"))\n tokeniser.error(\"Promise type cannot have extended attribute\");\n const subtype =\n return_type(tokeniser, typeName) ||\n tokeniser.error(\"Missing Promise subtype\");\n ret.subtype.push(subtype);\n break;\n }\n case \"sequence\":\n case \"FrozenArray\":\n case \"ObservableArray\": {\n const subtype =\n type_with_extended_attributes(tokeniser, typeName) ||\n tokeniser.error(`Missing ${base.value} subtype`);\n ret.subtype.push(subtype);\n break;\n }\n case \"record\": {\n if (tokeniser.probe(\"[\"))\n tokeniser.error(\"Record key cannot have extended attribute\");\n const keyType =\n tokeniser.consume(...stringTypes) ||\n tokeniser.error(`Record key must be one of: ${stringTypes.join(\", \")}`);\n const keyIdlType = new Type({\n source: tokeniser.source,\n tokens: { base: keyType },\n });\n keyIdlType.tokens.separator =\n tokeniser.consume(\",\") ||\n tokeniser.error(\"Missing comma after record key type\");\n keyIdlType.type = typeName;\n const valueType =\n type_with_extended_attributes(tokeniser, typeName) ||\n tokeniser.error(\"Error parsing generic type record\");\n ret.subtype.push(keyIdlType, valueType);\n break;\n }\n }\n if (!ret.idlType) tokeniser.error(`Error parsing generic type ${base.value}`);\n ret.tokens.close =\n tokeniser.consume(\">\") ||\n tokeniser.error(`Missing closing bracket after ${base.value}`);\n return ret.this;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction type_suffix(tokeniser, obj) {\n const nullable = tokeniser.consume(\"?\");\n if (nullable) {\n obj.tokens.nullable = nullable;\n }\n if (tokeniser.probe(\"?\")) tokeniser.error(\"Can't nullable more than once\");\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} typeName\n */\nfunction single_type(tokeniser, typeName) {\n let ret = generic_type(tokeniser, typeName) || primitive_type(tokeniser);\n if (!ret) {\n const base =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.consume(...stringTypes, ...typeNameKeywords);\n if (!base) {\n return;\n }\n ret = new Type({ source: tokeniser.source, tokens: { base } });\n if (tokeniser.probe(\"<\"))\n tokeniser.error(`Unsupported generic type ${base.value}`);\n }\n if (ret.generic === \"Promise\" && tokeniser.probe(\"?\")) {\n tokeniser.error(\"Promise type cannot be nullable\");\n }\n ret.type = typeName || null;\n type_suffix(tokeniser, ret);\n if (ret.nullable && ret.idlType === \"any\")\n tokeniser.error(\"Type `any` cannot be made nullable\");\n return ret;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} type\n */\nfunction union_type(tokeniser, type) {\n const tokens = {};\n tokens.open = tokeniser.consume(\"(\");\n if (!tokens.open) return;\n const ret = autoParenter(new Type({ source: tokeniser.source, tokens }));\n ret.type = type || null;\n while (true) {\n const typ =\n type_with_extended_attributes(tokeniser, type) ||\n tokeniser.error(\"No type after open parenthesis or 'or' in union type\");\n if (typ.idlType === \"any\")\n tokeniser.error(\"Type `any` cannot be included in a union type\");\n if (typ.generic === \"Promise\")\n tokeniser.error(\"Type `Promise` cannot be included in a union type\");\n ret.subtype.push(typ);\n const or = tokeniser.consume(\"or\");\n if (or) {\n typ.tokens.separator = or;\n } else break;\n }\n if (ret.idlType.length < 2) {\n tokeniser.error(\n \"At least two types are expected in a union type but found less\"\n );\n }\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated union type\");\n type_suffix(tokeniser, ret);\n return ret.this;\n}\n\nexport class Type extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} typeName\n */\n static parse(tokeniser, typeName) {\n return single_type(tokeniser, typeName) || union_type(tokeniser, typeName);\n }\n\n constructor({ source, tokens }) {\n super({ source, tokens });\n Object.defineProperty(this, \"subtype\", { value: [], writable: true });\n this.extAttrs = new ExtendedAttributes({ source, tokens: {} });\n }\n\n get generic() {\n if (this.subtype.length && this.tokens.base) {\n return this.tokens.base.value;\n }\n return \"\";\n }\n get nullable() {\n return Boolean(this.tokens.nullable);\n }\n get union() {\n return Boolean(this.subtype.length) && !this.tokens.base;\n }\n get idlType() {\n if (this.subtype.length) {\n return this.subtype;\n }\n // Adding prefixes/postfixes for \"unrestricted float\", etc.\n const name = [this.tokens.prefix, this.tokens.base, this.tokens.postfix]\n .filter((t) => t)\n .map((t) => t.value)\n .join(\" \");\n return unescape(name);\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n\n if (this.idlType === \"BufferSource\") {\n // XXX: For now this is a hack. Consider moving parents' extAttrs into types as the spec says:\n // https://webidl.spec.whatwg.org/#idl-annotated-types\n for (const extAttrs of [this.extAttrs, this.parent?.extAttrs]) {\n for (const extAttr of extAttrs) {\n if (extAttr.name !== \"AllowShared\") {\n continue;\n }\n const message = `\\`[AllowShared] BufferSource\\` is now replaced with AllowSharedBufferSource.`;\n yield validationError(\n this.tokens.base,\n this,\n \"migrate-allowshared\",\n message,\n { autofix: replaceAllowShared(this, extAttr, extAttrs) }\n );\n }\n }\n }\n\n if (this.idlType === \"void\") {\n const message = `\\`void\\` is now replaced by \\`undefined\\`. Refer to the \\\n[relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) \\\nfor more information.`;\n yield validationError(this.tokens.base, this, \"replace-void\", message, {\n autofix: replaceVoid(this),\n });\n }\n\n /*\n * If a union is nullable, its subunions cannot include a dictionary\n * If not, subunions may include dictionaries if each union is not nullable\n */\n const typedef = !this.union && defs.unique.get(this.idlType);\n const target = this.union\n ? this\n : typedef && typedef.type === \"typedef\"\n ? typedef.idlType\n : undefined;\n if (target && this.nullable) {\n // do not allow any dictionary\n const { reference } = idlTypeIncludesDictionary(target, defs) || {};\n if (reference) {\n const targetToken = (this.union ? reference : this).tokens.base;\n const message = \"Nullable union cannot include a dictionary type.\";\n yield validationError(\n targetToken,\n this,\n \"no-nullable-union-dict\",\n message\n );\n }\n } else {\n // allow some dictionary\n for (const subtype of this.subtype) {\n yield* subtype.validate(defs);\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const type_body = () => {\n if (this.union || this.generic) {\n return w.ts.wrap([\n w.token(this.tokens.base, w.ts.generic),\n w.token(this.tokens.open),\n ...this.subtype.map((t) => t.write(w)),\n w.token(this.tokens.close),\n ]);\n }\n const firstToken = this.tokens.prefix || this.tokens.base;\n const prefix = this.tokens.prefix\n ? [this.tokens.prefix.value, w.ts.trivia(this.tokens.base.trivia)]\n : [];\n const ref = w.reference(\n w.ts.wrap([\n ...prefix,\n this.tokens.base.value,\n w.token(this.tokens.postfix),\n ]),\n {\n unescaped: /** @type {string} (because it's not union) */ (\n this.idlType\n ),\n context: this,\n }\n );\n return w.ts.wrap([w.ts.trivia(firstToken.trivia), ref]);\n };\n return w.ts.wrap([\n this.extAttrs.write(w),\n type_body(),\n w.token(this.tokens.nullable),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {Type} type\n * @param {import(\"./extended-attributes.js\").SimpleExtendedAttribute} extAttr\n * @param {ExtendedAttributes} extAttrs\n */\nfunction replaceAllowShared(type, extAttr, extAttrs) {\n return () => {\n const index = extAttrs.indexOf(extAttr);\n extAttrs.splice(index, 1);\n if (!extAttrs.length && type.tokens.base.trivia.match(/^\\s$/)) {\n type.tokens.base.trivia = \"\"; // (let's not remove comments)\n }\n\n type.tokens.base.value = \"AllowSharedBufferSource\";\n };\n}\n\n/**\n * @param {Type} type\n */\nfunction replaceVoid(type) {\n return () => {\n type.tokens.base.value = \"undefined\";\n };\n}\n","import { Base } from \"./base.js\";\nimport { const_data, const_value } from \"./helpers.js\";\n\nexport class Default extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const assign = tokeniser.consume(\"=\");\n if (!assign) {\n return null;\n }\n const def =\n const_value(tokeniser) ||\n tokeniser.consumeKind(\"string\") ||\n tokeniser.consume(\"null\", \"[\", \"{\") ||\n tokeniser.error(\"No value for default\");\n const expression = [def];\n if (def.value === \"[\") {\n const close =\n tokeniser.consume(\"]\") ||\n tokeniser.error(\"Default sequence value must be empty\");\n expression.push(close);\n } else if (def.value === \"{\") {\n const close =\n tokeniser.consume(\"}\") ||\n tokeniser.error(\"Default dictionary value must be empty\");\n expression.push(close);\n }\n return new Default({\n source: tokeniser.source,\n tokens: { assign },\n expression,\n });\n }\n\n constructor({ source, tokens, expression }) {\n super({ source, tokens });\n expression.parent = this;\n Object.defineProperty(this, \"expression\", { value: expression });\n }\n\n get type() {\n return const_data(this.expression[0]).type;\n }\n get value() {\n return const_data(this.expression[0]).value;\n }\n get negative() {\n return const_data(this.expression[0]).negative;\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n w.token(this.tokens.assign),\n ...this.expression.map((t) => w.token(t)),\n ]);\n }\n}\n","import { Base } from \"./base.js\";\nimport { Default } from \"./default.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n autoParenter,\n getFirstToken,\n} from \"./helpers.js\";\nimport { argumentNameKeywords, Tokeniser } from \"../tokeniser.js\";\nimport { validationError } from \"../error.js\";\nimport {\n idlTypeIncludesDictionary,\n dictionaryIncludesRequiredField,\n} from \"../validators/helpers.js\";\n\nexport class Argument extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const start_position = tokeniser.position;\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(\n new Argument({ source: tokeniser.source, tokens })\n );\n ret.extAttrs = ExtendedAttributes.parse(tokeniser);\n tokens.optional = tokeniser.consume(\"optional\");\n ret.idlType = type_with_extended_attributes(tokeniser, \"argument-type\");\n if (!ret.idlType) {\n return tokeniser.unconsume(start_position);\n }\n if (!tokens.optional) {\n tokens.variadic = tokeniser.consume(\"...\");\n }\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.consume(...argumentNameKeywords);\n if (!tokens.name) {\n return tokeniser.unconsume(start_position);\n }\n ret.default = tokens.optional ? Default.parse(tokeniser) : null;\n return ret.this;\n }\n\n get type() {\n return \"argument\";\n }\n get optional() {\n return !!this.tokens.optional;\n }\n get variadic() {\n return !!this.tokens.variadic;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n /**\n * @param {import(\"../validator.js\").Definitions} defs\n */\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n const result = idlTypeIncludesDictionary(this.idlType, defs, {\n useNullableInner: true,\n });\n if (result) {\n if (this.idlType.nullable) {\n const message = `Dictionary arguments cannot be nullable.`;\n yield validationError(\n this.tokens.name,\n this,\n \"no-nullable-dict-arg\",\n message\n );\n } else if (!this.optional) {\n if (\n this.parent &&\n !dictionaryIncludesRequiredField(result.dictionary, defs) &&\n isLastRequiredArgument(this)\n ) {\n const message = `Dictionary argument must be optional if it has no required fields`;\n yield validationError(\n this.tokens.name,\n this,\n \"dict-arg-optional\",\n message,\n {\n autofix: autofixDictionaryArgumentOptionality(this),\n }\n );\n }\n } else if (!this.default) {\n const message = `Optional dictionary arguments must have a default value of \\`{}\\`.`;\n yield validationError(\n this.tokens.name,\n this,\n \"dict-arg-default\",\n message,\n {\n autofix: autofixOptionalDictionaryDefaultValue(this),\n }\n );\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.optional),\n w.ts.type(this.idlType.write(w)),\n w.token(this.tokens.variadic),\n w.name_token(this.tokens.name, { data: this }),\n this.default ? this.default.write(w) : \"\",\n w.token(this.tokens.separator),\n ]);\n }\n}\n\n/**\n * @param {Argument} arg\n */\nfunction isLastRequiredArgument(arg) {\n const list = arg.parent.arguments || arg.parent.list;\n const index = list.indexOf(arg);\n const requiredExists = list.slice(index + 1).some((a) => !a.optional);\n return !requiredExists;\n}\n\n/**\n * @param {Argument} arg\n */\nfunction autofixDictionaryArgumentOptionality(arg) {\n return () => {\n const firstToken = getFirstToken(arg.idlType);\n arg.tokens.optional = {\n ...firstToken,\n type: \"optional\",\n value: \"optional\",\n };\n firstToken.trivia = \" \";\n autofixOptionalDictionaryDefaultValue(arg)();\n };\n}\n\n/**\n * @param {Argument} arg\n */\nfunction autofixOptionalDictionaryDefaultValue(arg) {\n return () => {\n arg.default = Default.parse(new Tokeniser(\" = {}\"));\n };\n}\n","import { Base } from \"./base.js\";\nimport {\n return_type,\n argument_list,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\n\nexport class Operation extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.special]\n * @param {import(\"../tokeniser.js\").Token} [options.regular]\n */\n static parse(tokeniser, { special, regular } = {}) {\n const tokens = { special };\n const ret = autoParenter(\n new Operation({ source: tokeniser.source, tokens })\n );\n if (special && special.value === \"stringifier\") {\n tokens.termination = tokeniser.consume(\";\");\n if (tokens.termination) {\n ret.arguments = [];\n return ret;\n }\n }\n if (!special && !regular) {\n tokens.special = tokeniser.consume(\"getter\", \"setter\", \"deleter\");\n }\n ret.idlType =\n return_type(tokeniser) || tokeniser.error(\"Missing return type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") || tokeniser.consume(\"includes\");\n tokens.open =\n tokeniser.consume(\"(\") || tokeniser.error(\"Invalid operation\");\n ret.arguments = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated operation\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated operation, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"operation\";\n }\n get name() {\n const { name } = this.tokens;\n if (!name) {\n return \"\";\n }\n return unescape(name.value);\n }\n get special() {\n if (!this.tokens.special) {\n return \"\";\n }\n return this.tokens.special.value;\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n if (!this.name && [\"\", \"static\"].includes(this.special)) {\n const message = `Regular or static operations must have both a return type and an identifier.`;\n yield validationError(this.tokens.open, this, \"incomplete-op\", message);\n }\n if (this.idlType) {\n yield* this.idlType.validate(defs);\n }\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n const body = this.idlType\n ? [\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.open),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.close),\n ]\n : [];\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n this.tokens.name\n ? w.token(this.tokens.special)\n : w.token(this.tokens.special, w.ts.nameless, { data: this, parent }),\n ...body,\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { validationError } from \"../error.js\";\nimport {\n idlTypeIncludesDictionary,\n idlTypeIncludesEnforceRange,\n} from \"../validators/helpers.js\";\nimport { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\n\nexport class Attribute extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"../tokeniser.js\").Token} [options.special]\n * @param {boolean} [options.noInherit]\n * @param {boolean} [options.readonly]\n */\n static parse(\n tokeniser,\n { special, noInherit = false, readonly = false } = {}\n ) {\n const start_position = tokeniser.position;\n const tokens = { special };\n const ret = autoParenter(\n new Attribute({ source: tokeniser.source, tokens })\n );\n if (!special && !noInherit) {\n tokens.special = tokeniser.consume(\"inherit\");\n }\n if (ret.special === \"inherit\" && tokeniser.probe(\"readonly\")) {\n tokeniser.error(\"Inherited attributes cannot be read-only\");\n }\n tokens.readonly = tokeniser.consume(\"readonly\");\n if (readonly && !tokens.readonly && tokeniser.probe(\"attribute\")) {\n tokeniser.error(\"Attributes must be readonly in this context\");\n }\n tokens.base = tokeniser.consume(\"attribute\");\n if (!tokens.base) {\n tokeniser.unconsume(start_position);\n return;\n }\n ret.idlType =\n type_with_extended_attributes(tokeniser, \"attribute-type\") ||\n tokeniser.error(\"Attribute lacks a type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.consume(\"async\", \"required\") ||\n tokeniser.error(\"Attribute lacks a name\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated attribute, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"attribute\";\n }\n get special() {\n if (!this.tokens.special) {\n return \"\";\n }\n return this.tokens.special.value;\n }\n get readonly() {\n return !!this.tokens.readonly;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n\n if ([\"sequence\", \"record\"].includes(this.idlType.generic)) {\n const message = `Attributes cannot accept ${this.idlType.generic} types.`;\n yield validationError(\n this.tokens.name,\n this,\n \"attr-invalid-type\",\n message\n );\n }\n\n {\n const { reference } = idlTypeIncludesDictionary(this.idlType, defs) || {};\n if (reference) {\n const targetToken = (this.idlType.union ? reference : this.idlType)\n .tokens.base;\n const message = \"Attributes cannot accept dictionary types.\";\n yield validationError(targetToken, this, \"attr-invalid-type\", message);\n }\n }\n\n if (this.readonly) {\n if (idlTypeIncludesEnforceRange(this.idlType, defs)) {\n const targetToken = this.idlType.tokens.base;\n const message =\n \"Readonly attributes cannot accept [EnforceRange] extended attribute.\";\n yield validationError(targetToken, this, \"attr-invalid-type\", message);\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.special),\n w.token(this.tokens.readonly),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Type } from \"./type.js\";\nimport { Argument } from \"./argument.js\";\nimport {\n ExtendedAttributes,\n SimpleExtendedAttribute,\n} from \"./extended-attributes.js\";\nimport { Operation } from \"./operation.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Tokeniser } from \"../tokeniser.js\";\n\n/**\n * @param {string} identifier\n */\nexport function unescape(identifier) {\n return identifier.startsWith(\"_\") ? identifier.slice(1) : identifier;\n}\n\n/**\n * Parses comma-separated list\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} args\n * @param {Function} args.parser parser function for each item\n * @param {boolean} [args.allowDangler] whether to allow dangling comma\n * @param {string} [args.listName] the name to be shown on error messages\n */\nexport function list(tokeniser, { parser, allowDangler, listName = \"list\" }) {\n const first = parser(tokeniser);\n if (!first) {\n return [];\n }\n first.tokens.separator = tokeniser.consume(\",\");\n const items = [first];\n while (first.tokens.separator) {\n const item = parser(tokeniser);\n if (!item) {\n if (!allowDangler) {\n tokeniser.error(`Trailing comma in ${listName}`);\n }\n break;\n }\n item.tokens.separator = tokeniser.consume(\",\");\n items.push(item);\n if (!item.tokens.separator) break;\n }\n return items;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function const_value(tokeniser) {\n return (\n tokeniser.consumeKind(\"decimal\", \"integer\") ||\n tokeniser.consume(\"true\", \"false\", \"Infinity\", \"-Infinity\", \"NaN\")\n );\n}\n\n/**\n * @param {object} token\n * @param {string} token.type\n * @param {string} token.value\n */\nexport function const_data({ type, value }) {\n switch (type) {\n case \"decimal\":\n case \"integer\":\n return { type: \"number\", value };\n case \"string\":\n return { type: \"string\", value: value.slice(1, -1) };\n }\n\n switch (value) {\n case \"true\":\n case \"false\":\n return { type: \"boolean\", value: value === \"true\" };\n case \"Infinity\":\n case \"-Infinity\":\n return { type: \"Infinity\", negative: value.startsWith(\"-\") };\n case \"[\":\n return { type: \"sequence\", value: [] };\n case \"{\":\n return { type: \"dictionary\" };\n default:\n return { type: value };\n }\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function primitive_type(tokeniser) {\n function integer_type() {\n const prefix = tokeniser.consume(\"unsigned\");\n const base = tokeniser.consume(\"short\", \"long\");\n if (base) {\n const postfix = tokeniser.consume(\"long\");\n return new Type({ source, tokens: { prefix, base, postfix } });\n }\n if (prefix) tokeniser.error(\"Failed to parse integer type\");\n }\n\n function decimal_type() {\n const prefix = tokeniser.consume(\"unrestricted\");\n const base = tokeniser.consume(\"float\", \"double\");\n if (base) {\n return new Type({ source, tokens: { prefix, base } });\n }\n if (prefix) tokeniser.error(\"Failed to parse float type\");\n }\n\n const { source } = tokeniser;\n const num_type = integer_type() || decimal_type();\n if (num_type) return num_type;\n const base = tokeniser.consume(\n \"bigint\",\n \"boolean\",\n \"byte\",\n \"octet\",\n \"undefined\"\n );\n if (base) {\n return new Type({ source, tokens: { base } });\n }\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function argument_list(tokeniser) {\n return list(tokeniser, {\n parser: Argument.parse,\n listName: \"arguments list\",\n });\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string=} typeName (TODO: See Type.type for more details)\n */\nexport function type_with_extended_attributes(tokeniser, typeName) {\n const extAttrs = ExtendedAttributes.parse(tokeniser);\n const ret = Type.parse(tokeniser, typeName);\n if (ret) autoParenter(ret).extAttrs = extAttrs;\n return ret;\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string=} typeName (TODO: See Type.type for more details)\n */\nexport function return_type(tokeniser, typeName) {\n const typ = Type.parse(tokeniser, typeName || \"return-type\");\n if (typ) {\n return typ;\n }\n const voidToken = tokeniser.consume(\"void\");\n if (voidToken) {\n const ret = new Type({\n source: tokeniser.source,\n tokens: { base: voidToken },\n });\n ret.type = \"return-type\";\n return ret;\n }\n}\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nexport function stringifier(tokeniser) {\n const special = tokeniser.consume(\"stringifier\");\n if (!special) return;\n const member =\n Attribute.parse(tokeniser, { special }) ||\n Operation.parse(tokeniser, { special }) ||\n tokeniser.error(\"Unterminated stringifier\");\n return member;\n}\n\n/**\n * @param {string} str\n */\nexport function getLastIndentation(str) {\n const lines = str.split(\"\\n\");\n // the first line visually binds to the preceding token\n if (lines.length) {\n const match = lines[lines.length - 1].match(/^\\s+/);\n if (match) {\n return match[0];\n }\n }\n return \"\";\n}\n\n/**\n * @param {string} parentTrivia\n */\nexport function getMemberIndentation(parentTrivia) {\n const indentation = getLastIndentation(parentTrivia);\n const indentCh = indentation.includes(\"\\t\") ? \"\\t\" : \" \";\n return indentation + indentCh;\n}\n\n/**\n * @param {import(\"./interface.js\").Interface} def\n */\nexport function autofixAddExposedWindow(def) {\n return () => {\n if (def.extAttrs.length) {\n const tokeniser = new Tokeniser(\"Exposed=Window,\");\n const exposed = SimpleExtendedAttribute.parse(tokeniser);\n exposed.tokens.separator = tokeniser.consume(\",\");\n const existing = def.extAttrs[0];\n if (!/^\\s/.test(existing.tokens.name.trivia)) {\n existing.tokens.name.trivia = ` ${existing.tokens.name.trivia}`;\n }\n def.extAttrs.unshift(exposed);\n } else {\n autoParenter(def).extAttrs = ExtendedAttributes.parse(\n new Tokeniser(\"[Exposed=Window]\")\n );\n const trivia = def.tokens.base.trivia;\n def.extAttrs.tokens.open.trivia = trivia;\n def.tokens.base.trivia = `\\n${getLastIndentation(trivia)}`;\n }\n };\n}\n\n/**\n * Get the first syntax token for the given IDL object.\n * @param {*} data\n */\nexport function getFirstToken(data) {\n if (data.extAttrs.length) {\n return data.extAttrs.tokens.open;\n }\n if (data.type === \"operation\" && !data.special) {\n return getFirstToken(data.idlType);\n }\n const tokens = Object.values(data.tokens).sort((x, y) => x.index - y.index);\n return tokens[0];\n}\n\n/**\n * @template T\n * @param {T[]} array\n * @param {(item: T) => boolean} predicate\n */\nexport function findLastIndex(array, predicate) {\n const index = array.slice().reverse().findIndex(predicate);\n if (index === -1) {\n return index;\n }\n return array.length - index - 1;\n}\n\n/**\n * Returns a proxy that auto-assign `parent` field.\n * @template {Record<string | symbol, any>} T\n * @param {T} data\n * @param {*} [parent] The object that will be assigned to `parent`.\n * If absent, it will be `data` by default.\n * @return {T}\n */\nexport function autoParenter(data, parent) {\n if (!parent) {\n // Defaults to `data` unless specified otherwise.\n parent = data;\n }\n if (!data) {\n // This allows `autoParenter(undefined)` which again allows\n // `autoParenter(parse())` where the function may return nothing.\n return data;\n }\n const proxy = new Proxy(data, {\n get(target, p) {\n const value = target[p];\n if (Array.isArray(value) && p !== \"source\") {\n // Wraps the array so that any added items will also automatically\n // get their `parent` values.\n return autoParenter(value, target);\n }\n return value;\n },\n set(target, p, value) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/47357\n target[p] = value;\n if (!value) {\n return true;\n } else if (Array.isArray(value)) {\n // Assigning an array will add `parent` to its items.\n for (const item of value) {\n if (typeof item.parent !== \"undefined\") {\n item.parent = parent;\n }\n }\n } else if (typeof value.parent !== \"undefined\") {\n value.parent = parent;\n }\n return true;\n },\n });\n return proxy;\n}\n","import { syntaxError } from \"./error.js\";\nimport { unescape } from \"./productions/helpers.js\";\n\n// These regular expressions use the sticky flag so they will only match at\n// the current location (ie. the offset of lastIndex).\nconst tokenRe = {\n // This expression uses a lookahead assertion to catch false matches\n // against integers early.\n decimal:\n /-?(?=[0-9]*\\.|[0-9]+[eE])(([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,\n integer: /-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,\n identifier: /[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,\n string: /\"[^\"]*\"/y,\n whitespace: /[\\t\\n\\r ]+/y,\n comment: /\\/\\/.*|\\/\\*[\\s\\S]*?\\*\\//y,\n other: /[^\\t\\n\\r 0-9A-Za-z]/y,\n};\n\nexport const typeNameKeywords = [\n \"ArrayBuffer\",\n \"SharedArrayBuffer\",\n \"DataView\",\n \"Int8Array\",\n \"Int16Array\",\n \"Int32Array\",\n \"Uint8Array\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8ClampedArray\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Float32Array\",\n \"Float64Array\",\n \"any\",\n \"object\",\n \"symbol\",\n];\n\nexport const stringTypes = [\"ByteString\", \"DOMString\", \"USVString\"];\n\nexport const argumentNameKeywords = [\n \"async\",\n \"attribute\",\n \"callback\",\n \"const\",\n \"constructor\",\n \"deleter\",\n \"dictionary\",\n \"enum\",\n \"getter\",\n \"includes\",\n \"inherit\",\n \"interface\",\n \"iterable\",\n \"maplike\",\n \"namespace\",\n \"partial\",\n \"required\",\n \"setlike\",\n \"setter\",\n \"static\",\n \"stringifier\",\n \"typedef\",\n \"unrestricted\",\n];\n\nconst nonRegexTerminals = [\n \"-Infinity\",\n \"FrozenArray\",\n \"Infinity\",\n \"NaN\",\n \"ObservableArray\",\n \"Promise\",\n \"bigint\",\n \"boolean\",\n \"byte\",\n \"double\",\n \"false\",\n \"float\",\n \"long\",\n \"mixin\",\n \"null\",\n \"octet\",\n \"optional\",\n \"or\",\n \"readonly\",\n \"record\",\n \"sequence\",\n \"short\",\n \"true\",\n \"undefined\",\n \"unsigned\",\n \"void\",\n].concat(argumentNameKeywords, stringTypes, typeNameKeywords);\n\nconst punctuations = [\n \"(\",\n \")\",\n \",\",\n \"...\",\n \":\",\n \";\",\n \"<\",\n \"=\",\n \">\",\n \"?\",\n \"*\",\n \"[\",\n \"]\",\n \"{\",\n \"}\",\n];\n\nconst reserved = [\n // \"constructor\" is now a keyword\n \"_constructor\",\n \"toString\",\n \"_toString\",\n];\n\n/**\n * @typedef {ArrayItemType<ReturnType<typeof tokenise>>} Token\n * @param {string} str\n */\nfunction tokenise(str) {\n const tokens = [];\n let lastCharIndex = 0;\n let trivia = \"\";\n let line = 1;\n let index = 0;\n while (lastCharIndex < str.length) {\n const nextChar = str.charAt(lastCharIndex);\n let result = -1;\n\n if (/[\\t\\n\\r ]/.test(nextChar)) {\n result = attemptTokenMatch(\"whitespace\", { noFlushTrivia: true });\n } else if (nextChar === \"/\") {\n result = attemptTokenMatch(\"comment\", { noFlushTrivia: true });\n }\n\n if (result !== -1) {\n const currentTrivia = tokens.pop().value;\n line += (currentTrivia.match(/\\n/g) || []).length;\n trivia += currentTrivia;\n index -= 1;\n } else if (/[-0-9.A-Z_a-z]/.test(nextChar)) {\n result = attemptTokenMatch(\"decimal\");\n if (result === -1) {\n result = attemptTokenMatch(\"integer\");\n }\n if (result === -1) {\n result = attemptTokenMatch(\"identifier\");\n const lastIndex = tokens.length - 1;\n const token = tokens[lastIndex];\n if (result !== -1) {\n if (reserved.includes(token.value)) {\n const message = `${unescape(\n token.value\n )} is a reserved identifier and must not be used.`;\n throw new WebIDLParseError(\n syntaxError(tokens, lastIndex, null, message)\n );\n } else if (nonRegexTerminals.includes(token.value)) {\n token.type = \"inline\";\n }\n }\n }\n } else if (nextChar === '\"') {\n result = attemptTokenMatch(\"string\");\n }\n\n for (const punctuation of punctuations) {\n if (str.startsWith(punctuation, lastCharIndex)) {\n tokens.push({\n type: \"inline\",\n value: punctuation,\n trivia,\n line,\n index,\n });\n trivia = \"\";\n lastCharIndex += punctuation.length;\n result = lastCharIndex;\n break;\n }\n }\n\n // other as the last try\n if (result === -1) {\n result = attemptTokenMatch(\"other\");\n }\n if (result === -1) {\n throw new Error(\"Token stream not progressing\");\n }\n lastCharIndex = result;\n index += 1;\n }\n\n // remaining trivia as eof\n tokens.push({\n type: \"eof\",\n value: \"\",\n trivia,\n line,\n index,\n });\n\n return tokens;\n\n /**\n * @param {keyof typeof tokenRe} type\n * @param {object} options\n * @param {boolean} [options.noFlushTrivia]\n */\n function attemptTokenMatch(type, { noFlushTrivia } = {}) {\n const re = tokenRe[type];\n re.lastIndex = lastCharIndex;\n const result = re.exec(str);\n if (result) {\n tokens.push({ type, value: result[0], trivia, line, index });\n if (!noFlushTrivia) {\n trivia = \"\";\n }\n return re.lastIndex;\n }\n return -1;\n }\n}\n\nexport class Tokeniser {\n /**\n * @param {string} idl\n */\n constructor(idl) {\n this.source = tokenise(idl);\n this.position = 0;\n }\n\n /**\n * @param {string} message\n * @return {never}\n */\n error(message) {\n throw new WebIDLParseError(\n syntaxError(this.source, this.position, this.current, message)\n );\n }\n\n /**\n * @param {string} type\n */\n probeKind(type) {\n return (\n this.source.length > this.position &&\n this.source[this.position].type === type\n );\n }\n\n /**\n * @param {string} value\n */\n probe(value) {\n return (\n this.probeKind(\"inline\") && this.source[this.position].value === value\n );\n }\n\n /**\n * @param {...string} candidates\n */\n consumeKind(...candidates) {\n for (const type of candidates) {\n if (!this.probeKind(type)) continue;\n const token = this.source[this.position];\n this.position++;\n return token;\n }\n }\n\n /**\n * @param {...string} candidates\n */\n consume(...candidates) {\n if (!this.probeKind(\"inline\")) return;\n const token = this.source[this.position];\n for (const value of candidates) {\n if (token.value !== value) continue;\n this.position++;\n return token;\n }\n }\n\n /**\n * @param {string} value\n */\n consumeIdentifier(value) {\n if (!this.probeKind(\"identifier\")) {\n return;\n }\n if (this.source[this.position].value !== value) {\n return;\n }\n return this.consumeKind(\"identifier\");\n }\n\n /**\n * @param {number} position\n */\n unconsume(position) {\n this.position = position;\n }\n}\n\nexport class WebIDLParseError extends Error {\n /**\n * @param {object} options\n * @param {string} options.message\n * @param {string} options.bareMessage\n * @param {string} options.context\n * @param {number} options.line\n * @param {*} options.sourceName\n * @param {string} options.input\n * @param {*[]} options.tokens\n */\n constructor({\n message,\n bareMessage,\n context,\n line,\n sourceName,\n input,\n tokens,\n }) {\n super(message);\n\n this.name = \"WebIDLParseError\"; // not to be mangled\n this.bareMessage = bareMessage;\n this.context = context;\n this.line = line;\n this.sourceName = sourceName;\n this.input = input;\n this.tokens = tokens;\n }\n}\n","import { list, unescape, autoParenter } from \"./helpers.js\";\nimport { WrappedToken } from \"./token.js\";\nimport { Base } from \"./base.js\";\n\nexport class EnumValue extends WrappedToken {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consumeKind(\"string\");\n if (value) {\n return new EnumValue({ source: tokeniser.source, tokens: { value } });\n }\n }\n\n get type() {\n return \"enum-value\";\n }\n get value() {\n return super.value.slice(1, -1);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.wrap([\n w.ts.trivia(this.tokens.value.trivia),\n w.ts.definition(\n w.ts.wrap(['\"', w.ts.name(this.value, { data: this, parent }), '\"']),\n { data: this, parent }\n ),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\nexport class Enum extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n tokens.base = tokeniser.consume(\"enum\");\n if (!tokens.base) {\n return;\n }\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"No name for enum\");\n const ret = autoParenter(new Enum({ source: tokeniser.source, tokens }));\n tokeniser.current = ret.this;\n tokens.open = tokeniser.consume(\"{\") || tokeniser.error(\"Bodyless enum\");\n ret.values = list(tokeniser, {\n parser: EnumValue.parse,\n allowDangler: true,\n listName: \"enumeration\",\n });\n if (tokeniser.probeKind(\"string\")) {\n tokeniser.error(\"No comma between enum values\");\n }\n tokens.close =\n tokeniser.consume(\"}\") || tokeniser.error(\"Unexpected value in enum\");\n if (!ret.values.length) {\n tokeniser.error(\"No value in enum\");\n }\n tokens.termination =\n tokeniser.consume(\";\") || tokeniser.error(\"No semicolon after enum\");\n return ret.this;\n }\n\n get type() {\n return \"enum\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.open),\n w.ts.wrap(this.values.map((v) => v.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class Includes extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const target = tokeniser.consumeKind(\"identifier\");\n if (!target) {\n return;\n }\n const tokens = { target };\n tokens.includes = tokeniser.consume(\"includes\");\n if (!tokens.includes) {\n tokeniser.unconsume(target.index);\n return;\n }\n tokens.mixin =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Incomplete includes statement\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"No terminating ; for includes statement\");\n return new Includes({ source: tokeniser.source, tokens });\n }\n\n get type() {\n return \"includes\";\n }\n get target() {\n return unescape(this.tokens.target.value);\n }\n get includes() {\n return unescape(this.tokens.mixin.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.reference_token(this.tokens.target, this),\n w.token(this.tokens.includes),\n w.reference_token(this.tokens.mixin, this),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\n\nexport class Typedef extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(new Typedef({ source: tokeniser.source, tokens }));\n tokens.base = tokeniser.consume(\"typedef\");\n if (!tokens.base) {\n return;\n }\n ret.idlType =\n type_with_extended_attributes(tokeniser, \"typedef-type\") ||\n tokeniser.error(\"Typedef lacks a type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Typedef lacks a name\");\n tokeniser.current = ret.this;\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated typedef, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"typedef\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n return_type,\n argument_list,\n unescape,\n autoParenter,\n} from \"./helpers.js\";\n\nexport class CallbackFunction extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser, base) {\n const tokens = { base };\n const ret = autoParenter(\n new CallbackFunction({ source: tokeniser.source, tokens })\n );\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Callback lacks a name\");\n tokeniser.current = ret.this;\n tokens.assign =\n tokeniser.consume(\"=\") || tokeniser.error(\"Callback lacks an assignment\");\n ret.idlType =\n return_type(tokeniser) || tokeniser.error(\"Callback lacks a return type\");\n tokens.open =\n tokeniser.consume(\"(\") ||\n tokeniser.error(\"Callback lacks parentheses for arguments\");\n ret.arguments = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated callback\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated callback, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"callback\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n yield* this.idlType.validate(defs);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.name_token(this.tokens.name, { data: this }),\n w.token(this.tokens.assign),\n w.ts.type(this.idlType.write(w)),\n w.token(this.tokens.open),\n ...this.arguments.map((arg) => arg.write(w)),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport { unescape, autoParenter } from \"./helpers.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction inheritance(tokeniser) {\n const colon = tokeniser.consume(\":\");\n if (!colon) {\n return {};\n }\n const inheritance =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Inheritance lacks a type\");\n return { colon, inheritance };\n}\n\n/**\n * Parser callback.\n * @callback ParserCallback\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {...*} args\n */\n\n/**\n * A parser callback and optional option object.\n * @typedef AllowedMember\n * @type {[ParserCallback, object?]}\n */\n\nexport class Container extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {*} instance TODO: This should be {T extends Container}, but see https://github.com/microsoft/TypeScript/issues/4628\n * @param {*} args\n */\n static parse(tokeniser, instance, { inheritable, allowedMembers }) {\n const { tokens, type } = instance;\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(`Missing name in ${type}`);\n tokeniser.current = instance;\n instance = autoParenter(instance);\n if (inheritable) {\n Object.assign(tokens, inheritance(tokeniser));\n }\n tokens.open = tokeniser.consume(\"{\") || tokeniser.error(`Bodyless ${type}`);\n instance.members = [];\n while (true) {\n tokens.close = tokeniser.consume(\"}\");\n if (tokens.close) {\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(`Missing semicolon after ${type}`);\n return instance.this;\n }\n const ea = ExtendedAttributes.parse(tokeniser);\n let mem;\n for (const [parser, ...args] of allowedMembers) {\n mem = autoParenter(parser(tokeniser, ...args));\n if (mem) {\n break;\n }\n }\n if (!mem) {\n tokeniser.error(\"Unknown member\");\n }\n mem.extAttrs = ea;\n instance.members.push(mem.this);\n }\n }\n\n get partial() {\n return !!this.tokens.partial;\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get inheritance() {\n if (!this.tokens.inheritance) {\n return null;\n }\n return unescape(this.tokens.inheritance.value);\n }\n\n *validate(defs) {\n for (const member of this.members) {\n if (member.validate) {\n yield* member.validate(defs);\n }\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const inheritance = () => {\n if (!this.tokens.inheritance) {\n return \"\";\n }\n return w.ts.wrap([\n w.token(this.tokens.colon),\n w.ts.trivia(this.tokens.inheritance.trivia),\n w.ts.inheritance(\n w.reference(this.tokens.inheritance.value, { context: this })\n ),\n ]);\n };\n\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.callback),\n w.token(this.tokens.partial),\n w.token(this.tokens.base),\n w.token(this.tokens.mixin),\n w.name_token(this.tokens.name, { data: this }),\n inheritance(),\n w.token(this.tokens.open),\n w.ts.wrap(this.members.map((m) => m.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { Type } from \"./type.js\";\nimport {\n const_data,\n const_value,\n primitive_type,\n autoParenter,\n unescape,\n} from \"./helpers.js\";\n\nexport class Constant extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n tokens.base = tokeniser.consume(\"const\");\n if (!tokens.base) {\n return;\n }\n let idlType = primitive_type(tokeniser);\n if (!idlType) {\n const base =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Const lacks a type\");\n idlType = new Type({ source: tokeniser.source, tokens: { base } });\n }\n if (tokeniser.probe(\"?\")) {\n tokeniser.error(\"Unexpected nullable constant type\");\n }\n idlType.type = \"const-type\";\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Const lacks a name\");\n tokens.assign =\n tokeniser.consume(\"=\") || tokeniser.error(\"Const lacks value assignment\");\n tokens.value =\n const_value(tokeniser) || tokeniser.error(\"Const lacks a value\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated const, expected `;`\");\n const ret = new Constant({ source: tokeniser.source, tokens });\n autoParenter(ret).idlType = idlType;\n return ret;\n }\n\n get type() {\n return \"const\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get value() {\n return const_data(this.tokens.value);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n w.token(this.tokens.assign),\n w.token(this.tokens.value),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n type_with_extended_attributes,\n autoParenter,\n argument_list,\n} from \"./helpers.js\";\n\nexport class IterableLike extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const start_position = tokeniser.position;\n const ret = autoParenter(\n new IterableLike({ source: tokeniser.source, tokens: {} })\n );\n const { tokens } = ret;\n tokens.readonly = tokeniser.consume(\"readonly\");\n if (!tokens.readonly) {\n tokens.async = tokeniser.consume(\"async\");\n }\n tokens.base = tokens.readonly\n ? tokeniser.consume(\"maplike\", \"setlike\")\n : tokens.async\n ? tokeniser.consume(\"iterable\")\n : tokeniser.consume(\"iterable\", \"maplike\", \"setlike\");\n if (!tokens.base) {\n tokeniser.unconsume(start_position);\n return;\n }\n\n const { type } = ret;\n const secondTypeRequired = type === \"maplike\";\n const secondTypeAllowed = secondTypeRequired || type === \"iterable\";\n const argumentAllowed = ret.async && type === \"iterable\";\n\n tokens.open =\n tokeniser.consume(\"<\") ||\n tokeniser.error(`Missing less-than sign \\`<\\` in ${type} declaration`);\n const first =\n type_with_extended_attributes(tokeniser) ||\n tokeniser.error(`Missing a type argument in ${type} declaration`);\n ret.idlType = [first];\n ret.arguments = [];\n\n if (secondTypeAllowed) {\n first.tokens.separator = tokeniser.consume(\",\");\n if (first.tokens.separator) {\n ret.idlType.push(type_with_extended_attributes(tokeniser));\n } else if (secondTypeRequired) {\n tokeniser.error(`Missing second type argument in ${type} declaration`);\n }\n }\n\n tokens.close =\n tokeniser.consume(\">\") ||\n tokeniser.error(`Missing greater-than sign \\`>\\` in ${type} declaration`);\n\n if (tokeniser.probe(\"(\")) {\n if (argumentAllowed) {\n tokens.argsOpen = tokeniser.consume(\"(\");\n ret.arguments.push(...argument_list(tokeniser));\n tokens.argsClose =\n tokeniser.consume(\")\") ||\n tokeniser.error(\"Unterminated async iterable argument list\");\n } else {\n tokeniser.error(`Arguments are only allowed for \\`async iterable\\``);\n }\n }\n\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(`Missing semicolon after ${type} declaration`);\n\n return ret.this;\n }\n\n get type() {\n return this.tokens.base.value;\n }\n get readonly() {\n return !!this.tokens.readonly;\n }\n get async() {\n return !!this.tokens.async;\n }\n\n *validate(defs) {\n for (const type of this.idlType) {\n yield* type.validate(defs);\n }\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.readonly),\n w.token(this.tokens.async),\n w.token(this.tokens.base, w.ts.generic),\n w.token(this.tokens.open),\n w.ts.wrap(this.idlType.map((t) => t.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.argsOpen),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.argsClose),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent: this.parent }\n );\n }\n}\n","import { Base } from \"./base.js\";\nimport { argument_list, autoParenter } from \"./helpers.js\";\n\nexport class Constructor extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const base = tokeniser.consume(\"constructor\");\n if (!base) {\n return;\n }\n /** @type {Base[\"tokens\"]} */\n const tokens = { base };\n tokens.open =\n tokeniser.consume(\"(\") ||\n tokeniser.error(\"No argument list in constructor\");\n const args = argument_list(tokeniser);\n tokens.close =\n tokeniser.consume(\")\") || tokeniser.error(\"Unterminated constructor\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"No semicolon after constructor\");\n const ret = new Constructor({ source: tokeniser.source, tokens });\n autoParenter(ret).arguments = args;\n return ret;\n }\n\n get type() {\n return \"constructor\";\n }\n\n *validate(defs) {\n for (const argument of this.arguments) {\n yield* argument.validate(defs);\n }\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.base, w.ts.nameless, { data: this, parent }),\n w.token(this.tokens.open),\n w.ts.wrap(this.arguments.map((arg) => arg.write(w))),\n w.token(this.tokens.close),\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Container } from \"./container.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { Constant } from \"./constant.js\";\nimport { IterableLike } from \"./iterable.js\";\nimport {\n stringifier,\n autofixAddExposedWindow,\n getMemberIndentation,\n getLastIndentation,\n getFirstToken,\n findLastIndex,\n autoParenter,\n} from \"./helpers.js\";\nimport { validationError } from \"../error.js\";\nimport { checkInterfaceMemberDuplication } from \"../validators/interface.js\";\nimport { Constructor } from \"./constructor.js\";\nimport { Tokeniser } from \"../tokeniser.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\n\n/**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\nfunction static_member(tokeniser) {\n const special = tokeniser.consume(\"static\");\n if (!special) return;\n const member =\n Attribute.parse(tokeniser, { special }) ||\n Operation.parse(tokeniser, { special }) ||\n tokeniser.error(\"No body in static member\");\n return member;\n}\n\nexport class Interface extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {import(\"../tokeniser.js\").Token} base\n * @param {object} [options]\n * @param {import(\"./container.js\").AllowedMember[]} [options.extMembers]\n * @param {import(\"../tokeniser.js\").Token|null} [options.partial]\n */\n static parse(tokeniser, base, { extMembers = [], partial = null } = {}) {\n const tokens = { partial, base };\n return Container.parse(\n tokeniser,\n new Interface({ source: tokeniser.source, tokens }),\n {\n inheritable: !partial,\n allowedMembers: [\n ...extMembers,\n [Constant.parse],\n [Constructor.parse],\n [static_member],\n [stringifier],\n [IterableLike.parse],\n [Attribute.parse],\n [Operation.parse],\n ],\n }\n );\n }\n\n get type() {\n return \"interface\";\n }\n\n *validate(defs) {\n yield* this.extAttrs.validate(defs);\n if (\n !this.partial &&\n this.extAttrs.every((extAttr) => extAttr.name !== \"Exposed\")\n ) {\n const message = `Interfaces must have \\`[Exposed]\\` extended attribute. \\\nTo fix, add, for example, \\`[Exposed=Window]\\`. Please also consider carefully \\\nif your interface should also be exposed in a Worker scope. Refer to the \\\n[WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) \\\nfor more information.`;\n yield validationError(\n this.tokens.name,\n this,\n \"require-exposed\",\n message,\n {\n autofix: autofixAddExposedWindow(this),\n }\n );\n }\n const oldConstructors = this.extAttrs.filter(\n (extAttr) => extAttr.name === \"Constructor\"\n );\n for (const constructor of oldConstructors) {\n const message = `Constructors should now be represented as a \\`constructor()\\` operation on the interface \\\ninstead of \\`[Constructor]\\` extended attribute. Refer to the \\\n[WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) \\\nfor more information.`;\n yield validationError(\n constructor.tokens.name,\n this,\n \"constructor-member\",\n message,\n {\n autofix: autofixConstructor(this, constructor),\n }\n );\n }\n\n const isGlobal = this.extAttrs.some((extAttr) => extAttr.name === \"Global\");\n if (isGlobal) {\n const factoryFunctions = this.extAttrs.filter(\n (extAttr) => extAttr.name === \"LegacyFactoryFunction\"\n );\n for (const named of factoryFunctions) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have factory functions.`;\n yield validationError(\n named.tokens.name,\n this,\n \"no-constructible-global\",\n message\n );\n }\n\n const constructors = this.members.filter(\n (member) => member.type === \"constructor\"\n );\n for (const named of constructors) {\n const message = `Interfaces marked as \\`[Global]\\` cannot have constructors.`;\n yield validationError(\n named.tokens.base,\n this,\n \"no-constructible-global\",\n message\n );\n }\n }\n\n yield* super.validate(defs);\n if (!this.partial) {\n yield* checkInterfaceMemberDuplication(defs, this);\n }\n }\n}\n\nfunction autofixConstructor(interfaceDef, constructorExtAttr) {\n interfaceDef = autoParenter(interfaceDef);\n return () => {\n const indentation = getLastIndentation(\n interfaceDef.extAttrs.tokens.open.trivia\n );\n const memberIndent = interfaceDef.members.length\n ? getLastIndentation(getFirstToken(interfaceDef.members[0]).trivia)\n : getMemberIndentation(indentation);\n const constructorOp = Constructor.parse(\n new Tokeniser(`\\n${memberIndent}constructor();`)\n );\n constructorOp.extAttrs = new ExtendedAttributes({\n source: interfaceDef.source,\n tokens: {},\n });\n autoParenter(constructorOp).arguments = constructorExtAttr.arguments;\n\n const existingIndex = findLastIndex(\n interfaceDef.members,\n (m) => m.type === \"constructor\"\n );\n interfaceDef.members.splice(existingIndex + 1, 0, constructorOp);\n\n const { close } = interfaceDef.tokens;\n if (!close.trivia.includes(\"\\n\")) {\n close.trivia += `\\n${indentation}`;\n }\n\n const { extAttrs } = interfaceDef;\n const index = extAttrs.indexOf(constructorExtAttr);\n const removed = extAttrs.splice(index, 1);\n if (!extAttrs.length) {\n extAttrs.tokens.open = extAttrs.tokens.close = undefined;\n } else if (extAttrs.length === index) {\n extAttrs[index - 1].tokens.separator = undefined;\n } else if (!extAttrs[index].tokens.name.trivia.trim()) {\n extAttrs[index].tokens.name.trivia = removed[0].tokens.name.trivia;\n }\n };\n}\n","import { validationError } from \"../error.js\";\n\n/**\n * @param {import(\"../validator.js\").Definitions} defs\n * @param {import(\"../productions/container.js\").Container} i\n */\nexport function* checkInterfaceMemberDuplication(defs, i) {\n const opNames = groupOperationNames(i);\n const partials = defs.partials.get(i.name) || [];\n const mixins = defs.mixinMap.get(i.name) || [];\n for (const ext of [...partials, ...mixins]) {\n const additions = getOperations(ext);\n const statics = additions.filter((a) => a.special === \"static\");\n const nonstatics = additions.filter((a) => a.special !== \"static\");\n yield* checkAdditions(statics, opNames.statics, ext, i);\n yield* checkAdditions(nonstatics, opNames.nonstatics, ext, i);\n statics.forEach((op) => opNames.statics.add(op.name));\n nonstatics.forEach((op) => opNames.nonstatics.add(op.name));\n }\n\n /**\n * @param {import(\"../productions/operation.js\").Operation[]} additions\n * @param {Set<string>} existings\n * @param {import(\"../productions/container.js\").Container} ext\n * @param {import(\"../productions/container.js\").Container} base\n */\n function* checkAdditions(additions, existings, ext, base) {\n for (const addition of additions) {\n const { name } = addition;\n if (name && existings.has(name)) {\n const isStatic = addition.special === \"static\" ? \"static \" : \"\";\n const message = `The ${isStatic}operation \"${name}\" has already been defined for the base interface \"${base.name}\" either in itself or in a mixin`;\n yield validationError(\n addition.tokens.name,\n ext,\n \"no-cross-overload\",\n message\n );\n }\n }\n }\n\n /**\n * @param {import(\"../productions/container.js\").Container} i\n * @returns {import(\"../productions/operation.js\").Operation[]}\n */\n function getOperations(i) {\n return i.members.filter(({ type }) => type === \"operation\");\n }\n\n /**\n * @param {import(\"../productions/container.js\").Container} i\n */\n function groupOperationNames(i) {\n const ops = getOperations(i);\n return {\n statics: new Set(\n ops.filter((op) => op.special === \"static\").map((op) => op.name)\n ),\n nonstatics: new Set(\n ops.filter((op) => op.special !== \"static\").map((op) => op.name)\n ),\n };\n }\n}\n","import { Container } from \"./container.js\";\nimport { Constant } from \"./constant.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { stringifier } from \"./helpers.js\";\n\nexport class Mixin extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {import(\"../tokeniser.js\").Token} base\n * @param {object} [options]\n * @param {import(\"./container.js\").AllowedMember[]} [options.extMembers]\n * @param {import(\"../tokeniser.js\").Token} [options.partial]\n */\n static parse(tokeniser, base, { extMembers = [], partial } = {}) {\n const tokens = { partial, base };\n tokens.mixin = tokeniser.consume(\"mixin\");\n if (!tokens.mixin) {\n return;\n }\n return Container.parse(\n tokeniser,\n new Mixin({ source: tokeniser.source, tokens }),\n {\n allowedMembers: [\n ...extMembers,\n [Constant.parse],\n [stringifier],\n [Attribute.parse, { noInherit: true }],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"interface mixin\";\n }\n}\n","import { Base } from \"./base.js\";\nimport {\n unescape,\n type_with_extended_attributes,\n autoParenter,\n} from \"./helpers.js\";\nimport { ExtendedAttributes } from \"./extended-attributes.js\";\nimport { Default } from \"./default.js\";\n\nexport class Field extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n /** @type {Base[\"tokens\"]} */\n const tokens = {};\n const ret = autoParenter(new Field({ source: tokeniser.source, tokens }));\n ret.extAttrs = ExtendedAttributes.parse(tokeniser);\n tokens.required = tokeniser.consume(\"required\");\n ret.idlType =\n type_with_extended_attributes(tokeniser, \"dictionary-type\") ||\n tokeniser.error(\"Dictionary member lacks a type\");\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(\"Dictionary member lacks a name\");\n ret.default = Default.parse(tokeniser);\n if (tokens.required && ret.default)\n tokeniser.error(\"Required member must not have a default\");\n tokens.termination =\n tokeniser.consume(\";\") ||\n tokeniser.error(\"Unterminated dictionary member, expected `;`\");\n return ret.this;\n }\n\n get type() {\n return \"field\";\n }\n get name() {\n return unescape(this.tokens.name.value);\n }\n get required() {\n return !!this.tokens.required;\n }\n\n *validate(defs) {\n yield* this.idlType.validate(defs);\n }\n\n /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n const { parent } = this;\n return w.ts.definition(\n w.ts.wrap([\n this.extAttrs.write(w),\n w.token(this.tokens.required),\n w.ts.type(this.idlType.write(w)),\n w.name_token(this.tokens.name, { data: this, parent }),\n this.default ? this.default.write(w) : \"\",\n w.token(this.tokens.termination),\n ]),\n { data: this, parent }\n );\n }\n}\n","import { Container } from \"./container.js\";\nimport { Field } from \"./field.js\";\n\nexport class Dictionary extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"./container.js\").AllowedMember[]} [options.extMembers]\n * @param {import(\"../tokeniser.js\").Token} [options.partial]\n */\n static parse(tokeniser, { extMembers = [], partial } = {}) {\n const tokens = { partial };\n tokens.base = tokeniser.consume(\"dictionary\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(\n tokeniser,\n new Dictionary({ source: tokeniser.source, tokens }),\n {\n inheritable: !partial,\n allowedMembers: [...extMembers, [Field.parse]],\n }\n );\n }\n\n get type() {\n return \"dictionary\";\n }\n}\n","import { Container } from \"./container.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { validationError } from \"../error.js\";\nimport { autofixAddExposedWindow } from \"./helpers.js\";\nimport { Constant } from \"./constant.js\";\n\nexport class Namespace extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {object} [options]\n * @param {import(\"./container.js\").AllowedMember[]} [options.extMembers]\n * @param {import(\"../tokeniser.js\").Token} [options.partial]\n */\n static parse(tokeniser, { extMembers = [], partial } = {}) {\n const tokens = { partial };\n tokens.base = tokeniser.consume(\"namespace\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(\n tokeniser,\n new Namespace({ source: tokeniser.source, tokens }),\n {\n allowedMembers: [\n ...extMembers,\n [Attribute.parse, { noInherit: true, readonly: true }],\n [Constant.parse],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"namespace\";\n }\n\n *validate(defs) {\n if (\n !this.partial &&\n this.extAttrs.every((extAttr) => extAttr.name !== \"Exposed\")\n ) {\n const message = `Namespaces must have [Exposed] extended attribute. \\\nTo fix, add, for example, [Exposed=Window]. Please also consider carefully \\\nif your namespace should also be exposed in a Worker scope. Refer to the \\\n[WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) \\\nfor more information.`;\n yield validationError(\n this.tokens.name,\n this,\n \"require-exposed\",\n message,\n {\n autofix: autofixAddExposedWindow(this),\n }\n );\n }\n yield* super.validate(defs);\n }\n}\n","import { Container } from \"./container.js\";\nimport { Operation } from \"./operation.js\";\nimport { Constant } from \"./constant.js\";\n\nexport class CallbackInterface extends Container {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {*} callback\n * @param {object} [options]\n * @param {import(\"./container.js\").AllowedMember[]} [options.extMembers]\n */\n static parse(tokeniser, callback, { extMembers = [] } = {}) {\n const tokens = { callback };\n tokens.base = tokeniser.consume(\"interface\");\n if (!tokens.base) {\n return;\n }\n return Container.parse(\n tokeniser,\n new CallbackInterface({ source: tokeniser.source, tokens }),\n {\n allowedMembers: [\n ...extMembers,\n [Constant.parse],\n [Operation.parse, { regular: true }],\n ],\n }\n );\n }\n\n get type() {\n return \"callback interface\";\n }\n}\n","import { Tokeniser } from \"./tokeniser.js\";\nimport { Enum } from \"./productions/enum.js\";\nimport { Includes } from \"./productions/includes.js\";\nimport { ExtendedAttributes } from \"./productions/extended-attributes.js\";\nimport { Typedef } from \"./productions/typedef.js\";\nimport { CallbackFunction } from \"./productions/callback.js\";\nimport { Interface } from \"./productions/interface.js\";\nimport { Mixin } from \"./productions/mixin.js\";\nimport { Dictionary } from \"./productions/dictionary.js\";\nimport { Namespace } from \"./productions/namespace.js\";\nimport { CallbackInterface } from \"./productions/callback-interface.js\";\nimport { autoParenter } from \"./productions/helpers.js\";\nimport { Eof } from \"./productions/token.js\";\n\n/** @typedef {'callbackInterface'|'dictionary'|'interface'|'mixin'|'namespace'} ExtendableInterfaces */\n/** @typedef {{ extMembers?: import(\"./productions/container.js\").AllowedMember[]}} Extension */\n/** @typedef {Partial<Record<ExtendableInterfaces, Extension>>} Extensions */\n\n/**\n * Parser options.\n * @typedef {Object} ParserOptions\n * @property {string} [sourceName]\n * @property {boolean} [concrete]\n * @property {Function[]} [productions]\n * @property {Extensions} [extensions]\n */\n\n/**\n * @param {Tokeniser} tokeniser\n * @param {ParserOptions} options\n */\nfunction parseByTokens(tokeniser, options) {\n const source = tokeniser.source;\n\n function error(str) {\n tokeniser.error(str);\n }\n\n function consume(...candidates) {\n return tokeniser.consume(...candidates);\n }\n\n function callback() {\n const callback = consume(\"callback\");\n if (!callback) return;\n if (tokeniser.probe(\"interface\")) {\n return CallbackInterface.parse(tokeniser, callback, {\n ...options?.extensions?.callbackInterface,\n });\n }\n return CallbackFunction.parse(tokeniser, callback);\n }\n\n function interface_(opts) {\n const base = consume(\"interface\");\n if (!base) return;\n return (\n Mixin.parse(tokeniser, base, {\n ...opts,\n ...options?.extensions?.mixin,\n }) ||\n Interface.parse(tokeniser, base, {\n ...opts,\n ...options?.extensions?.interface,\n }) ||\n error(\"Interface has no proper body\")\n );\n }\n\n function partial() {\n const partial = consume(\"partial\");\n if (!partial) return;\n return (\n Dictionary.parse(tokeniser, {\n partial,\n ...options?.extensions?.dictionary,\n }) ||\n interface_({ partial }) ||\n Namespace.parse(tokeniser, {\n partial,\n ...options?.extensions?.namespace,\n }) ||\n error(\"Partial doesn't apply to anything\")\n );\n }\n\n function definition() {\n if (options.productions) {\n for (const production of options.productions) {\n const result = production(tokeniser);\n if (result) {\n return result;\n }\n }\n }\n\n return (\n callback() ||\n interface_() ||\n partial() ||\n Dictionary.parse(tokeniser, options?.extensions?.dictionary) ||\n Enum.parse(tokeniser) ||\n Typedef.parse(tokeniser) ||\n Includes.parse(tokeniser) ||\n Namespace.parse(tokeniser, options?.extensions?.namespace)\n );\n }\n\n function definitions() {\n if (!source.length) return [];\n const defs = [];\n while (true) {\n const ea = ExtendedAttributes.parse(tokeniser);\n const def = definition();\n if (!def) {\n if (ea.length) error(\"Stray extended attributes\");\n break;\n }\n autoParenter(def).extAttrs = ea;\n defs.push(def);\n }\n const eof = Eof.parse(tokeniser);\n if (options.concrete) {\n defs.push(eof);\n }\n return defs;\n }\n\n const res = definitions();\n if (tokeniser.position < source.length) error(\"Unrecognised tokens\");\n return res;\n}\n\n/**\n * @param {string} str\n * @param {ParserOptions} [options]\n */\nexport function parse(str, options = {}) {\n const tokeniser = new Tokeniser(str);\n if (typeof options.sourceName !== \"undefined\") {\n // @ts-ignore (See Tokeniser.source in supplement.d.ts)\n tokeniser.source.name = options.sourceName;\n }\n return parseByTokens(tokeniser, options);\n}\n","function noop(arg) {\n return arg;\n}\n\nconst templates = {\n wrap: (items) => items.join(\"\"),\n trivia: noop,\n name: noop,\n reference: noop,\n type: noop,\n generic: noop,\n nameless: noop,\n inheritance: noop,\n definition: noop,\n extendedAttribute: noop,\n extendedAttributeReference: noop,\n};\n\nexport class Writer {\n constructor(ts) {\n this.ts = Object.assign({}, templates, ts);\n }\n\n /**\n * @param {string} raw\n * @param {object} options\n * @param {string} [options.unescaped]\n * @param {import(\"./productions/base.js\").Base} [options.context]\n * @returns\n */\n reference(raw, { unescaped, context }) {\n if (!unescaped) {\n unescaped = raw.startsWith(\"_\") ? raw.slice(1) : raw;\n }\n return this.ts.reference(raw, unescaped, context);\n }\n\n /**\n * @param {import(\"./tokeniser.js\").Token} t\n * @param {Function} wrapper\n * @param {...any} args\n * @returns\n */\n token(t, wrapper = noop, ...args) {\n if (!t) {\n return \"\";\n }\n const value = wrapper(t.value, ...args);\n return this.ts.wrap([this.ts.trivia(t.trivia), value]);\n }\n\n reference_token(t, context) {\n return this.token(t, this.reference.bind(this), { context });\n }\n\n name_token(t, arg) {\n return this.token(t, this.ts.name, arg);\n }\n\n identifier(id, context) {\n return this.ts.wrap([\n this.reference_token(id.tokens.value, context),\n this.token(id.tokens.separator),\n ]);\n }\n}\n\nexport function write(ast, { templates: ts = templates } = {}) {\n ts = Object.assign({}, templates, ts);\n\n const w = new Writer(ts);\n\n return ts.wrap(ast.map((it) => it.write(w)));\n}\n","import { validationError as error } from \"./error.js\";\n\nfunction getMixinMap(all, unique) {\n const map = new Map();\n const includes = all.filter((def) => def.type === \"includes\");\n for (const include of includes) {\n const mixin = unique.get(include.includes);\n if (!mixin) {\n continue;\n }\n const array = map.get(include.target);\n if (array) {\n array.push(mixin);\n } else {\n map.set(include.target, [mixin]);\n }\n }\n return map;\n}\n\n/**\n * @typedef {ReturnType<typeof groupDefinitions>} Definitions\n */\nfunction groupDefinitions(all) {\n const unique = new Map();\n const duplicates = new Set();\n const partials = new Map();\n for (const def of all) {\n if (def.partial) {\n const array = partials.get(def.name);\n if (array) {\n array.push(def);\n } else {\n partials.set(def.name, [def]);\n }\n continue;\n }\n if (!def.name) {\n continue;\n }\n if (!unique.has(def.name)) {\n unique.set(def.name, def);\n } else {\n duplicates.add(def);\n }\n }\n return {\n all,\n unique,\n partials,\n duplicates,\n mixinMap: getMixinMap(all, unique),\n cache: {\n typedefIncludesDictionary: new WeakMap(),\n dictionaryIncludesRequiredField: new WeakMap(),\n },\n };\n}\n\nfunction* checkDuplicatedNames({ unique, duplicates }) {\n for (const dup of duplicates) {\n const { name } = dup;\n const message = `The name \"${name}\" of type \"${\n unique.get(name).type\n }\" was already seen`;\n yield error(dup.tokens.name, dup, \"no-duplicate\", message);\n }\n}\n\nfunction* validateIterable(ast) {\n const defs = groupDefinitions(ast);\n for (const def of defs.all) {\n if (def.validate) {\n yield* def.validate(defs);\n }\n }\n yield* checkDuplicatedNames(defs);\n}\n\n// Remove this once all of our support targets expose `.flat()` by default\nfunction flatten(array) {\n if (array.flat) {\n return array.flat();\n }\n return [].concat(...array);\n}\n\n/**\n * @param {import(\"./productions/base.js\").Base[]} ast\n * @return {import(\"./error.js\").WebIDLErrorData[]} validation errors\n */\nexport function validate(ast) {\n return [...validateIterable(flatten(ast))];\n}\n","/**\n * Implementation of MIMEType and MIME Type parser from\n * https://mimesniff.spec.whatwg.org/\n */\n\nconst HTTPTokenCodePoints = /^[!#$%&'*+-.^`|~\\w]+$/;\n\n// \"HTTP whitespace is U+000A LF, U+000D CR, U+0009 TAB or U+0020 SPACE.\"\n// eslint-disable-next-line no-control-regex\nconst HTTPWhiteSpace = /[\\u000A\\u000D\\u0009\\u0020]/u;\n\n// An HTTP quoted-string token code point is\n// U+0009 TAB,\n// a code point in the range U+0020 SPACE to U+007E (~), inclusive,\n// or a code point in the range U+0080 through U+00FF (Ćæ), inclusive.\n// eslint-disable-next-line no-control-regex\nconst HTTPQuotedString = /^[\\u0009\\u{0020}-\\{u0073}\\u{0080}-\\u{00FF}]+$/u;\n\nexport class MIMEType {\n constructor(input) {\n const { type, subtype, params } = parseMimeType(input);\n this.type = type.trim().toLowerCase();\n this.subtype = subtype.trimEnd().toLowerCase();\n this.parameters = new Map(Object.entries(params));\n }\n\n /**\n * @see https://mimesniff.spec.whatwg.org/#mime-type-essence\n */\n get essence() {\n return `${this.type}/${this.subtype}`;\n }\n\n toString() {\n return serialize(this);\n }\n};\n\nexport function isValidMimeType(text){\n try {\n parse(text);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serialize(mimeType) {\n const { parameters, essence } = mimeType;\n if (!parameters.size) {\n return essence;\n }\n let paramStr = \";\";\n for (const [key, value] of parameters.entries()) {\n paramStr += key;\n if (value !== null) {\n if (HTTPTokenCodePoints.test(value)) {\n paramStr += `=${value}`;\n } else {\n paramStr += `=\"${value}\"`;\n }\n } else {\n // null or empty string\n paramStr += '=\"\"';\n }\n paramStr += \";\";\n }\n // remove final \";\"\n return mimeType.essence + paramStr.slice(0, -1);\n}\n\n/**\n * Implementation of https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n * parser state machines if as follows, params and param values are optional and can be null:\n *\n * \"type\"\n * -> \"subtype\"\n * -> \"param-start\" (ignores white space)\n * -> \"param-name\"\n * -> \"param-value\"\n * -> \"collect-quoted-string\"\n * -> \"ignore-input-until-next-param\"\n *\n *\n *\n * @param {String} input\n */\nexport function parseMimeType(input) {\n input = input.trim();\n if (!input) {\n throw new TypeError(\"Invalid input.\");\n }\n\n let type = \"\";\n let subtype = \"\";\n let paramName = \"\";\n let paramValue = null;\n let params = new Map();\n let parserMode = \"type\";\n let inputArray = Array.from(input); // retain unicode chars\n for (let position = 0; position < inputArray.length; position++) {\n const char = inputArray[position];\n switch (parserMode) {\n case \"type\":\n if (char === \"/\") {\n parserMode = \"subtype\";\n continue;\n }\n type += char;\n break;\n case \"subtype\":\n if (char === \";\") {\n parserMode = \"param-start\";\n continue;\n }\n subtype += char;\n break;\n case \"param-start\":\n // Skip HTTP white space\n if (HTTPWhiteSpace.test(char) || char === \";\") {\n continue;\n }\n paramName += char;\n parserMode = \"param-name\";\n break;\n case \"param-name\":\n if (char === \"=\" || char === \";\") {\n if (char === \"=\") {\n parserMode = \"param-value\";\n paramValue = null;\n continue;\n }\n params.set(paramName.toLowerCase(), null);\n paramName = \"\";\n continue;\n }\n paramName += char;\n break;\n case \"param-value\":\n if (char == '\"') {\n parserMode = \"collect-quoted-string\";\n continue;\n }\n if (char === \";\") {\n paramValue = paramValue.trimEnd();\n parserMode = \"param-start\";\n storeParam(params, paramName, paramValue);\n paramName = \"\";\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"collect-quoted-string\":\n if (char === '\"') {\n storeParam(params, paramName, paramValue);\n parserMode = \"ignore-input-until-next-param\";\n paramName = \"\";\n paramValue = null;\n continue;\n }\n if (char === \"\\\\\") {\n continue;\n }\n paramValue = typeof paramValue === \"string\" ? paramValue + char : char;\n break;\n case \"ignore-input-until-next-param\":\n if (char !== \";\") {\n continue;\n }\n parserMode = \"param-start\";\n break;\n default:\n throw new Error(\n `State machine error - unknown parser mode: ${parserMode} `\n );\n }\n }\n if (paramName) {\n storeParam(params, paramName, paramValue);\n }\n if (type.trim() === \"\" || !HTTPTokenCodePoints.test(type)) {\n throw new TypeError(\"Invalid type\");\n }\n if (subtype.trim() === \"\" || !HTTPTokenCodePoints.test(subtype)) {\n throw new TypeError(\"Invalid subtype\");\n }\n return {\n type,\n subtype,\n params: Object.fromEntries(params.entries()),\n };\n}\n\nfunction storeParam(params, paramName, paramValue) {\n if (\n (paramName &&\n paramName !== \"\" &&\n !params.has(paramName) &&\n HTTPQuotedString.test(paramValue)) ||\n paramValue === null\n ) {\n params.set(paramName.toLowerCase(), paramValue);\n }\n}\n","/**\n * marked v12.0.2 - a markdown parser\n * Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\n/**\n * Gets the original marked default options.\n */\nfunction _getDefaults() {\n return {\n async: false,\n breaks: false,\n extensions: null,\n gfm: true,\n hooks: null,\n pedantic: false,\n renderer: null,\n silent: false,\n tokenizer: null,\n walkTokens: null\n };\n}\nlet _defaults = _getDefaults();\nfunction changeDefaults(newDefaults) {\n _defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape$1(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n }\n else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n return html;\n}\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon')\n return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\nconst caret = /(^|[^\\[])\\^/g;\nfunction edit(regex, opt) {\n let source = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n let valSource = typeof val === 'string' ? val : val.source;\n valSource = valSource.replace(caret, '$1');\n source = source.replace(name, valSource);\n return obj;\n },\n getRegex: () => {\n return new RegExp(source, opt);\n }\n };\n return obj;\n}\nfunction cleanUrl(href) {\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n }\n catch (e) {\n return null;\n }\n return href;\n}\nconst noopTest = { exec: () => null };\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false;\n let curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\')\n escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n }\n else {\n // add space before unescaped |\n return ' |';\n }\n }), cells = row.split(/ \\|/);\n let i = 0;\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) {\n cells.shift();\n }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) {\n cells.pop();\n }\n if (count) {\n if (cells.length > count) {\n cells.splice(count);\n }\n else {\n while (cells.length < count)\n cells.push('');\n }\n }\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param str\n * @param c\n * @param invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n }\n else if (currChar !== c && invert) {\n suffLen++;\n }\n else {\n break;\n }\n }\n return str.slice(0, l - suffLen);\n}\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n let level = 0;\n for (let i = 0; i < str.length; i++) {\n if (str[i] === '\\\\') {\n i++;\n }\n else if (str[i] === b[0]) {\n level++;\n }\n else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape$1(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape$1(text)\n };\n}\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n if (matchIndentToCode === null) {\n return text;\n }\n const indentToCode = matchIndentToCode[1];\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n const [indentInNode] = matchIndentInNode;\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n return node;\n })\n .join('\\n');\n}\n/**\n * Tokenizer\n */\nclass _Tokenizer {\n options;\n rules; // set by the lexer\n lexer; // set by the lexer\n constructor(options) {\n this.options = options || _defaults;\n }\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, '$1') : cap[2],\n text\n };\n }\n }\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n }\n else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n // precede setext continuation with 4 spaces so it isn't a setext\n let text = cap[0].replace(/\\n {0,3}((?:=+|-+) *)(?=\\n|$)/g, '\\n $1');\n text = rtrim(text.replace(/^ *>[ \\t]?/gm, ''), '\\n');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n let raw = '';\n let itemContents = '';\n let endsWithBlankLine = false;\n // Check if current bullet point can start a new List Item\n while (src) {\n let endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n raw = cap[0];\n src = src.substring(raw.length);\n let line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n let nextLine = src.split('\\n', 1)[0];\n let indent = 0;\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimStart();\n }\n else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n let blankLine = false;\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n // Check if following lines should be included in List Item\n while (src) {\n const rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n }\n else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n itemContents += '\\n' + nextLine;\n }\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n }\n else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n let istask = null;\n let ischecked;\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents,\n tokens: []\n });\n list.raw += raw;\n }\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimEnd();\n (list.items[list.items.length - 1]).text = itemContents.trimEnd();\n list.raw = list.raw.trimEnd();\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (let i = 0; i < list.items.length; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n list.loose = hasMultipleLineBreaks;\n }\n }\n // Set all items to loose if list is loose\n if (list.loose) {\n for (let i = 0; i < list.items.length; i++) {\n list.items[i].loose = true;\n }\n }\n return list;\n }\n }\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n block: true,\n raw: cap[0],\n pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',\n text: cap[0]\n };\n return token;\n }\n }\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline.anyPunctuation, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (!cap) {\n return;\n }\n if (!/[:|]/.test(cap[2])) {\n // delimiter row must have a pipe (|) or colon (:) otherwise it is a setext heading\n return;\n }\n const headers = splitCells(cap[1]);\n const aligns = cap[2].replace(/^\\||\\| *$/g, '').split('|');\n const rows = cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : [];\n const item = {\n type: 'table',\n raw: cap[0],\n header: [],\n align: [],\n rows: []\n };\n if (headers.length !== aligns.length) {\n // header and align columns must be equal, rows can be different.\n return;\n }\n for (const align of aligns) {\n if (/^ *-+: *$/.test(align)) {\n item.align.push('right');\n }\n else if (/^ *:-+: *$/.test(align)) {\n item.align.push('center');\n }\n else if (/^ *:-+ *$/.test(align)) {\n item.align.push('left');\n }\n else {\n item.align.push(null);\n }\n }\n for (const header of headers) {\n item.header.push({\n text: header,\n tokens: this.lexer.inline(header)\n });\n }\n for (const row of rows) {\n item.rows.push(splitCells(row, item.header.length).map(cell => {\n return {\n text: cell,\n tokens: this.lexer.inline(cell)\n };\n }));\n }\n return item;\n }\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape$1(cap[1])\n };\n }\n }\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n }\n else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n }\n else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n return {\n type: 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n block: false,\n text: cap[0]\n };\n }\n }\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^</.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(/>$/.test(trimmedUrl))) {\n return;\n }\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n }\n else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n if (link) {\n href = link[1];\n title = link[3];\n }\n }\n else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n href = href.trim();\n if (/^</.test(href)) {\n if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n }\n else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline.anyPunctuation, '$1') : href,\n title: title ? title.replace(this.rules.inline.anyPunctuation, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n const linkString = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n const link = links[linkString.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrongLDelim.exec(src);\n if (!match)\n return;\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u))\n return;\n const nextChar = match[1] || match[2] || '';\n if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {\n // unicode Regex counts emoji as 1 char; spread into array for proper count (used multiple times below)\n const lLength = [...match[0]].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;\n endReg.lastIndex = 0;\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n if (!rDelim)\n continue; // skip single * in __abc*abc__\n rLength = [...rDelim].length;\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n }\n else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n delimTotal -= rLength;\n if (delimTotal > 0)\n continue; // Haven't found enough closing delimiters\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n // char length can be >1 for unicode characters;\n const lastCharLength = [...match[0]][0].length;\n const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape$1(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n autolink(src) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[1]);\n href = 'mailto:' + text;\n }\n else {\n text = escape$1(cap[1]);\n href = text;\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n url(src) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$1(cap[0]);\n href = 'mailto:' + text;\n }\n else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? '';\n } while (prevCapZero !== cap[0]);\n text = escape$1(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n }\n else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n inlineText(src) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = cap[0];\n }\n else {\n text = escape$1(cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst newline = /^(?: *(?:\\n|$))+/;\nconst blockCode = /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/;\nconst fences = /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/;\nconst hr = /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/;\nconst heading = /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/;\nconst bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nconst lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\\n(?!\\s*?\\n|bull |blockCode|fences|blockquote|heading|html))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/)\n .replace(/bull/g, bullet) // lists can interrupt\n .replace(/blockCode/g, / {4}/) // indented code blocks can interrupt\n .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt\n .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n .getRegex();\nconst _paragraph = /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/;\nconst blockText = /^[^\\n]+/;\nconst _blockLabel = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nconst def = edit(/^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/)\n .replace('label', _blockLabel)\n .replace('title', /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/)\n .getRegex();\nconst list = edit(/^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/)\n .replace(/bull/g, bullet)\n .getRegex();\nconst _tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title'\n + '|tr|track|ul';\nconst _comment = /<!--(?:-?>|[\\s\\S]*?(?:-->|$))/;\nconst html = edit('^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n + '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n + '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')', 'i')\n .replace('comment', _comment)\n .replace('tag', _tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst paragraph = edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\nconst blockquote = edit(/^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/)\n .replace('paragraph', paragraph)\n .getRegex();\n/**\n * Normal Block Grammar\n */\nconst blockNormal = {\n blockquote,\n code: blockCode,\n def,\n fences,\n heading,\n hr,\n html,\n lheading,\n list,\n newline,\n paragraph,\n table: noopTest,\n text: blockText\n};\n/**\n * GFM Block Grammar\n */\nconst gfmTable = edit('^ *([^\\\\n ].*)\\\\n' // Header\n + ' {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)') // Cells\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\nconst blockGfm = {\n ...blockNormal,\n table: gfmTable,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('table', gfmTable) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex()\n};\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\nconst blockPedantic = {\n ...blockNormal,\n html: edit('^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', _comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', lheading)\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .replace('|tag', '')\n .getRegex()\n};\n/**\n * Inline-Level Grammar\n */\nconst escape = /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/;\nconst inlineCode = /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/;\nconst br = /^( {2,}|\\\\)\\n(?!\\s*$)/;\nconst inlineText = /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/;\n// list of unicode punctuation marks, plus any missing characters from CommonMark spec\nconst _punctuation = '\\\\p{P}\\\\p{S}';\nconst punctuation = edit(/^((?![*_])[\\spunctuation])/, 'u')\n .replace(/punctuation/g, _punctuation).getRegex();\n// sequences em should skip over [title](link), `code`, <html>\nconst blockSkip = /\\[[^[\\]]*?\\]\\([^\\(\\)]*?\\)|`[^`]*?`|<[^<>]*?>/g;\nconst emStrongLDelim = edit(/^(?:\\*+(?:((?!\\*)[punct])|[^\\s*]))|^_+(?:((?!_)[punct])|([^\\s_]))/, 'u')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst emStrongRDelimAst = edit('^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)' // Skip orphan inside strong\n + '|[^*]+(?=[^*])' // Consume to delim\n + '|(?!\\\\*)[punct](\\\\*+)(?=[\\\\s]|$)' // (1) #*** can only be a Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?!\\\\*)(?=[punct\\\\s]|$)' // (2) a***#, a*** can only be a Right Delimiter\n + '|(?!\\\\*)[punct\\\\s](\\\\*+)(?=[^punct\\\\s])' // (3) #***a, ***a can only be Left Delimiter\n + '|[\\\\s](\\\\*+)(?!\\\\*)(?=[punct])' // (4) ***# can only be Left Delimiter\n + '|(?!\\\\*)[punct](\\\\*+)(?!\\\\*)(?=[punct])' // (5) #***# can be either Left or Right Delimiter\n + '|[^punct\\\\s](\\\\*+)(?=[^punct\\\\s])', 'gu') // (6) a***a can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\n// (6) Not allowed for _\nconst emStrongRDelimUnd = edit('^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)' // Skip orphan inside strong\n + '|[^_]+(?=[^_])' // Consume to delim\n + '|(?!_)[punct](_+)(?=[\\\\s]|$)' // (1) #___ can only be a Right Delimiter\n + '|[^punct\\\\s](_+)(?!_)(?=[punct\\\\s]|$)' // (2) a___#, a___ can only be a Right Delimiter\n + '|(?!_)[punct\\\\s](_+)(?=[^punct\\\\s])' // (3) #___a, ___a can only be Left Delimiter\n + '|[\\\\s](_+)(?!_)(?=[punct])' // (4) ___# can only be Left Delimiter\n + '|(?!_)[punct](_+)(?!_)(?=[punct])', 'gu') // (5) #___# can be either Left or Right Delimiter\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst anyPunctuation = edit(/\\\\([punct])/, 'gu')\n .replace(/punct/g, _punctuation)\n .getRegex();\nconst autolink = edit(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/)\n .replace('scheme', /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/)\n .replace('email', /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/)\n .getRegex();\nconst _inlineComment = edit(_comment).replace('(?:-->|$)', '-->').getRegex();\nconst tag = edit('^comment'\n + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>') // CDATA section\n .replace('comment', _inlineComment)\n .replace('attribute', /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/)\n .getRegex();\nconst _inlineLabel = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\nconst link = edit(/^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/)\n .replace('label', _inlineLabel)\n .replace('href', /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/)\n .replace('title', /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/)\n .getRegex();\nconst reflink = edit(/^!?\\[(label)\\]\\[(ref)\\]/)\n .replace('label', _inlineLabel)\n .replace('ref', _blockLabel)\n .getRegex();\nconst nolink = edit(/^!?\\[(ref)\\](?:\\[\\])?/)\n .replace('ref', _blockLabel)\n .getRegex();\nconst reflinkSearch = edit('reflink|nolink(?!\\\\()', 'g')\n .replace('reflink', reflink)\n .replace('nolink', nolink)\n .getRegex();\n/**\n * Normal Inline Grammar\n */\nconst inlineNormal = {\n _backpedal: noopTest, // only used for GFM url\n anyPunctuation,\n autolink,\n blockSkip,\n br,\n code: inlineCode,\n del: noopTest,\n emStrongLDelim,\n emStrongRDelimAst,\n emStrongRDelimUnd,\n escape,\n link,\n nolink,\n punctuation,\n reflink,\n reflinkSearch,\n tag,\n text: inlineText,\n url: noopTest\n};\n/**\n * Pedantic Inline Grammar\n */\nconst inlinePedantic = {\n ...inlineNormal,\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', _inlineLabel)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', _inlineLabel)\n .getRegex()\n};\n/**\n * GFM Inline Grammar\n */\nconst inlineGfm = {\n ...inlineNormal,\n escape: edit(escape).replace('])', '~|])').getRegex(),\n url: edit(/^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/, 'i')\n .replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/)\n .getRegex(),\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/\n};\n/**\n * GFM + Line Breaks Inline Grammar\n */\nconst inlineBreaks = {\n ...inlineGfm,\n br: edit(br).replace('{2,}', '*').getRegex(),\n text: edit(inlineGfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n/**\n * exports\n */\nconst block = {\n normal: blockNormal,\n gfm: blockGfm,\n pedantic: blockPedantic\n};\nconst inline = {\n normal: inlineNormal,\n gfm: inlineGfm,\n breaks: inlineBreaks,\n pedantic: inlinePedantic\n};\n\n/**\n * Block Lexer\n */\nclass _Lexer {\n tokens;\n options;\n state;\n tokenizer;\n inlineQueue;\n constructor(options) {\n // TokenList cannot be created in one go\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || _defaults;\n this.options.tokenizer = this.options.tokenizer || new _Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n }\n else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n }\n else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new _Lexer(options);\n return lexer.lex(src);\n }\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new _Lexer(options);\n return lexer.inlineTokens(src);\n }\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n this.blockTokens(src, this.tokens);\n for (let i = 0; i < this.inlineQueue.length; i++) {\n const next = this.inlineQueue[i];\n this.inlineTokens(next.src, next.tokens);\n }\n this.inlineQueue = [];\n return this.tokens;\n }\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n }\n else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n let token;\n let lastToken;\n let cutSrc;\n let lastParagraphClipped;\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unnecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n this.state.top = true;\n return tokens;\n }\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n // Mask out escaped characters\n while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);\n }\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // autolink\n if (token = this.tokenizer.autolink(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n }\n else {\n tokens.push(token);\n }\n continue;\n }\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass _Renderer {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/^\\S*/)?.[0];\n code = code.replace(/\\n$/, '') + '\\n';\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n return '<pre><code class=\"language-'\n + escape$1(lang)\n + '\">'\n + (escaped ? code : escape$1(code, true))\n + '</code></pre>\\n';\n }\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n html(html, block) {\n return html;\n }\n heading(text, level, raw) {\n // ignore IDs\n return `<h${level}>${text}</h${level}>\\n`;\n }\n hr() {\n return '<hr>\\n';\n }\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul';\n const startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '</' + type + '>\\n';\n }\n listitem(text, task, checked) {\n return `<li>${text}</li>\\n`;\n }\n checkbox(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\">';\n }\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n table(header, body) {\n if (body)\n body = `<tbody>${body}</tbody>`;\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n }\n tablerow(content) {\n return `<tr>\\n${content}</tr>\\n`;\n }\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `</${type}>\\n`;\n }\n /**\n * span level renderer\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n em(text) {\n return `<em>${text}</em>`;\n }\n codespan(text) {\n return `<code>${text}</code>`;\n }\n br() {\n return '<br>';\n }\n del(text) {\n return `<del>${text}</del>`;\n }\n link(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = '<a href=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n image(href, title, text) {\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text;\n }\n href = cleanHref;\n let out = `<img src=\"${href}\" alt=\"${text}\"`;\n if (title) {\n out += ` title=\"${title}\"`;\n }\n out += '>';\n return out;\n }\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass _TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n em(text) {\n return text;\n }\n codespan(text) {\n return text;\n }\n del(text) {\n return text;\n }\n html(text) {\n return text;\n }\n text(text) {\n return text;\n }\n link(href, title, text) {\n return '' + text;\n }\n image(href, title, text) {\n return '' + text;\n }\n br() {\n return '';\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass _Parser {\n options;\n renderer;\n textRenderer;\n constructor(options) {\n this.options = options || _defaults;\n this.options.renderer = this.options.renderer || new _Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new _TextRenderer();\n }\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new _Parser(options);\n return parser.parse(tokens);\n }\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new _Parser(options);\n return parser.parseInline(tokens);\n }\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const genericToken = token;\n const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(genericToken.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n const headingToken = token;\n out += this.renderer.heading(this.parseInline(headingToken.tokens), headingToken.depth, unescape(this.parseInline(headingToken.tokens, this.textRenderer)));\n continue;\n }\n case 'code': {\n const codeToken = token;\n out += this.renderer.code(codeToken.text, codeToken.lang, !!codeToken.escaped);\n continue;\n }\n case 'table': {\n const tableToken = token;\n let header = '';\n // header\n let cell = '';\n for (let j = 0; j < tableToken.header.length; j++) {\n cell += this.renderer.tablecell(this.parseInline(tableToken.header[j].tokens), { header: true, align: tableToken.align[j] });\n }\n header += this.renderer.tablerow(cell);\n let body = '';\n for (let j = 0; j < tableToken.rows.length; j++) {\n const row = tableToken.rows[j];\n cell = '';\n for (let k = 0; k < row.length; k++) {\n cell += this.renderer.tablecell(this.parseInline(row[k].tokens), { header: false, align: tableToken.align[k] });\n }\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n const blockquoteToken = token;\n const body = this.parse(blockquoteToken.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n const listToken = token;\n const ordered = listToken.ordered;\n const start = listToken.start;\n const loose = listToken.loose;\n let body = '';\n for (let j = 0; j < listToken.items.length; j++) {\n const item = listToken.items[j];\n const checked = item.checked;\n const task = item.task;\n let itemBody = '';\n if (item.task) {\n const checkbox = this.renderer.checkbox(!!checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n }\n else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox + ' '\n });\n }\n }\n else {\n itemBody += checkbox + ' ';\n }\n }\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, !!checked);\n }\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n const htmlToken = token;\n out += this.renderer.html(htmlToken.text, htmlToken.block);\n continue;\n }\n case 'paragraph': {\n const paragraphToken = token;\n out += this.renderer.paragraph(this.parseInline(paragraphToken.tokens));\n continue;\n }\n case 'text': {\n let textToken = token;\n let body = textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text;\n while (i + 1 < tokens.length && tokens[i + 1].type === 'text') {\n textToken = tokens[++i];\n body += '\\n' + (textToken.tokens ? this.parseInline(textToken.tokens) : textToken.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n const ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n switch (token.type) {\n case 'escape': {\n const escapeToken = token;\n out += renderer.text(escapeToken.text);\n break;\n }\n case 'html': {\n const tagToken = token;\n out += renderer.html(tagToken.text);\n break;\n }\n case 'link': {\n const linkToken = token;\n out += renderer.link(linkToken.href, linkToken.title, this.parseInline(linkToken.tokens, renderer));\n break;\n }\n case 'image': {\n const imageToken = token;\n out += renderer.image(imageToken.href, imageToken.title, imageToken.text);\n break;\n }\n case 'strong': {\n const strongToken = token;\n out += renderer.strong(this.parseInline(strongToken.tokens, renderer));\n break;\n }\n case 'em': {\n const emToken = token;\n out += renderer.em(this.parseInline(emToken.tokens, renderer));\n break;\n }\n case 'codespan': {\n const codespanToken = token;\n out += renderer.codespan(codespanToken.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n const delToken = token;\n out += renderer.del(this.parseInline(delToken.tokens, renderer));\n break;\n }\n case 'text': {\n const textToken = token;\n out += renderer.text(textToken.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '';\n }\n else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\nclass _Hooks {\n options;\n constructor(options) {\n this.options = options || _defaults;\n }\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess',\n 'processAllTokens'\n ]);\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n /**\n * Process all tokens before walk tokens\n */\n processAllTokens(tokens) {\n return tokens;\n }\n}\n\nclass Marked {\n defaults = _getDefaults();\n options = this.setOptions;\n parse = this.#parseMarkdown(_Lexer.lex, _Parser.parse);\n parseInline = this.#parseMarkdown(_Lexer.lexInline, _Parser.parseInline);\n Parser = _Parser;\n Renderer = _Renderer;\n TextRenderer = _TextRenderer;\n Lexer = _Lexer;\n Tokenizer = _Tokenizer;\n Hooks = _Hooks;\n constructor(...args) {\n this.use(...args);\n }\n /**\n * Run callback for every token\n */\n walkTokens(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(this, token));\n switch (token.type) {\n case 'table': {\n const tableToken = token;\n for (const cell of tableToken.header) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n for (const row of tableToken.rows) {\n for (const cell of row) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n const listToken = token;\n values = values.concat(this.walkTokens(listToken.items, callback));\n break;\n }\n default: {\n const genericToken = token;\n if (this.defaults.extensions?.childTokens?.[genericToken.type]) {\n this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {\n const tokens = genericToken[childTokens].flat(Infinity);\n values = values.concat(this.walkTokens(tokens, callback));\n });\n }\n else if (genericToken.tokens) {\n values = values.concat(this.walkTokens(genericToken.tokens, callback));\n }\n }\n }\n }\n return values;\n }\n use(...args) {\n const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n // set async to true if it was set to true before\n opts.async = this.defaults.async || opts.async || false;\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if ('renderer' in ext) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function (...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n }\n else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if ('tokenizer' in ext) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n const extLevel = extensions[ext.level];\n if (extLevel) {\n extLevel.unshift(ext.tokenizer);\n }\n else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n }\n else {\n extensions.startBlock = [ext.start];\n }\n }\n else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n }\n else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if ('childTokens' in ext && ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = this.defaults.renderer || new _Renderer(this.defaults);\n for (const prop in pack.renderer) {\n if (!(prop in renderer)) {\n throw new Error(`renderer '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const rendererProp = prop;\n const rendererFunc = pack.renderer[rendererProp];\n const prevRenderer = renderer[rendererProp];\n // Replace renderer with func to run extension, but fall back if false\n renderer[rendererProp] = (...args) => {\n let ret = rendererFunc.apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret || '';\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);\n for (const prop in pack.tokenizer) {\n if (!(prop in tokenizer)) {\n throw new Error(`tokenizer '${prop}' does not exist`);\n }\n if (['options', 'rules', 'lexer'].includes(prop)) {\n // ignore options, rules, and lexer properties\n continue;\n }\n const tokenizerProp = prop;\n const tokenizerFunc = pack.tokenizer[tokenizerProp];\n const prevTokenizer = tokenizer[tokenizerProp];\n // Replace tokenizer with func to run extension, but fall back if false\n // @ts-expect-error cannot type tokenizer function dynamically\n tokenizer[tokenizerProp] = (...args) => {\n let ret = tokenizerFunc.apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = this.defaults.hooks || new _Hooks();\n for (const prop in pack.hooks) {\n if (!(prop in hooks)) {\n throw new Error(`hook '${prop}' does not exist`);\n }\n if (prop === 'options') {\n // ignore options property\n continue;\n }\n const hooksProp = prop;\n const hooksFunc = pack.hooks[hooksProp];\n const prevHook = hooks[hooksProp];\n if (_Hooks.passThroughHooks.has(prop)) {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (arg) => {\n if (this.defaults.async) {\n return Promise.resolve(hooksFunc.call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n const ret = hooksFunc.call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n }\n else {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (...args) => {\n let ret = hooksFunc.apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = this.defaults.walkTokens;\n const packWalktokens = pack.walkTokens;\n opts.walkTokens = function (token) {\n let values = [];\n values.push(packWalktokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n this.defaults = { ...this.defaults, ...opts };\n });\n return this;\n }\n setOptions(opt) {\n this.defaults = { ...this.defaults, ...opt };\n return this;\n }\n lexer(src, options) {\n return _Lexer.lex(src, options ?? this.defaults);\n }\n parser(tokens, options) {\n return _Parser.parse(tokens, options ?? this.defaults);\n }\n #parseMarkdown(lexer, parser) {\n return (src, options) => {\n const origOpt = { ...options };\n const opt = { ...this.defaults, ...origOpt };\n // Show warning if an extension set async to true but the parse was called with async: false\n if (this.defaults.async === true && origOpt.async === false) {\n if (!opt.silent) {\n console.warn('marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.');\n }\n opt.async = true;\n }\n const throwError = this.#onError(!!opt.silent, !!opt.async);\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens)\n .then(tokens => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n let tokens = lexer(src, opt);\n if (opt.hooks) {\n tokens = opt.hooks.processAllTokens(tokens);\n }\n if (opt.walkTokens) {\n this.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n }\n catch (e) {\n return throwError(e);\n }\n };\n }\n #onError(silent, async) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape$1(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n return msg;\n }\n if (async) {\n return Promise.reject(e);\n }\n throw e;\n };\n }\n}\n\nconst markedInstance = new Marked();\nfunction marked(src, opt) {\n return markedInstance.parse(src, opt);\n}\n/**\n * Sets the default options.\n *\n * @param options Hash of options\n */\nmarked.options =\n marked.setOptions = function (options) {\n markedInstance.setOptions(options);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n };\n/**\n * Gets the original marked default options.\n */\nmarked.getDefaults = _getDefaults;\nmarked.defaults = _defaults;\n/**\n * Use Extension\n */\nmarked.use = function (...args) {\n markedInstance.use(...args);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n};\n/**\n * Run callback for every token\n */\nmarked.walkTokens = function (tokens, callback) {\n return markedInstance.walkTokens(tokens, callback);\n};\n/**\n * Compiles markdown to HTML without enclosing `p` tag.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options\n * @return String of compiled HTML\n */\nmarked.parseInline = markedInstance.parseInline;\n/**\n * Expose\n */\nmarked.Parser = _Parser;\nmarked.parser = _Parser.parse;\nmarked.Renderer = _Renderer;\nmarked.TextRenderer = _TextRenderer;\nmarked.Lexer = _Lexer;\nmarked.lexer = _Lexer.lex;\nmarked.Tokenizer = _Tokenizer;\nmarked.Hooks = _Hooks;\nmarked.parse = marked;\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = _Parser.parse;\nconst lexer = _Lexer.lex;\n\nexport { _Hooks as Hooks, _Lexer as Lexer, Marked, _Parser as Parser, _Renderer as Renderer, _TextRenderer as TextRenderer, _Tokenizer as Tokenizer, _defaults as defaults, _getDefaults as getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n//# sourceMappingURL=marked.esm.js.map\n","function getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nfunction commonjsRequire(path) {\n\tthrow new Error('Could not dynamically require \"' + path + '\". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');\n}\n\nvar pluralize$2 = {exports: {}};\n\n/* global define */\nvar pluralize$1 = pluralize$2.exports;\n\nvar hasRequiredPluralize;\n\nfunction requirePluralize () {\n\tif (hasRequiredPluralize) return pluralize$2.exports;\n\thasRequiredPluralize = 1;\n\t(function (module, exports) {\n\t\t(function (root, pluralize) {\n\t\t /* istanbul ignore else */\n\t\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t\t // Node.\n\t\t module.exports = pluralize();\n\t\t } else {\n\t\t // Browser global.\n\t\t root.pluralize = pluralize();\n\t\t }\n\t\t})(pluralize$1, function () {\n\t\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t\t // while other rules can be optimized using an object for instant lookups.\n\t\t var pluralRules = [];\n\t\t var singularRules = [];\n\t\t var uncountables = {};\n\t\t var irregularPlurals = {};\n\t\t var irregularSingles = {};\n\n\t\t /**\n\t\t * Sanitize a pluralization rule to a usable regular expression.\n\t\t *\n\t\t * @param {(RegExp|string)} rule\n\t\t * @return {RegExp}\n\t\t */\n\t\t function sanitizeRule (rule) {\n\t\t if (typeof rule === 'string') {\n\t\t return new RegExp('^' + rule + '$', 'i');\n\t\t }\n\n\t\t return rule;\n\t\t }\n\n\t\t /**\n\t\t * Pass in a word token to produce a function that can replicate the case on\n\t\t * another word.\n\t\t *\n\t\t * @param {string} word\n\t\t * @param {string} token\n\t\t * @return {Function}\n\t\t */\n\t\t function restoreCase (word, token) {\n\t\t // Tokens are an exact match.\n\t\t if (word === token) return token;\n\n\t\t // Lower cased words. E.g. \"hello\".\n\t\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t\t // Upper cased words. E.g. \"WHISKY\".\n\t\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t\t // Title cased words. E.g. \"Title\".\n\t\t if (word[0] === word[0].toUpperCase()) {\n\t\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t\t }\n\n\t\t // Lower cased words. E.g. \"test\".\n\t\t return token.toLowerCase();\n\t\t }\n\n\t\t /**\n\t\t * Interpolate a regexp string.\n\t\t *\n\t\t * @param {string} str\n\t\t * @param {Array} args\n\t\t * @return {string}\n\t\t */\n\t\t function interpolate (str, args) {\n\t\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t\t return args[index] || '';\n\t\t });\n\t\t }\n\n\t\t /**\n\t\t * Replace a word using a rule.\n\t\t *\n\t\t * @param {string} word\n\t\t * @param {Array} rule\n\t\t * @return {string}\n\t\t */\n\t\t function replace (word, rule) {\n\t\t return word.replace(rule[0], function (match, index) {\n\t\t var result = interpolate(rule[1], arguments);\n\n\t\t if (match === '') {\n\t\t return restoreCase(word[index - 1], result);\n\t\t }\n\n\t\t return restoreCase(match, result);\n\t\t });\n\t\t }\n\n\t\t /**\n\t\t * Sanitize a word by passing in the word and sanitization rules.\n\t\t *\n\t\t * @param {string} token\n\t\t * @param {string} word\n\t\t * @param {Array} rules\n\t\t * @return {string}\n\t\t */\n\t\t function sanitizeWord (token, word, rules) {\n\t\t // Empty string or doesn't need fixing.\n\t\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t\t return word;\n\t\t }\n\n\t\t var len = rules.length;\n\n\t\t // Iterate over the sanitization rules and use the first one to match.\n\t\t while (len--) {\n\t\t var rule = rules[len];\n\n\t\t if (rule[0].test(word)) return replace(word, rule);\n\t\t }\n\n\t\t return word;\n\t\t }\n\n\t\t /**\n\t\t * Replace a word with the updated word.\n\t\t *\n\t\t * @param {Object} replaceMap\n\t\t * @param {Object} keepMap\n\t\t * @param {Array} rules\n\t\t * @return {Function}\n\t\t */\n\t\t function replaceWord (replaceMap, keepMap, rules) {\n\t\t return function (word) {\n\t\t // Get the correct token and case restoration functions.\n\t\t var token = word.toLowerCase();\n\n\t\t // Check against the keep object map.\n\t\t if (keepMap.hasOwnProperty(token)) {\n\t\t return restoreCase(word, token);\n\t\t }\n\n\t\t // Check against the replacement map for a direct word replacement.\n\t\t if (replaceMap.hasOwnProperty(token)) {\n\t\t return restoreCase(word, replaceMap[token]);\n\t\t }\n\n\t\t // Run all the rules against the word.\n\t\t return sanitizeWord(token, word, rules);\n\t\t };\n\t\t }\n\n\t\t /**\n\t\t * Check if a word is part of the map.\n\t\t */\n\t\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t\t return function (word) {\n\t\t var token = word.toLowerCase();\n\n\t\t if (keepMap.hasOwnProperty(token)) return true;\n\t\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t\t return sanitizeWord(token, token, rules) === token;\n\t\t };\n\t\t }\n\n\t\t /**\n\t\t * Pluralize or singularize a word based on the passed in count.\n\t\t *\n\t\t * @param {string} word The word to pluralize\n\t\t * @param {number} count How many of the word exist\n\t\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t\t * @return {string}\n\t\t */\n\t\t function pluralize (word, count, inclusive) {\n\t\t var pluralized = count === 1\n\t\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t\t return (inclusive ? count + ' ' : '') + pluralized;\n\t\t }\n\n\t\t /**\n\t\t * Pluralize a word.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.plural = replaceWord(\n\t\t irregularSingles, irregularPlurals, pluralRules\n\t\t );\n\n\t\t /**\n\t\t * Check if a word is plural.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.isPlural = checkWord(\n\t\t irregularSingles, irregularPlurals, pluralRules\n\t\t );\n\n\t\t /**\n\t\t * Singularize a word.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.singular = replaceWord(\n\t\t irregularPlurals, irregularSingles, singularRules\n\t\t );\n\n\t\t /**\n\t\t * Check if a word is singular.\n\t\t *\n\t\t * @type {Function}\n\t\t */\n\t\t pluralize.isSingular = checkWord(\n\t\t irregularPlurals, irregularSingles, singularRules\n\t\t );\n\n\t\t /**\n\t\t * Add a pluralization rule to the collection.\n\t\t *\n\t\t * @param {(string|RegExp)} rule\n\t\t * @param {string} replacement\n\t\t */\n\t\t pluralize.addPluralRule = function (rule, replacement) {\n\t\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t\t };\n\n\t\t /**\n\t\t * Add a singularization rule to the collection.\n\t\t *\n\t\t * @param {(string|RegExp)} rule\n\t\t * @param {string} replacement\n\t\t */\n\t\t pluralize.addSingularRule = function (rule, replacement) {\n\t\t singularRules.push([sanitizeRule(rule), replacement]);\n\t\t };\n\n\t\t /**\n\t\t * Add an uncountable word rule.\n\t\t *\n\t\t * @param {(string|RegExp)} word\n\t\t */\n\t\t pluralize.addUncountableRule = function (word) {\n\t\t if (typeof word === 'string') {\n\t\t uncountables[word.toLowerCase()] = true;\n\t\t return;\n\t\t }\n\n\t\t // Set singular and plural references for the word.\n\t\t pluralize.addPluralRule(word, '$0');\n\t\t pluralize.addSingularRule(word, '$0');\n\t\t };\n\n\t\t /**\n\t\t * Add an irregular word definition.\n\t\t *\n\t\t * @param {string} single\n\t\t * @param {string} plural\n\t\t */\n\t\t pluralize.addIrregularRule = function (single, plural) {\n\t\t plural = plural.toLowerCase();\n\t\t single = single.toLowerCase();\n\n\t\t irregularSingles[single] = plural;\n\t\t irregularPlurals[plural] = single;\n\t\t };\n\n\t\t /**\n\t\t * Irregular rules.\n\t\t */\n\t\t [\n\t\t // Pronouns.\n\t\t ['I', 'we'],\n\t\t ['me', 'us'],\n\t\t ['he', 'they'],\n\t\t ['she', 'they'],\n\t\t ['them', 'them'],\n\t\t ['myself', 'ourselves'],\n\t\t ['yourself', 'yourselves'],\n\t\t ['itself', 'themselves'],\n\t\t ['herself', 'themselves'],\n\t\t ['himself', 'themselves'],\n\t\t ['themself', 'themselves'],\n\t\t ['is', 'are'],\n\t\t ['was', 'were'],\n\t\t ['has', 'have'],\n\t\t ['this', 'these'],\n\t\t ['that', 'those'],\n\t\t // Words ending in with a consonant and `o`.\n\t\t ['echo', 'echoes'],\n\t\t ['dingo', 'dingoes'],\n\t\t ['volcano', 'volcanoes'],\n\t\t ['tornado', 'tornadoes'],\n\t\t ['torpedo', 'torpedoes'],\n\t\t // Ends with `us`.\n\t\t ['genus', 'genera'],\n\t\t ['viscus', 'viscera'],\n\t\t // Ends with `ma`.\n\t\t ['stigma', 'stigmata'],\n\t\t ['stoma', 'stomata'],\n\t\t ['dogma', 'dogmata'],\n\t\t ['lemma', 'lemmata'],\n\t\t ['schema', 'schemata'],\n\t\t ['anathema', 'anathemata'],\n\t\t // Other irregular rules.\n\t\t ['ox', 'oxen'],\n\t\t ['axe', 'axes'],\n\t\t ['die', 'dice'],\n\t\t ['yes', 'yeses'],\n\t\t ['foot', 'feet'],\n\t\t ['eave', 'eaves'],\n\t\t ['goose', 'geese'],\n\t\t ['tooth', 'teeth'],\n\t\t ['quiz', 'quizzes'],\n\t\t ['human', 'humans'],\n\t\t ['proof', 'proofs'],\n\t\t ['carve', 'carves'],\n\t\t ['valve', 'valves'],\n\t\t ['looey', 'looies'],\n\t\t ['thief', 'thieves'],\n\t\t ['groove', 'grooves'],\n\t\t ['pickaxe', 'pickaxes'],\n\t\t ['passerby', 'passersby']\n\t\t ].forEach(function (rule) {\n\t\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t\t });\n\n\t\t /**\n\t\t * Pluralization rules.\n\t\t */\n\t\t [\n\t\t [/s?$/i, 's'],\n\t\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t\t [/([^aeiou]ese)$/i, '$1'],\n\t\t [/(ax|test)is$/i, '$1es'],\n\t\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t\t [/(e[mn]u)s?$/i, '$1s'],\n\t\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t\t [/(her|at|gr)o$/i, '$1oes'],\n\t\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t\t [/sis$/i, 'ses'],\n\t\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t\t [/(child)(?:ren)?$/i, '$1ren'],\n\t\t [/eaux$/i, '$0'],\n\t\t [/m[ae]n$/i, 'men'],\n\t\t ['thou', 'you']\n\t\t ].forEach(function (rule) {\n\t\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t\t });\n\n\t\t /**\n\t\t * Singularization rules.\n\t\t */\n\t\t [\n\t\t [/s$/i, ''],\n\t\t [/(ss)$/i, '$1'],\n\t\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t\t [/ies$/i, 'y'],\n\t\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t\t [/(seraph|cherub)im$/i, '$1'],\n\t\t [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n\t\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t\t [/(test)(?:is|es)$/i, '$1is'],\n\t\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t\t [/(matr|append)ices$/i, '$1ix'],\n\t\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t\t [/(child)ren$/i, '$1'],\n\t\t [/(eau)x?$/i, '$1'],\n\t\t [/men$/i, 'man']\n\t\t ].forEach(function (rule) {\n\t\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t\t });\n\n\t\t /**\n\t\t * Uncountable rules.\n\t\t */\n\t\t [\n\t\t // Singular words with no plurals.\n\t\t 'adulthood',\n\t\t 'advice',\n\t\t 'agenda',\n\t\t 'aid',\n\t\t 'aircraft',\n\t\t 'alcohol',\n\t\t 'ammo',\n\t\t 'analytics',\n\t\t 'anime',\n\t\t 'athletics',\n\t\t 'audio',\n\t\t 'bison',\n\t\t 'blood',\n\t\t 'bream',\n\t\t 'buffalo',\n\t\t 'butter',\n\t\t 'carp',\n\t\t 'cash',\n\t\t 'chassis',\n\t\t 'chess',\n\t\t 'clothing',\n\t\t 'cod',\n\t\t 'commerce',\n\t\t 'cooperation',\n\t\t 'corps',\n\t\t 'debris',\n\t\t 'diabetes',\n\t\t 'digestion',\n\t\t 'elk',\n\t\t 'energy',\n\t\t 'equipment',\n\t\t 'excretion',\n\t\t 'expertise',\n\t\t 'firmware',\n\t\t 'flounder',\n\t\t 'fun',\n\t\t 'gallows',\n\t\t 'garbage',\n\t\t 'graffiti',\n\t\t 'hardware',\n\t\t 'headquarters',\n\t\t 'health',\n\t\t 'herpes',\n\t\t 'highjinks',\n\t\t 'homework',\n\t\t 'housework',\n\t\t 'information',\n\t\t 'jeans',\n\t\t 'justice',\n\t\t 'kudos',\n\t\t 'labour',\n\t\t 'literature',\n\t\t 'machinery',\n\t\t 'mackerel',\n\t\t 'mail',\n\t\t 'media',\n\t\t 'mews',\n\t\t 'moose',\n\t\t 'music',\n\t\t 'mud',\n\t\t 'manga',\n\t\t 'news',\n\t\t 'only',\n\t\t 'personnel',\n\t\t 'pike',\n\t\t 'plankton',\n\t\t 'pliers',\n\t\t 'police',\n\t\t 'pollution',\n\t\t 'premises',\n\t\t 'rain',\n\t\t 'research',\n\t\t 'rice',\n\t\t 'salmon',\n\t\t 'scissors',\n\t\t 'series',\n\t\t 'sewage',\n\t\t 'shambles',\n\t\t 'shrimp',\n\t\t 'software',\n\t\t 'species',\n\t\t 'staff',\n\t\t 'swine',\n\t\t 'tennis',\n\t\t 'traffic',\n\t\t 'transportation',\n\t\t 'trout',\n\t\t 'tuna',\n\t\t 'wealth',\n\t\t 'welfare',\n\t\t 'whiting',\n\t\t 'wildebeest',\n\t\t 'wildlife',\n\t\t 'you',\n\t\t /pok[eĆ©]mon$/i,\n\t\t // Regexes.\n\t\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t\t /deer$/i, // \"deer\", \"reindeer\"\n\t\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t\t /measles$/i,\n\t\t /o[iu]s$/i, // \"carnivorous\"\n\t\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t\t /sheep$/i\n\t\t ].forEach(pluralize.addUncountableRule);\n\n\t\t return pluralize;\n\t\t}); \n\t} (pluralize$2));\n\treturn pluralize$2.exports;\n}\n\nvar pluralizeExports = requirePluralize();\nvar pluralize = /*@__PURE__*/getDefaultExportFromCjs(pluralizeExports);\n\nexport { pluralize as default };\n","/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(N){\"use strict\";var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,\"_\",{value:\"_@ungap/weakmap\"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var s=t.WeakMap,i={};try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,\"_\",{value:\"_@ungap/weakmap\"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}function m(e,t,n,r,i,a){for(var o=(\"selectedIndex\"in t),u=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,a),o&&u&&l.selected&&(u=!u,c=t.selectedIndex,t.selectedIndex=c<0?r:f.call(t.querySelectorAll(\"option\"),l)),r++}}function y(e,t){return e==t}function b(e){return e}function w(e,t,n,r,i,a,o){var u=a-i;if(u<1)return-1;for(;u<=n-t;){for(var c=t,l=i;c<n&&l<a&&o(e[c],r[l]);)c++,l++;if(l===a)return t;t=c+1}return-1}function x(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function E(e,t,n,r){for(;n<r;)a(e(t[n++],-1))}function C(e,t,n,r,i,a,o,u,c,l,s,f,h){!function(e,t,n,r,i,a,o,u,c){for(var l=[],s=e.length,f=o,h=0;h<s;)switch(e[h++]){case 0:i++,f++;break;case 1:l.push(r[i]),m(t,n,r,i++,i,f<u?t(a[f],0):c);break;case-1:f++}for(h=0;h<s;)switch(e[h++]){case 0:o++;break;case-1:-1<l.indexOf(a[o])?o++:E(t,a,o++,o)}}(function(e,t,n,r,i,a,o){var u,c,l,s,f,h,d=n+a,v=[];e:for(m=0;m<=d;m++){if(50<m)return null;for(h=m-1,s=m?v[m-1]:[0,0],f=v[m]=[],u=-m;u<=m;u+=2){for(c=(l=u===-m||u!==m&&s[h+u-1]<s[h+u+1]?s[h+u+1]:s[h+u-1]+1)-u;l<a&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===a&&c===n)break e;f[m+u]=l}}for(var p=Array(m/2+d/2),g=p.length-1,m=v.length-1;0<=m;m--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)p[g--]=0,l--,c--;if(!m)break;h=m-1,s=m?v[m-1]:[0,0],(u=l-c)===-m||u!==m&&s[h+u-1]<s[h+u+1]?(c--,p[g--]=1):(l--,p[g--]=-1)}return p}(n,r,a,o,u,l,f)||function(e,t,n,r,i,a,o,u){var c=0,l=r<u?r:u,s=Array(l++),f=Array(l);f[0]=-1;for(var h=1;h<l;h++)f[h]=o;for(var d=i.slice(a,o),v=t;v<n;v++){var p,g=d.indexOf(e[v]);-1<g&&(-1<(c=k(f,l,p=g+a))&&(f[c]=p,s[c]={newi:v,oldi:p,prev:s[c-1]}))}for(c=--l,--o;f[c]>o;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b<n;)m[--l]=1,--n;for(;w<o;)m[--l]=-1,--o;m[--l]=0,--n,--o,y=y.prev}for(;t<=n;)m[--l]=1,--n;for(;a<=o;)m[--l]=-1,--o;return m}(n,r,i,a,o,u,c,l),e,t,n,r,o,u,s,h)}var e=i.WeakSet,f=[].indexOf,k=function(e,t,n){for(var r=1,i=t;r<i;){var a=(r+i)/2>>>0;n<e[a]?i=a:r=1+a}return r},a=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function l(e,t,n,r){for(var i=(r=r||{}).compare||y,a=r.node||b,o=null==r.before?null:a(r.before,0),u=t.length,c=u,l=0,s=n.length,f=0;l<c&&f<s&&i(t[l],n[f]);)l++,f++;for(;l<c&&f<s&&i(t[c-1],n[s-1]);)c--,s--;var h=l===c,d=f===s;if(h&&d)return n;if(h&&f<s)return m(a,e,n,f,s,x(a,t,l,u,o)),n;if(d&&l<c)return E(a,t,l,c),n;var v=c-l,p=s-f,g=-1;if(v<p){if(-1<(g=w(n,f,s,t,l,c,i)))return m(a,e,n,f,g,a(t[l],0)),m(a,e,n,g+v,s,x(a,t,c,u,o)),n}else if(p<v&&-1<(g=w(t,l,c,n,f,s,i)))return E(a,t,l,g),E(a,t,g+p,c),n;return v<2||p<2?(m(a,e,n,f,s,a(t[l],0)),E(a,t,l,c)):v==p&&function(e,t,n,r,i,a){for(;r<i&&a(n[r],e[t-1]);)r++,t--;return 0===t}(n,s,t,l,c,i)?m(a,e,n,f,s,x(a,t,c,u,o)):C(a,e,n,f,s,p,t,l,c,v,u,i,o),n}var n,r={};function o(e,t){t=t||{};var n=N.createEvent(\"CustomEvent\");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}r.CustomEvent=\"function\"==typeof CustomEvent?CustomEvent:(o[n=\"prototype\"]=new o(\"\").constructor[n],o);var u=r.CustomEvent,c={};try{c.Map=Map}catch(e){c.Map=function(){var n=0,i=[],a=[];return{delete:function(e){var t=r(e);return t&&(i.splice(n,1),a.splice(n,1)),t},forEach:function(n,r){i.forEach(function(e,t){n.call(r,a[t],e,this)},this)},get:function(e){return r(e)?a[n]:void 0},has:r,set:function(e,t){return a[r(e)?n:i.push(e)-1]=t,this}};function r(e){return-1<(n=i.indexOf(e))}}}var h=c.Map;function d(){return this}function v(e,t){var n=\"_\"+e+\"$\";return{get:function(){return this[n]||p(this,n,t.call(this,e))},set:function(e){p(this,n,e)}}}var p=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:\"function\"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(d.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var g,A,S,O,T,M,_={},j={},L=[],P=j.hasOwnProperty,D=0,W={attributes:_,define:function(e,t){e.indexOf(\"-\")<0?(e in j||(D=L.push(e)),j[e]=t):_[e]=t},invoke:function(e,t){for(var n=0;n<D;n++){var r=L[n];if(P.call(e,r))return j[r](e[r],t)}}},$=Array.isArray||(A=(g={}.toString).call([]),function(e){return g.call(e)===A}),R=(S=N,O=\"fragment\",M=\"content\"in H(T=\"template\")?function(e){var t=H(T);return t.innerHTML=e,t.content}:function(e){var t,n=H(O),r=H(T);return F(n,/^[^\\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML=\"<table>\"+e+\"</table>\",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return(\"svg\"===t?function(e){var t=H(O),n=H(\"div\");return n.innerHTML='<svg xmlns=\"http://www.w3.org/2000/svg\">'+e+\"</svg>\",F(t,n.firstChild.childNodes),t}:M)(e)});function F(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function H(e){return e===O?S.createDocumentFragment():S.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}var I,z,V,Z,G,q,B,J,K,Q,U=(z=\"appendChild\",V=\"cloneNode\",Z=\"createTextNode\",q=(G=\"importNode\")in(I=N),(B=I.createDocumentFragment())[z](I[Z](\"g\")),B[z](I[Z](\"\")),(q?I[G](B,!0):B[V](!0)).childNodes.length<2?function e(t,n){for(var r=t[V](),i=t.childNodes||[],a=i.length,o=0;n&&o<a;o++)r[z](e(i[o],n));return r}:q?I[G]:function(e,t){return e[V](!!t)}),X=\"\".trim||function(){return String(this).replace(/^\\s+|\\s+/g,\"\")},Y=\"-\"+Math.random().toFixed(6)+\"%\",ee=!1;try{J=N.createElement(\"template\"),Q=\"tabindex\",(K=\"content\")in J&&(J.innerHTML=\"<p \"+Q+'=\"'+Y+'\"></p>',J[K].childNodes[0].getAttribute(Q)==Y)||(Y=\"_dt: \"+Y.slice(1,-1)+\";\",ee=!0)}catch(e){}var te=\"\\x3c!--\"+Y+\"--\\x3e\",ne=8,re=1,ie=3,ae=/^(?:style|textarea)$/i,oe=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ue=\" \\\\f\\\\n\\\\r\\\\t\",ce=\"[^\"+ue+\"\\\\/>\\\"'=]+\",le=\"[\"+ue+\"]+\"+ce,se=\"<([A-Za-z]+[A-Za-z0-9:._-]*)((?:\",fe=\"(?:\\\\s*=\\\\s*(?:'[^']*?'|\\\"[^\\\"]*?\\\"|<[^>]*?>|\"+ce.replace(\"\\\\/\",\"\")+\"))?)\",he=new RegExp(se+le+fe+\"+)([\"+ue+\"]*/?>)\",\"g\"),de=new RegExp(se+le+fe+\"*)([\"+ue+\"]*/>)\",\"g\"),ve=new RegExp(\"(\"+le+\"\\\\s*=\\\\s*)(['\\\"]?)\"+te+\"\\\\2\",\"gi\");function pe(e,t,n,r){return\"<\"+t+n.replace(ve,ge)+r}function ge(e,t,n){return t+(n||'\"')+Y+(n||'\"')}function me(e,t,n){return oe.test(t)?e:\"<\"+t+n+\"></\"+t+\">\"}var ye=ee?function(e,t){var n=t.join(\" \");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function be(e,t,n,r){for(var i=e.childNodes,a=i.length,o=0;o<a;){var u=i[o];switch(u.nodeType){case re:var c=r.concat(o);!function(e,t,n,r){var i,a=e.attributes,o=[],u=[],c=ye(a,n),l=c.length,s=0;for(;s<l;){var f=c[s++],h=f.value===Y;if(h||1<(i=f.value.split(te)).length){var d=f.name;if(o.indexOf(d)<0){o.push(d);var v=n.shift().replace(h?/^(?:|[\\S\\s]*?\\s)(\\S+?)\\s*=\\s*('|\")?$/:new RegExp(\"^(?:|[\\\\S\\\\s]*?\\\\s)(\"+d+\")\\\\s*=\\\\s*('|\\\")[\\\\S\\\\s]*\",\"i\"),\"$1\"),p=a[v]||a[v.toLowerCase()];if(h)t.push(we(p,r,v,null));else{for(var g=i.length-2;g--;)n.shift();t.push(we(p,r,v,i))}}u.push(f)}}l=u.length;var m=(s=0)<l&&ee&&!(\"ownerSVGElement\"in e);for(;s<l;){var y=u[s++];m&&(y.value=\"\"),e.removeAttribute(y.name)}var b=e.nodeName;if(/^script$/i.test(b)){var w=N.createElement(b);for(l=a.length,s=0;s<l;)w.setAttributeNode(a[s++].cloneNode(!0));w.textContent=e.textContent,e.parentNode.replaceChild(w,e)}}(u,t,n,c),be(u,t,n,c);break;case ne:var l=u.textContent;if(l===Y)n.shift(),t.push(ae.test(e.nodeName)?Ne(e,r):{type:\"any\",node:u,path:r.concat(o)});else switch(l.slice(0,2)){case\"/*\":if(\"*/\"!==l.slice(-2))break;case\"šŸ‘»\":e.removeChild(u),o--,a--}break;case ie:ae.test(e.nodeName)&&X.call(u.textContent)===te&&(n.shift(),t.push(Ne(e,r)))}o++}}function we(e,t,n,r){return{type:\"attr\",node:e,path:t,name:n,sparse:r}}function Ne(e,t){return{type:\"text\",node:e,path:t}}var xe,Ee=(xe=new s,{get:function(e){return xe.get(e)},set:function(e,t){return xe.set(e,t),t}});function Ce(o,f){var e=(o.convert||function(e){return e.join(te).replace(de,me).replace(he,pe)})(f),t=o.transform;t&&(e=t(e));var n=R(e,o.type);Se(n);var u=[];return be(n,u,f.slice(0),[]),{content:n,updates:function(c){for(var l=[],s=u.length,e=0,t=0;e<s;){var n=u[e++],r=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(c,n.path);switch(n.type){case\"any\":l.push({fn:o.any(r,[]),sparse:!1});break;case\"attr\":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case\"text\":l.push({fn:o.text(r),sparse:!1}),r.textContent=\"\"}}return s+=t,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+\" values instead of \"+s+\"\\n\"+f.join(\"${value}\"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return c}}}}var ke=[];function Ae(i){var a=ke,o=Se;return function(e){var t,n,r;return a!==e&&(t=i,n=a=e,r=Ee.get(n)||Ee.set(n,Ce(t,n)),o=r.updates(U.call(N,r.content,!0))),o.apply(null,arguments)}}function Se(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===X.call(r.textContent).length&&e.removeChild(r)}}var Oe,Te,Me=(Oe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Te=/([^A-Z])([A-Z]+)/g,function(e,t){return\"ownerSVGElement\"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute(\"style\",\"--hyper:style;\"),e.getAttributeNode(\"style\"))).value=\"\",e.setAttributeNode(n),je(n,!0)}(e,t):je(e.style,!1)});function _e(e,t,n){return t+\"-\"+n.toLowerCase()}function je(a,o){var u,c;return function(e){var t,n,r,i;switch(typeof e){case\"object\":if(e){if(\"object\"===u){if(!o&&c!==e)for(n in c)n in e||(a[n]=\"\")}else o?a.value=\"\":a.cssText=\"\";for(n in t=o?{}:a,e)r=\"number\"!=typeof(i=e[n])||Oe.test(n)?i:i+\"px\",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u=\"object\",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Te,_e),\":\",e[t],\";\");return n.join(\"\")}(c=t):c=e;break}default:c!=e&&(u=\"string\",c=e,o?a.value=e||\"\":a.cssText=e||\"\")}}}var Le,Pe,De=(Le=[].slice,(Pe=We.prototype).ELEMENT_NODE=1,Pe.nodeType=111,Pe.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Pe.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},We);function We(e){var t=this.childNodes=Le.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function $e(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Ke:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Je:return Re(e.render(),t);default:return e}}function Fe(e,t){t(e.placeholder),\"text\"in e?Promise.resolve(e.text).then(String).then(t):\"any\"in e?Promise.resolve(e.any).then(t):\"html\"in e?Promise.resolve(e.html).then($e).then(t):Promise.resolve(W.invoke(e,t)).then(t)}function He(e){return null!=e&&\"then\"in e}var Ie,ze,Ve,Ze,Ge,qe=\"ownerSVGElement\",Be=\"connected\",Je=d.prototype.nodeType,Ke=De.prototype.nodeType,Qe=(ze=(Ie={Event:u,WeakSet:e}).Event,Ve=Ie.WeakSet,Ze=!0,Ge=null,function(e){return Ze&&(Ze=!Ze,Ge=new Ve,function(t){var i=new Ve,a=new Ve;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener(\"DOMNodeRemoved\",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener(\"DOMNodeInserted\",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)c((t=e[r]).removedNodes,\"disconnected\",a,i),c(t.addedNodes,\"connected\",i,a)}function c(e,t,n,r){for(var i,a=new ze(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&function e(t,n,r,i,a){Ge.has(t)&&!i.has(t)&&(a.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],u=o.length,c=0;c<u;e(o[c++],n,r,i,a));}(i,a,t,n,r));}}(e.ownerDocument)),Ge.add(e),e}),Ue=/^(?:form|list)$/i,Xe=[].slice;function Ye(e){return this.type=e,Ae(this)}var et=!(Ye.prototype={attribute:function(n,r,e){var i,t=qe in n;if(\"style\"===r)return Me(n,e,t);if(\".\"===r.slice(0,1))return l=n,s=r.slice(1),t?function(t){try{l[s]=t}catch(e){l.setAttribute(s,t)}}:function(e){l[s]=e};if(\"?\"===r.slice(0,1))return o=n,u=r.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(u,\"\"):o.removeAttribute(u))};if(/^on/.test(r)){var a=r.slice(2);return a===Be||\"disconnected\"===a?Qe(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if(\"data\"===r||!t&&r in n&&!Ue.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]=\"\",n.removeAttribute(r)):n[r]=e)};if(r in W.attributes)return function(e){var t=W.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o,u,c,l,s,f=!1,h=e.cloneNode(!0);return function(e){i!==e&&(i=e,h.value!==e&&(null==e?(f&&(f=!1,n.removeAttributeNode(h)),h.value=e):(h.value=e,f||(f=!0,n.setAttributeNode(h)))))}},any:function(r,i){var a,o={node:Re,before:r},u=qe in r?\"svg\":\"html\",c=!1;return function e(t){switch(typeof t){case\"string\":case\"number\":case\"boolean\":c?a!==t&&(a=t,i[0].textContent=t):(c=!0,a=t,i=l(r.parentNode,i,[(n=t,r.ownerDocument.createTextNode(n))],o));break;case\"function\":e(t(r));break;case\"object\":case\"undefined\":if(null==t){c=!1,i=l(r.parentNode,i,[],o);break}default:if(c=!1,$(a=t))if(0===t.length)i.length&&(i=l(r.parentNode,i,[],o));else switch(typeof t[0]){case\"string\":case\"number\":case\"boolean\":e({html:t});break;case\"object\":if($(t[0])&&(t=t.concat.apply([],t)),He(t[0])){Promise.all(t).then(e);break}default:i=l(r.parentNode,i,t,o)}else\"ELEMENT_NODE\"in t?i=l(r.parentNode,i,11===t.nodeType?Xe.call(t.childNodes):[t],o):He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?i=l(r.parentNode,i,Xe.call(R([].concat(t.html).join(\"\"),u).childNodes),o):\"length\"in t?e(Xe.call(t)):e(W.invoke(t,e))}var n}},text:function(r){var i;return function e(t){var n;i!==t&&(\"object\"==(n=typeof(i=t))&&t?He(t)?t.then(e):\"placeholder\"in t?Fe(t,e):\"text\"in t?e(String(t.text)):\"any\"in t?e(t.any):\"html\"in t?e([].concat(t.html).join(\"\")):\"length\"in t?e(Xe.call(t).join(\"\")):e(W.invoke(t,e)):\"function\"==n?e(t(r)):r.textContent=null==t?\"\":t)}}}),tt=function(e){var t,r,i,a,n=(t=(N.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\\/(\\d+)/.test(t)&&!/(Chrom[eium]+|Android)\\/(\\d+)/.test(t)),o=!(\"raw\"in e)||e.propertyIsEnumerable(\"raw\")||!Object.isFrozen(e.raw);return n||o?(r={},i=function(e){for(var t=\".\",n=0;n<e.length;n++)t+=e[n].length+\".\"+e[n];return r[t]||(r[t]=e)},tt=o?i:(a=new s,function(e){return a.get(e)||(n=i(t=e),a.set(t,n),n);var t,n})):et=!0,nt(e)};function nt(e){return et?e:tt(e)}function rt(e){for(var t=arguments.length,n=[nt(e)],r=1;r<t;)n.push(arguments[r++]);return n}var it=new s,at=function(t){var n,r,i;return function(){var e=rt.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Ye(t),n=ut(r.apply(r,e))):r.apply(r,e),n}},ot=function(e,t){var n=t.indexOf(\":\"),r=it.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||\"html\"),r||it.set(e,r={}),r[i]||(r[i]=at(t))},ut=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new De(t):e},ct=new s;function lt(){var e=ct.get(this),t=rt.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ye(qe in this?\"svg\":\"html\");ct.set(this,{tagger:t,template:e}),this.textContent=\"\",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var st,ft,ht,dt,vt=W.define,pt=Ye.prototype;function gt(e){return arguments.length<2?null==e?at(\"html\"):\"string\"==typeof e?gt.wire(null,e):\"raw\"in e?at(\"html\")(e):\"nodeType\"in e?gt.bind(e):ot(e,\"html\"):(\"raw\"in e?at(\"html\"):gt.wire).apply(null,arguments)}return gt.Component=d,gt.bind=function(e){return lt.bind(e)},gt.define=vt,gt.diff=l,(gt.hyper=gt).observe=Qe,gt.tagger=pt,gt.wire=function(e,t){return null==e?at(t||\"html\"):ot(e,t||\"html\")},gt._={WeakMap:s,WeakSet:e},st=at,ft=new s,ht=Object.create,dt=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(d,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i,a,o,u=t.get(e)||dt(e,t);switch(typeof r){case\"object\":case\"function\":var c=u.w||(u.w=new s);return c.get(r)||(i=c,a=r,o=new e(n),i.set(a,o),o);default:var l=u.p||(u.p=ht(null));return l[r]||(l[r]=new e(n))}}(this,ft.get(e)||(n=e,r=new h,ft.set(n,r),r),e,null==t?\"default\":t);var n,r}}}),Object.defineProperties(d.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this[\"getAttribute\"in t&&t.getAttribute(\"data-call\")||\"on\"+e.type](e)}},html:v(\"html\",st),svg:v(\"svg\",st),state:v(\"state\",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new u(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r=\"function\"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),gt}(document);\nexport default hyperHTML;\nexport const {Component, bind, define, diff, hyper, wire} = hyperHTML;\n","// @ts-check\n// Temporary workaround until browsers get real import-maps\n\nimport * as _idb from \"../../node_modules/idb/build/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _marked } from \"../../node_modules/marked/lib/marked.esm.js\";\nimport _pluralize from \"../../js/deps/builds/pluralize.js\";\nimport hyperHTML from \"../../node_modules/hyperhtml/esm.js\";\n\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\n","// @ts-check\n// Module core/utils\n// As the name implies, this contains a ragtag gang of methods that just don't fit\n// anywhere else.\nimport { lang as docLang } from \"./l10n.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\nexport const name = \"core/utils\";\n\nconst dashes = /-/g;\n\n/**\n * Hashes a string from char code. Can return a negative number.\n * Based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0\n * @param {String} text\n */\nfunction hashString(text) {\n let hash = 0;\n for (const char of text) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) | 0;\n }\n return String(hash);\n}\n\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\n});\n\n/** CSS selector for matching elements that are non-normative */\nexport const nonNormativeSelector =\n \".informative, .note, .issue, .example, .ednote, .practice, .introductory\";\n\n/**\n * Creates a link element that represents a resource hint.\n *\n * @param {ResourceHintOption} opts Configure the resource hint.\n * @return {HTMLLinkElement} A link element ready to use.\n */\nexport function createResourceHint(opts) {\n const url = new URL(opts.href, document.baseURI);\n const linkElem = document.createElement(\"link\");\n let { href } = url;\n linkElem.rel = opts.hint;\n switch (linkElem.rel) {\n case \"dns-prefetch\":\n case \"preconnect\":\n href = url.origin;\n if (opts.corsMode || url.origin !== document.location.origin) {\n linkElem.crossOrigin = opts.corsMode || \"anonymous\";\n }\n break;\n case \"preload\":\n if (\"as\" in opts) {\n linkElem.setAttribute(\"as\", opts.as);\n }\n if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\n }\n break;\n }\n linkElem.href = href;\n if (!opts.dontRemove) {\n linkElem.classList.add(\"removeOnSave\");\n }\n return linkElem;\n}\n\n// RESPEC STUFF\n/**\n * @param {Document} doc\n */\nexport function removeReSpec(doc) {\n doc.querySelectorAll(\".remove, script[data-requiremodule]\").forEach(elem => {\n elem.remove();\n });\n}\n\n/**\n * Adds error class to each element while emitting a warning\n * @param {HTMLElement} elem\n * @param {String} msg message to show in warning\n * @param {String=} title error message to add on each element\n */\nfunction markAsOffending(elem, msg, title) {\n elem.classList.add(\"respec-offending-element\");\n if (!elem.hasAttribute(\"title\")) {\n elem.setAttribute(\"title\", title || msg);\n }\n if (!elem.id) {\n addId(elem, \"respec-offender\");\n }\n}\n\n// STRING HELPERS\n/**\n * @param {\"conjunction\"|\"disjunction\"} type\n * @param {\"long\"|\"narrow\"} style\n */\nfunction joinFactory(type, style = \"long\") {\n const formatter = new Intl.ListFormat(docLang, { style, type });\n /**\n * @template T\n * @param {string[]} items\n * @param {(value: string, index: number, array: string[]) => any} [mapper]\n */\n return (items, mapper) => {\n let elemCount = 0;\n return formatter.formatToParts(items).map(({ type, value }) => {\n if (type === \"element\" && mapper) {\n return mapper(value, elemCount++, items);\n }\n return value;\n });\n };\n}\n\n/**\n * Takes an array and returns a string that separates each of its items with the\n * proper commas and \"and\". The second argument is a mapping function that can\n * convert the items before they are joined.\n */\nconst conjunction = joinFactory(\"conjunction\");\nconst disjunction = joinFactory(\"disjunction\");\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinAnd(items, mapper) {\n return conjunction(items, mapper).join(\"\");\n}\n\n/**\n *\n * @param {string[]} items\n * @param {(value: undefined, index: number, array: undefined[]) => string} [mapper]\n */\nexport function joinOr(items, mapper) {\n return disjunction(items, mapper).join(\"\");\n}\n\n/**\n * Takes a string, applies some XML escapes, and returns the escaped string.\n * @param {string} str\n */\nexport function xmlEscape(str) {\n return str\n .replace(/&/g, \"&\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\");\n}\n\n/**\n * Trims string at both ends and replaces all other white space with a single\n * space.\n * @param {string} str\n */\nexport function norm(str) {\n return str.trim().replace(/\\s+/g, \" \");\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || data.en[key];\n if (!result) {\n throw new Error(`No l10n data for key: \"${key}\"`);\n }\n return result;\n },\n });\n}\n\n/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\n );\n}\n\n// --- DATE HELPERS -------------------------------------------------------------------------------\n/**\n * Takes a Date object and an optional separator and returns the year,month,day\n * representation with the custom separator (defaulting to none) and proper\n * 0-padding.\n * @param {Date} date\n */\nexport function concatDate(date, sep = \"\") {\n return ISODate.format(date).replace(dashes, sep);\n}\n\n/**\n * Checks if a date is in expected format used by ReSpec (yyyy-mm-dd)\n * @param {string} rawDate\n */\nexport function isValidConfDate(rawDate) {\n const date = /\\d{4}-\\d{2}-\\d{2}/.test(rawDate)\n ? new Date(rawDate)\n : \"Invalid Date\";\n return date.toString() !== \"Invalid Date\";\n}\n\n/**\n * Given an object, it converts it to a key value pair separated by (\"=\", configurable) and a delimiter (\" ,\" configurable).\n * @example {\"foo\": \"bar\", \"baz\": 1} becomes \"foo=bar, baz=1\"\n * @param {Record<string, any>} obj\n */\nexport function toKeyValuePairs(obj, delimiter = \", \", separator = \"=\") {\n return Array.from(Object.entries(obj))\n .map(([key, value]) => `${key}${separator}${JSON.stringify(value)}`)\n .join(delimiter);\n}\n\n// STYLE HELPERS\n/**\n * Take a document and either a link or an array of links to CSS and appends a\n * `<link rel=\"stylesheet\">` element to the head pointing to each.\n * @param {Document} doc\n * @param {string | string[]} urls\n */\nexport function linkCSS(doc, urls) {\n const stylesArray = [].concat(urls);\n const frag = stylesArray\n .map(url => {\n const link = doc.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n return link;\n })\n .reduce((elem, nextLink) => {\n elem.appendChild(nextLink);\n return elem;\n }, doc.createDocumentFragment());\n doc.head.appendChild(frag);\n}\n\n// TRANSFORMATIONS\n\n/**\n * Run list of transforms over content and return result.\n *\n * Please note that this is a legacy method that is only kept in order to\n * maintain compatibility with RSv1. It is therefore not tested and not actively\n * supported.\n * @this {any}\n * @param {string} content\n * @param {string} [flist] List of global function names.\n * @param {unknown[]} [funcArgs] Arguments to pass to each function.\n */\nexport function runTransforms(content, flist, ...funcArgs) {\n const args = [this, content, ...funcArgs];\n if (flist) {\n const methods = flist.split(/\\s+/);\n for (const meth of methods) {\n /** @type {any} */\n const method = window[meth];\n if (method) {\n // the initial call passed |this| directly, so we keep it that way\n try {\n content = method.apply(this, args);\n } catch (e) {\n const msg = `call to \\`${meth}()\\` failed with: ${e}.`;\n const hint = \"See developer console for stack trace.\";\n showWarning(msg, \"utils/runTransforms\", { hint, cause: e });\n }\n }\n }\n }\n return content;\n}\n\n/**\n * Cached request handler\n * @param {RequestInfo} input\n * @param {number} maxAge cache expiration duration in ms. defaults to 24 hours\n * @return {Promise<Response>}\n * if a cached response is available and it's not stale, return it\n * else: request from network, cache and return fresh response.\n * If network fails, return a stale cached version if exists (else throw)\n */\nexport async function fetchAndCache(input, maxAge = 24 * 60 * 60 * 1000) {\n const request = new Request(input);\n const url = new URL(request.url);\n\n // use data from cache data if valid and render\n let cache;\n let cachedResponse;\n if (\"caches\" in window) {\n try {\n cache = await caches.open(url.origin);\n cachedResponse = await cache.match(request);\n if (\n cachedResponse &&\n new Date(cachedResponse.headers.get(\"Expires\")) > new Date()\n ) {\n return cachedResponse;\n }\n } catch (err) {\n console.error(\"Failed to use Cache API.\", err);\n }\n }\n\n // otherwise fetch new data and cache\n const response = await fetch(request);\n if (!response.ok) {\n if (cachedResponse) {\n // return stale version\n console.warn(`Returning a stale cached response for ${url}`);\n return cachedResponse;\n }\n }\n\n // cache response\n if (cache && response.ok) {\n const clonedResponse = response.clone();\n const customHeaders = new Headers(response.headers);\n const expiryDate = new Date(Date.now() + maxAge);\n customHeaders.set(\"Expires\", expiryDate.toISOString());\n const cacheResponse = new Response(await clonedResponse.blob(), {\n headers: customHeaders,\n });\n // put in cache, and forget it (there is no recovery if it throws, but that's ok).\n await cache.put(request, cacheResponse).catch(console.error);\n }\n return response;\n}\n\n// --- DOM HELPERS -------------------------------\n\n/**\n * Separates each item with proper commas.\n * @template T\n * @param {T[]} array\n * @param {(item: T) => any} [mapper]\n */\nexport function htmlJoinComma(array, mapper = item => item) {\n const items = array.map(mapper);\n const joined = items.slice(0, -1).map(item => html`${item}, `);\n return html`${joined}${items[items.length - 1]}`;\n}\n/**\n *\n * @param {string[]} array\n * @param {(item: any) => any[]} [mapper]\n */\nexport function htmlJoinAnd(array, mapper) {\n const result = [].concat(conjunction(array, mapper));\n return result.map(item => (typeof item === \"string\" ? html`${item}` : item));\n}\n\n/**\n * Creates and sets an ID to an element (elem) by hashing the text content.\n *\n * @param {HTMLElement} elem element to hash from\n * @param {String} prefix prefix to prepend to the generated id\n */\nexport function addHashId(elem, prefix = \"\") {\n const text = norm(elem.textContent);\n const hash = hashString(text);\n return addId(elem, prefix, hash);\n}\n\n/**\n * Creates and sets an ID to an element (elem) using a specific prefix if\n * provided, and a specific text if given.\n * @param {HTMLElement} elem element\n * @param {String} pfx prefix\n * @param {String} txt text\n * @param {Boolean} noLC do not convert to lowercase\n * @returns {String} generated (or existing) id for element\n */\nexport function addId(elem, pfx = \"\", txt = \"\", noLC = false) {\n if (elem.id) {\n return elem.id;\n }\n if (!txt) {\n txt = (elem.title ? elem.title : elem.textContent).trim();\n }\n let id = noLC ? txt : txt.toLowerCase();\n id = id\n .trim()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\W+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n\n if (!id) {\n id = \"generatedID\";\n } else if (/\\.$/.test(id) || !/^[a-z]/i.test(pfx || id)) {\n id = `x${id}`; // trailing . doesn't play well with jQuery\n }\n if (pfx) {\n id = `${pfx}-${id}`;\n }\n if (elem.ownerDocument.getElementById(id)) {\n let i = 0;\n let nextId = `${id}-${i}`;\n while (elem.ownerDocument.getElementById(nextId)) {\n i += 1;\n nextId = `${id}-${i}`;\n }\n id = nextId;\n }\n elem.id = id;\n return id;\n}\n\n/**\n * Returns all the descendant text nodes of an element.\n * @param {Node} el\n * @param {string[]} exclusions node localName to exclude\n * @param {object} options\n * @param {boolean} options.wsNodes return only whitespace-only nodes.\n * @returns {Text[]}\n */\nexport function getTextNodes(el, exclusions = [], options = { wsNodes: true }) {\n const exclusionQuery = exclusions.join(\", \");\n const acceptNode = (/** @type {Text} */ node) => {\n if (!options.wsNodes && !node.data.trim()) {\n return NodeFilter.FILTER_REJECT;\n }\n if (exclusionQuery && node.parentElement.closest(exclusionQuery)) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n const nodeIterator = document.createNodeIterator(\n el,\n NodeFilter.SHOW_TEXT,\n acceptNode\n );\n /** @type {Text[]} */\n const textNodes = [];\n let node;\n while ((node = nodeIterator.nextNode())) {\n textNodes.push(/** @type {Text} */ (node));\n }\n return textNodes;\n}\n\n/**\n * For any element, returns an array of title strings that applies the algorithm\n * used for determining the actual title of a `<dfn>` element (but can apply to\n * other as well).\n *\n * This method now *prefers* the `data-lt` attribute for the list of titles.\n * That attribute is added by this method to `<dfn>` elements, so subsequent\n * calls to this method will return the `data-lt` based list.\n * @param {HTMLElement} elem\n * @returns {String[]} array of title strings\n */\nexport function getDfnTitles(elem) {\n const titleSet = new Set();\n // data-lt-noDefault avoid using the text content of a definition\n // in the definition list.\n // ltNodefault is === \"data-lt-noDefault\"... someone screwed up šŸ˜–\n const normText = \"ltNodefault\" in elem.dataset ? \"\" : norm(elem.textContent);\n const child = /** @type {HTMLElement | undefined} */ (elem.children[0]);\n if (elem.dataset.lt) {\n // prefer @data-lt for the list of title aliases\n elem.dataset.lt\n .split(\"|\")\n .map(item => norm(item))\n .forEach(item => titleSet.add(item));\n } else if (\n elem.childNodes.length === 1 &&\n elem.getElementsByTagName(\"abbr\").length === 1 &&\n child.title\n ) {\n titleSet.add(child.title);\n } else if (elem.textContent === '\"\"') {\n titleSet.add(\"the-empty-string\");\n }\n\n titleSet.add(normText);\n titleSet.delete(\"\");\n\n // We could have done this with @data-lt (as the logic is same), but if\n // @data-lt was not present, we would end up using @data-local-lt as element's\n // id (in other words, we prefer textContent over @data-local-lt for dfn id)\n if (elem.dataset.localLt) {\n const localLt = elem.dataset.localLt.split(\"|\");\n localLt.forEach(item => titleSet.add(norm(item)));\n }\n\n const titles = [...titleSet];\n return titles;\n}\n\n/**\n * For an element (usually <a>), returns an array of targets that element might\n * refer to, in the object structure:\n * @typedef {object} LinkTarget\n * @property {string} for\n * @property {string} title\n *\n * For an element like:\n * <p data-link-for=\"Int1\"><a data-link-for=\"Int2\">Int3.member</a></p>\n * we'll return:\n * * {for: \"int2\", title: \"int3.member\"}\n * * {for: \"int3\", title: \"member\"}\n * * {for: \"\", title: \"int3.member\"}\n * @param {HTMLElement} elem\n * @returns {LinkTarget[]}\n */\nexport function getLinkTargets(elem) {\n /** @type {HTMLElement} */\n const linkForElem = elem.closest(\"[data-link-for]\");\n const linkFor = linkForElem ? linkForElem.dataset.linkFor : \"\";\n const titles = getDfnTitles(elem);\n const results = titles.reduce((result, title) => {\n // supports legacy <dfn>Foo.Bar()</dfn> definitions\n const split = title.split(\".\");\n if (split.length === 2) {\n // If there are multiple '.'s, this won't match an\n // Interface/member pair anyway.\n result.push({ for: split[0], title: split[1] });\n }\n result.push({ for: linkFor, title });\n if (!linkForElem) result.push({ for: title, title });\n\n // Finally, we can try to match without link for\n if (linkFor !== \"\") result.push({ for: \"\", title });\n return result;\n }, []);\n return results;\n}\n\n/**\n * Changes name of a DOM Element\n * @param {Element} elem element to rename\n * @param {String} newName new element name\n * @param {Object} options\n * @param {boolean} options.copyAttributes\n *\n * @returns {Element} new renamed element\n */\nexport function renameElement(\n elem,\n newName,\n options = { copyAttributes: true }\n) {\n if (elem.localName === newName) return elem;\n const newElement = elem.ownerDocument.createElement(newName);\n // copy attributes\n if (options.copyAttributes) {\n for (const { name, value } of elem.attributes) {\n newElement.setAttribute(name, value);\n }\n }\n // copy child nodes\n newElement.append(...elem.childNodes);\n elem.replaceWith(newElement);\n return newElement;\n}\n\n/**\n * @param {string} ref\n * @param {HTMLElement} element\n */\nexport function refTypeFromContext(ref, element) {\n const closestInformative = element.closest(nonNormativeSelector);\n let isInformative = false;\n if (closestInformative) {\n // check if parent is not normative\n isInformative =\n !element.closest(\".normative\") ||\n !closestInformative.querySelector(\".normative\");\n }\n // prefixes `!` and `?` override section behavior\n if (ref.startsWith(\"!\")) {\n if (isInformative) {\n // A (forced) normative reference in informative section is illegal\n return { type: \"informative\", illegal: true };\n }\n isInformative = false;\n } else if (ref.startsWith(\"?\")) {\n isInformative = true;\n }\n const type = isInformative ? \"informative\" : \"normative\";\n return { type, illegal: false };\n}\n\n/**\n * Wraps inner contents with the wrapper node\n * @param {Node} outer outer node to be modified\n * @param {Element} wrapper wrapper node to be appended\n */\nexport function wrapInner(outer, wrapper) {\n wrapper.append(...outer.childNodes);\n outer.appendChild(wrapper);\n return outer;\n}\n\n/**\n * @param {Element} element\n */\nexport function getPreviousSections(element) {\n /** @type {Element[]} */\n const sections = [];\n for (const previous of iteratePreviousElements(element)) {\n if (previous.localName === \"section\") {\n sections.push(previous);\n }\n }\n return sections;\n}\n\n/**\n * @param {Element} element\n */\nfunction* iteratePreviousElements(element) {\n let previous = element;\n while (previous.previousElementSibling) {\n previous = previous.previousElementSibling;\n yield previous;\n }\n}\n/**\n * Applies the selector for all its ancestors.\n * @param {Element} element\n * @param {string} selector\n */\nexport function parents(element, selector) {\n /** @type {Element[]} */\n const list = [];\n let parent = element.parentElement;\n while (parent) {\n const closest = parent.closest(selector);\n if (!closest) {\n break;\n }\n list.push(closest);\n parent = closest.parentElement;\n }\n return list;\n}\n\n/**\n * Calculates indentation when the element starts after a newline. The value\n * will be empty if no newline or any non-whitespace exists after one.\n * @param {Element} element\n *\n * @example ` <div></div>` returns \" \" (4 spaces).\n */\nexport function getElementIndentation(element) {\n const { previousSibling } = element;\n if (!previousSibling || previousSibling.nodeType !== Node.TEXT_NODE) {\n return \"\";\n }\n const index = previousSibling.textContent.lastIndexOf(\"\\n\");\n if (index === -1) {\n return \"\";\n }\n const slice = previousSibling.textContent.slice(index + 1);\n if (/\\S/.test(slice)) {\n return \"\";\n }\n return slice;\n}\n\n/**\n * Generates simple ids. The id's increment after it yields.\n *\n * @param {String} namespace A string like \"highlight\".\n * @param {number} counter A number, which can start at a given value.\n */\nexport function msgIdGenerator(namespace, counter = 0) {\n /** @returns {Generator<string, never, never>} */\n function* idGenerator(namespace, counter) {\n while (true) {\n yield `${namespace}:${counter}`;\n counter++;\n }\n }\n const gen = idGenerator(namespace, counter);\n return () => {\n return gen.next().value;\n };\n}\n\n/** @extends {Set<string>} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array<String>} [keys] Optional, initial keys\n */\n constructor(keys = []) {\n super();\n for (const key of keys) {\n this.add(key);\n }\n }\n /**\n * @param {string} key\n */\n add(key) {\n if (!this.has(key) && !this.getCanonicalKey(key)) {\n return super.add(key);\n }\n return this;\n }\n /**\n * @param {string} key\n */\n has(key) {\n return (\n super.has(key) ||\n [...this.keys()].some(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n )\n );\n }\n /**\n * @param {string} key\n */\n delete(key) {\n return super.has(key)\n ? super.delete(key)\n : super.delete(this.getCanonicalKey(key));\n }\n /**\n * @param {string} key\n */\n getCanonicalKey(key) {\n return super.has(key)\n ? key\n : [...this.keys()].find(\n existingKey => existingKey.toLowerCase() === key.toLowerCase()\n );\n }\n}\n\n/**\n * @param {HTMLElement} node\n */\nexport function makeSafeCopy(node) {\n const clone = node.cloneNode(true);\n clone.querySelectorAll(\"[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n clone.querySelectorAll(\"dfn\").forEach(dfn => {\n renameElement(dfn, \"span\", { copyAttributes: false });\n });\n if (clone.hasAttribute(\"id\")) clone.removeAttribute(\"id\");\n removeCommentNodes(clone);\n return clone;\n}\n\n/**\n * @param {Node} node\n */\nexport function removeCommentNodes(node) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT);\n for (const comment of [...walkTree(walker)]) {\n comment.remove();\n }\n}\n\n/**\n * @template {Node} T\n * @param {TreeWalker<T>} walker\n * @return {IterableIterator<T>}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map<string, ValueType>}\n */\nexport class CaseInsensitiveMap extends Map {\n /**\n * @param {Array<[string, ValueType]>} [entries]\n */\n constructor(entries = []) {\n super();\n entries.forEach(([key, elem]) => {\n this.set(key, elem);\n });\n return this;\n }\n /**\n * @param {String} key\n * @param {ValueType} value\n */\n set(key, value) {\n super.set(key.toLowerCase(), value);\n return this;\n }\n /**\n * @param {String} key\n */\n get(key) {\n return super.get(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n has(key) {\n return super.has(key.toLowerCase());\n }\n /**\n * @param {String} key\n */\n delete(key) {\n return super.delete(key.toLowerCase());\n }\n}\n\nexport class RespecError extends Error {\n /**\n * @param {Parameters<typeof showError>[0]} message\n * @param {Parameters<typeof showError>[1]} plugin\n * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options\n */\n constructor(message, plugin, options) {\n super(message, { ...(options.cause && { cause: options.cause }) });\n const name = options.isWarning ? \"ReSpecWarning\" : \"ReSpecError\";\n Object.assign(this, { message, plugin, name, ...options });\n if (options.elements) {\n options.elements.forEach(elem =>\n markAsOffending(elem, message, options.title)\n );\n }\n }\n\n toJSON() {\n const { message, name, stack } = this;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792\n const { plugin, hint, elements, title, details } = this;\n return {\n message,\n name,\n plugin,\n hint,\n elements,\n title,\n details,\n stack,\n ...(this.cause instanceof Error && {\n cause: {\n name: this.cause.name,\n message: this.cause.message,\n stack: this.cause.stack,\n },\n }),\n };\n }\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n * @param {Error} [options.cause] The error that caused this one.\n */\nexport function showError(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: false };\n pub(\"error\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * @param {string} message\n * @param {string} pluginName Name of plugin that caused the error.\n * @param {object} [options]\n * @param {string} [options.hint] How to solve the error?\n * @param {HTMLElement[]} [options.elements] Offending elements.\n * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message.\n * @param {string} [options.details] Any further details/context.\n * @param {Error} [options.cause] The error that caused this one.\n */\nexport function showWarning(message, pluginName, options = {}) {\n const opts = { ...options, isWarning: true };\n pub(\"warn\", new RespecError(message, pluginName, opts));\n}\n\n/**\n * Creates showError, showWarning utilities for use in custom pre-process and\n * post-process plugins.\n * @param {string} pluginName\n */\nexport function makePluginUtils(pluginName) {\n /** @typedef {Parameters<typeof showError>[2]} Options */\n return {\n /** @type {(message: string, options?: Options) => void} */\n showError: (msg, options) => showError(msg, pluginName, options),\n /** @type {(message: string, options?: Options) => void} */\n showWarning: (msg, options) => showWarning(msg, pluginName, options),\n };\n}\n\n/**\n * Makes a string `coded`.\n *\n * @param {string} item\n * @returns {string}\n */\nexport function toMDCode(item) {\n return item ? `\\`${item}\\`` : \"\";\n}\n\n/**\n * Joins an array of strings, wrapping each string in back-ticks (`) for inline markdown code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinOr(array, { quotes } = { quotes: false }) {\n return joinOr(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\n/**\n * Wraps in back-ticks ` for code.\n *\n * @param {string[]} array\n * @param {object} options\n * @param {boolean} options.quotes Surround each item in quotes\n */\nexport function codedJoinAnd(array, { quotes } = { quotes: false }) {\n return joinAnd(array, quotes ? s => toMDCode(addQuotes(s)) : toMDCode);\n}\n\nfunction addQuotes(item) {\n return String(item) ? `\"${item}\"` : \"\";\n}\n\n/**\n * Tagged template string, helps with linking to documentation.\n * Things inside [squareBrackets] are considered direct links to the documentation.\n * To alias something, one can use a \"|\", like [respecConfig|#respec-configuration].\n * @param {TemplateStringsArray} strings\n * @param {string[]} keys\n */\nexport function docLink(strings, ...keys) {\n const linkifiedStr = strings\n .map((s, i) => {\n const key = keys[i];\n if (!key) {\n return s;\n }\n // Linkables are wrapped in square brackets\n if (!key.startsWith(\"[\") && !key.endsWith(\"]\")) {\n return s + key;\n }\n\n const [linkingText, href] = key.slice(1, -1).split(\"|\");\n if (href) {\n const url = new URL(href, \"https://respec.org/docs/\");\n return `${s}[${linkingText}](${url})`;\n }\n return `${s}[\\`${linkingText}\\`](https://respec.org/docs/#${linkingText})`;\n })\n .join(\"\");\n return reindent(linkifiedStr);\n}\n\n/**\n * Takes a text string, trims it, splits it into lines,\n * finds the common indentation level, and then de-indents every line\n * by that common indentation level.\n *\n * @param {string} text - The text to be re-indented.\n * @returns {string} The re-indented text.\n */\nexport function reindent(text) {\n if (!text) {\n return text;\n }\n const lines = text.trimEnd().split(\"\\n\");\n while (lines.length && !lines[0].trim()) {\n lines.shift();\n }\n const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\\s]/));\n const leastIndent = Math.min(...indents);\n return lines.map(s => s.slice(leastIndent)).join(\"\\n\");\n}\n","// @ts-check\n/**\n * Module core/pubsubhub\n *\n * Returns a singleton that can be used for message broadcasting\n * and message receiving. Replaces legacy \"msg\" code in ReSpec.\n */\nexport const name = \"core/pubsubhub\";\n\nimport { expose } from \"./expose-modules.js\";\nimport { showError } from \"./utils.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.once] Add prop \"once\" for single notification.\n * @return {Object} An object that should be considered opaque,\n * used for unsubscribing from messages.\n */\nexport function sub(topic, cb, options = { once: false }) {\n /** @param {CustomEvent} ev */\n const listener = async ev => {\n try {\n await cb(ev.detail);\n } catch (error) {\n const msg = `Error in handler for topic \"${topic}\": ${error.message}`;\n showError(msg, `sub:${topic}`, { cause: error });\n }\n };\n subscriptions.addEventListener(topic, listener, options);\n}\n\nexpose(name, { sub });\n","// @ts-check\n// Module core/include-config\n// Inject's the document's configuration into the head as JSON.\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/include-config\";\n\nconst removeList = [\"githubToken\", \"githubUser\"];\n\nexport function run(config) {\n const userConfig = {};\n const amendConfig = newValues => Object.assign(userConfig, newValues);\n\n amendConfig(config);\n sub(\"amend-user-config\", amendConfig);\n\n sub(\"end-all\", () => {\n const script = document.createElement(\"script\");\n script.id = \"initialUserConfig\";\n script.type = \"application/json\";\n for (const prop of removeList) {\n if (prop in userConfig) delete userConfig[prop];\n }\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n document.head.appendChild(script);\n });\n}\n","// @ts-check\n/**\n * module: core/exporter\n * Exports a ReSpec document, based on mime type, so it can be saved, etc.\n * Also performs cleanup, removing things that shouldn't be in published documents.\n * That is, elements that have a \"removeOnSave\" css class.\n */\n\nimport { removeCommentNodes, removeReSpec } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst mimeTypes = new Map([\n [\"text/html\", \"html\"],\n [\"application/xml\", \"xml\"],\n]);\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\n * @param {String} mimeType mimetype. one of `mimeTypes` above\n * @param {Document} doc document to export. useful for testing purposes\n * @returns a stringified data-uri of document that can be saved.\n */\nexport function rsDocToDataURL(mimeType, doc = document) {\n const format = mimeTypes.get(mimeType);\n if (!format) {\n const validTypes = [...mimeTypes.values()].join(\", \");\n const msg = `Invalid format: ${mimeType}. Expected one of: ${validTypes}.`;\n throw new TypeError(msg);\n }\n const data = serialize(format, doc);\n const encodedString = encodeURIComponent(data);\n return `data:${mimeType};charset=utf-8,${encodedString}`;\n}\n\nexport function serialize(format, doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n let result = \"\";\n switch (format) {\n case \"xml\":\n result = new XMLSerializer().serializeToString(cloneDoc);\n break;\n default: {\n prettify(cloneDoc);\n if (cloneDoc.doctype) {\n result += new XMLSerializer().serializeToString(cloneDoc.doctype);\n }\n result += cloneDoc.documentElement.outerHTML;\n }\n }\n return result;\n}\n\nfunction cleanup(cloneDoc) {\n const { head, body, documentElement } = cloneDoc;\n removeCommentNodes(cloneDoc);\n\n cloneDoc\n .querySelectorAll(\".removeOnSave, #toc-nav\")\n .forEach(elem => elem.remove());\n body.classList.remove(\"toc-sidebar\");\n removeReSpec(documentElement);\n\n const insertions = cloneDoc.createDocumentFragment();\n\n // Move meta viewport, as it controls the rendering on mobile.\n const metaViewport = cloneDoc.querySelector(\"meta[name='viewport']\");\n if (metaViewport && head.firstChild !== metaViewport) {\n insertions.appendChild(metaViewport);\n }\n\n // Move charset to near top, as it needs to be in the first 512 bytes.\n let metaCharset = cloneDoc.querySelector(\n \"meta[charset], meta[content*='charset=']\"\n );\n if (!metaCharset) {\n metaCharset = html`<meta charset=\"utf-8\" />`;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n <meta name=\"generator\" content=\"${respecVersion}\" />\n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/** @param {Document} cloneDoc */\nfunction prettify(cloneDoc) {\n cloneDoc.querySelectorAll(\"style\").forEach(el => {\n el.innerHTML = `\\n${el.innerHTML}\\n`;\n });\n cloneDoc.querySelectorAll(\"head > *\").forEach(el => {\n el.outerHTML = `\\n${el.outerHTML}`;\n });\n}\n\nexpose(\"core/exporter\", { rsDocToDataURL });\n","// @ts-check\n/**\n * This module adds a `respec` object to the `document` with the following\n * readonly properties:\n * - version: returns version of ReSpec Script.\n * - ready: returns a promise that settles when ReSpec finishes processing.\n *\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise<void>} */\n this._respecDonePromise = new Promise(resolve => {\n sub(\"end-all\", () => resolve(), { once: true });\n });\n\n this.errors = [];\n this.warnings = [];\n\n sub(\"error\", rsError => {\n console.error(rsError, rsError.toJSON());\n this.errors.push(rsError);\n });\n sub(\"warn\", rsError => {\n console.warn(rsError, rsError.toJSON());\n this.warnings.push(rsError);\n });\n }\n\n get version() {\n return window.respecVersion;\n }\n\n get ready() {\n return this._respecDonePromise;\n }\n\n async toHTML() {\n return serialize(\"html\", document);\n }\n}\n\nexport function init() {\n const respec = new ReSpec();\n Object.defineProperty(document, \"respec\", { value: respec });\n}\n","// @ts-check\n/**\n * Module core/post-process\n *\n * Corresponds to respecConfig.postProcess and config.afterEnd.\n * - postProcess: an array of functions that get called\n * after processing finishes. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile.\n * - afterEnd: final thing that is called.\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/post-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.postProcess)) {\n const promises = config.postProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `postProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`postProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint, cause: err });\n }\n });\n await Promise.all(promises);\n }\n if (typeof config.afterEnd === \"function\") {\n await config.afterEnd(config, document);\n }\n}\n","// @ts-check\n/**\n * Module core/pre-process\n *\n * Corresponds to respecConfig.preProcess.\n * - preProcess: an array of functions that get called\n * before anything else happens. This is not recommended and the feature is not\n * tested. Use with care, if you know what you're doing. Chances are you really\n * want to be using a new module with your own profile\n */\nimport { makePluginUtils, showError } from \"./utils.js\";\n\nexport const name = \"core/pre-process\";\n\nexport async function run(config) {\n if (Array.isArray(config.preProcess)) {\n const promises = config.preProcess\n .filter(f => {\n const isFunction = typeof f === \"function\";\n if (!isFunction) {\n const msg = \"Every item in `preProcess` must be a JS function.\";\n showError(msg, name);\n }\n return isFunction;\n })\n .map(async (f, i) => {\n const fnName = `${name}/${f.name || `[${i}]`}`;\n const utils = makePluginUtils(fnName);\n try {\n return await f(config, document, utils);\n } catch (err) {\n const msg = `Function ${f.name} threw an error during \\`preProcess\\`.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint, cause: err });\n }\n });\n await Promise.all(promises);\n }\n}\n","// @ts-check\n// Module core/base-runner\n// The module in charge of running the whole processing pipeline.\nimport { run as includeConfig } from \"./include-config.js\";\nimport { init as initReSpecGlobal } from \"./respec-global.js\";\nimport { run as overrideConfig } from \"./override-configuration.js\";\nimport { run as postProcess } from \"./post-process.js\";\nimport { run as preProcess } from \"./pre-process.js\";\nimport { pub } from \"./pubsubhub.js\";\nimport { removeReSpec } from \"./utils.js\";\n\nexport const name = \"core/base-runner\";\n\nexport async function runAll(plugs) {\n initReSpecGlobal();\n\n pub(\"start-all\", respecConfig);\n includeConfig(respecConfig);\n overrideConfig(respecConfig);\n performance.mark(`${name}-start`);\n await preProcess(respecConfig);\n\n const runnables = plugs.filter(p => isRunnableModule(p));\n runnables.forEach(\n plug => !plug.name && console.warn(\"Plugin lacks name:\", plug)\n );\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n pub(\"plugins-done\", respecConfig);\n\n await postProcess(respecConfig);\n pub(\"end-all\");\n removeReSpec(document);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n}\n\nfunction isRunnableModule(plug) {\n return plug && (plug.run || plug.Plugin);\n}\n\nasync function executePreparePass(runnables, config) {\n for (const plug of runnables.filter(p => p.prepare)) {\n try {\n await plug.prepare(config);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nasync function executeRunPass(runnables, config) {\n for (const plug of runnables) {\n const name = plug.name || \"\";\n\n try {\n // eslint-disable-next-line no-async-promise-executor\n await new Promise(async (resolve, reject) => {\n const timerId = setTimeout(() => {\n const msg = `Plugin ${name} took too long.`;\n console.error(msg, plug);\n reject(new Error(msg));\n }, 15000);\n\n performance.mark(`${name}-start`);\n try {\n if (plug.Plugin) {\n await new plug.Plugin(config).run();\n resolve();\n } else if (plug.run) {\n await plug.run(config);\n resolve();\n }\n } catch (err) {\n reject(err);\n } finally {\n clearTimeout(timerId);\n performance.mark(`${name}-end`);\n performance.measure(name, `${name}-start`, `${name}-end`);\n }\n });\n } catch (error) {\n console.error(error);\n }\n }\n}\n","// @ts-check\n// Module core/override-configuration\n// A helper module that makes it possible to override settings specified in respecConfig\n// by passing them as a query string. This is useful when you just want to make a few\n// tweaks to a document before generating the snapshot, without mucking with the source.\n// For example, you can change the status and date by appending:\n// ?specStatus=LC&publishDate=2012-03-15\nimport { pub } from \"./pubsubhub.js\";\n\nexport const name = \"core/override-configuration\";\n\nexport function run(config) {\n const params = new URLSearchParams(document.location.search);\n const overrideEntries = Array.from(params)\n .filter(([key, value]) => !!key && !!value)\n .map(([codedKey, codedValue]) => {\n const key = decodeURIComponent(codedKey);\n const decodedValue = decodeURIComponent(codedValue.replace(/%3D/g, \"=\"));\n let value;\n try {\n value = JSON.parse(decodedValue);\n } catch {\n value = decodedValue;\n }\n return [key, value];\n });\n const overrideProps = Object.fromEntries(overrideEntries);\n Object.assign(config, overrideProps);\n pub(\"amend-user-config\", overrideProps);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.respec-modal .close-button {\n position: absolute;\n z-index: inherit;\n padding: 0.2em;\n font-weight: bold;\n cursor: pointer;\n margin-left: 5px;\n border: none;\n background: transparent;\n}\n\n#respec-ui {\n position: fixed;\n display: flex;\n flex-direction: row-reverse;\n top: 20px;\n right: 20px;\n width: 202px;\n text-align: right;\n z-index: 9000;\n}\n\n\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\n background: var(--bg, #fff);\n color: rgb(120, 120, 120);\n color: var(--tocnav-normal-text, rgb(120, 120, 120));\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n box-shadow: 1px 1px 8px 0 var(--tocsidebar-shadow, rgba(100, 100, 100, 0.5));\n padding: 0.2em 0em;\n}\n\n.respec-info-button {\n border: none;\n opacity: 0.75;\n border-radius: 2em;\n margin-right: 1em;\n min-width: 3.5em;\n will-change: opacity;\n}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\n}\n\n@keyframes respec-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.respec-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s linear;\n}\n\n.respec-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s linear;\n}\n\n#respec-pill:hover,\n#respec-pill:focus {\n color: rgb(0, 0, 0);\n background-color: rgb(245, 245, 245);\n transition: color 0.2s;\n}\n\n#respec-menu {\n position: absolute;\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n background: var(--bg, #fff);\n color: var(--text, black);\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n width: 200px;\n display: none;\n text-align: left;\n margin-top: 32px;\n font-size: 0.8em;\n}\n\n#respec-menu:not([hidden]) {\n display: block;\n}\n\n#respec-menu li {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.respec-save-buttons {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(47%, 2fr));\n grid-gap: 0.5cm;\n padding: 0.5cm;\n}\n\n.respec-save-button:link {\n padding-top: 16px;\n color: var(--def-text, white);\n background: var(--def-bg, rgb(42, 90, 168));\n justify-self: stretch;\n height: 1cm;\n text-decoration: none;\n text-align: center;\n font-size: inherit;\n border: none;\n border-radius: 0.2cm;\n}\n\n.respec-save-button:link:hover {\n color: var(--def-text, white);\n background: var(--defrow-border, rgb(42, 90, 168));\n padding: 0;\n margin: 0;\n border: 0;\n padding-top: 16px;\n}\n\n.respec-save-button:link:focus {\n background: var(--tocnav-active-bg, #193766);\n color: var(--tocnav-active-text, black);\n}\n\n#respec-ui button:focus,\n#respec-pill:focus,\n.respec-option:focus {\n outline: 0;\n outline-style: none;\n}\n\n#respec-pill-error {\n background-color: red;\n color: white;\n}\n\n#respec-pill-warning {\n background-color: orange;\n color: white;\n}\n\n.respec-warning-list,\n.respec-error-list {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.respec-error-list) p {\n padding: 0;\n margin: 0;\n}\n\n.respec-warning-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 245, 194);\n}\n\n.respec-error-list,\n.respec-error-list li {\n background-color: rgb(255, 240, 240);\n}\n\n.respec-warning-list > li::before {\n content: \"āš ļø\";\n}\n\n.respec-error-list > li::before {\n content: \"šŸ’„\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\n list-style: disc;\n}\n\n#respec-overlay {\n display: block;\n position: fixed;\n z-index: 10000;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n background: #000;\n}\n\n.respec-show-overlay {\n transition: opacity 0.2s linear;\n opacity: 0.5;\n}\n\n.respec-hide-overlay {\n transition: opacity 0.2s linear;\n opacity: 0;\n}\n\n.respec-modal {\n display: block;\n position: fixed;\n z-index: 11000;\n top: 10%;\n background: var(--bg, #fff);\n color: var(--text, black);\n border: 5px solid #666;\n border-color: var(--tocsidebar-shadow, #666);\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\n}\n\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n left: 0 !important;\n text-align: center;\n background: var(--tocsidebar-shadow, #ddd);\n color: var(--text, black);\n font-size: 1em;\n}\n\n#respec-menu button.respec-option {\n background: var(--bg, white);\n color: var(--text, black);\n border: none;\n width: 100%;\n text-align: left;\n font-size: inherit;\n padding: 1.2em 1.2em;\n}\n\n#respec-menu button.respec-option:hover {\n background-color: var(--tocnav-hover-bg, #eee);\n color: var(--tocnav-hover-text, black);\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\n}\n\n.respec-button-copy-paste {\n position: absolute;\n height: 28px;\n width: 40px;\n cursor: pointer;\n background-image: linear-gradient(#fcfcfc, #eee);\n border: 1px solid rgb(144, 184, 222);\n border-left: 0;\n border-radius: 0px 0px 3px 0;\n -webkit-user-select: none;\n user-select: none;\n -webkit-appearance: none;\n top: 0;\n left: 127px;\n}\n\n@media print {\n #respec-ui {\n display: none;\n }\n}\n\n.respec-iframe {\n width: 100%;\n min-height: 550px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.respec-iframe:not(.ready) {\n background: url(\"https://respec.org/xref/loader.gif\") no-repeat center;\n}\n\n.respec-iframe + a[href] {\n font-size: 0.9rem;\n float: right;\n margin: 0 0.5em 0.5em;\n border-bottom-width: 1px;\n}\n\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\n}\n`;\n","// @ts-check\n/**\n * Module core/markdown\n * Handles the optional markdown processing.\n *\n * Markdown support is optional. It is enabled by setting the `format`\n * property of the configuration object to \"markdown.\"\n *\n * We use marked for parsing Markdown:\n * https://github.com/markedjs/marked\n *\n */\n\nimport { getElementIndentation, reindent } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\n\nexport const name = \"core/markdown\";\n\nconst gtEntity = />/gm;\nconst ampEntity = /&/gm;\n\nclass Renderer extends marked.Renderer {\n code(code, infoString, isEscaped) {\n const { language, ...metaData } = Renderer.parseInfoString(infoString);\n\n // regex to check whether the language is webidl\n if (/(^webidl$)/i.test(language)) {\n return `<pre class=\"idl\">${code}</pre>`;\n }\n\n const html = super\n .code(code, language, isEscaped)\n .replace(`class=\"language-`, `class=\"`);\n\n const { example, illegalExample } = metaData;\n if (!example && !illegalExample) return html;\n\n const title = example || illegalExample;\n const className = `${language} ${example ? \"example\" : \"illegal-example\"}`;\n return html.replace(\"<pre>\", `<pre title=\"${title}\" class=\"${className}\">`);\n }\n\n image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\n }\n\n /**\n * @param {string} infoString\n */\n static parseInfoString(infoString) {\n const firstSpace = infoString.search(/\\s/);\n if (firstSpace === -1) {\n return { language: infoString };\n }\n\n const language = infoString.slice(0, firstSpace);\n const metaDataStr = infoString.slice(firstSpace + 1);\n let metaData;\n if (metaDataStr) {\n try {\n metaData = JSON.parse(`{ ${metaDataStr} }`);\n } catch (error) {\n console.error(error);\n }\n }\n\n return { language, ...metaData };\n }\n\n heading(text, level, raw) {\n const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n if (headingWithIdRegex.test(text)) {\n const [, textContent, id] = text.match(headingWithIdRegex);\n return `<h${level} id=\"${id}\">${textContent}</h${level}>`;\n }\n return super.heading(text, level, raw);\n }\n}\n\n/** @type {import('marked').MarkedOptions} */\nconst config = {\n gfm: true,\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\n const normalizedLeftPad = reindent(text);\n // As markdown is pulled from HTML, > and & are already escaped and\n // so blockquotes aren't picked up by the parser. This fixes it.\n const potentialMarkdown = normalizedLeftPad\n .replace(gtEntity, \">\")\n .replace(ampEntity, \"&\");\n\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\n return result;\n}\n\n/**\n * @param {string} selector\n * @return {(el: Element) => Element[]}\n */\nfunction convertElements(selector) {\n return element => {\n const elements = element.querySelectorAll(selector);\n elements.forEach(convertElement);\n return Array.from(elements);\n };\n}\n\n/**\n * @param {Element} element\n */\nfunction convertElement(element) {\n for (const pre of element.getElementsByTagName(\"pre\")) {\n // HTML parser implicitly removes a newline after <pre>\n // which breaks reindentation algorithm\n pre.prepend(\"\\n\");\n }\n element.innerHTML = markdownToHtml(element.innerHTML);\n}\n\n/**\n * CommonMark requires additional empty newlines between markdown and HTML lines.\n * This function adds them as a backward compatibility workaround.\n * @param {HTMLElement} element\n * @param {string} selector\n */\nfunction workaroundBlockLevelMarkdown(element, selector) {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = element.querySelectorAll(selector);\n for (const element of elements) {\n const { innerHTML } = element;\n if (/^<\\w/.test(innerHTML.trimStart())) {\n // if the block content starts with HTML-like format\n // then assume it doesn't need a workaround\n continue;\n }\n // Double newlines are needed to be parsed as Markdown\n const lines = innerHTML.split(\"\\n\");\n const firstTwo = lines.slice(0, 2).join(\"\\n\");\n const lastTwo = lines.slice(-2).join(\"\\n\");\n if (firstTwo.trim()) {\n element.prepend(\"\\n\\n\");\n }\n if (lastTwo.trim()) {\n // keep the indentation of the end tag\n const indentation = getElementIndentation(element);\n element.append(`\\n\\n${indentation}`);\n }\n }\n}\n\n/**\n * @param {Iterable<Element>} elements\n */\nfunction substituteWithTextNodes(elements) {\n Array.from(elements).forEach(element => {\n element.replaceWith(element.textContent);\n });\n}\n\nconst processMDSections = convertElements(\"[data-format='markdown']:not(body)\");\nconst blockLevelElements =\n \"[data-format=markdown], section, div, address, article, aside, figure, header, main\";\n\nexport function run(conf) {\n const hasMDSections = !!document.querySelector(\n \"[data-format=markdown]:not(body)\"\n );\n const isMDFormat = conf.format === \"markdown\";\n if (!isMDFormat && !hasMDSections) {\n return; // Nothing to be done\n }\n // Only has markdown-format sections\n if (!isMDFormat) {\n processMDSections(document.body);\n return;\n }\n // We transplant the UI to do the markdown processing\n const rsUI = document.getElementById(\"respec-ui\");\n rsUI.remove();\n // The new body will replace the old body\n const newBody = document.body.cloneNode(true);\n // Marked expects markdown be flush against the left margin\n // so we need to normalize the inner text of some block\n // elements.\n workaroundBlockLevelMarkdown(newBody, blockLevelElements);\n convertElement(newBody);\n // Remove links where class .nolinks\n substituteWithTextNodes(newBody.querySelectorAll(\".nolinks a[href]\"));\n // Frankenstein the whole thing back together\n newBody.append(rsUI);\n document.body.replaceWith(newBody);\n}\n","// @ts-check\n// Module core/ui\n// Handles the ReSpec UI\n// XXX TODO\n// - look at other UI things to add\n// - list issues\n// - lint: validator, link checker, check WebIDL, ID references\n// - save to GitHub\n// - make a release candidate that people can test\n// - once we have something decent, merge, ship as 3.2.0\nimport { html, pluralize } from \"./import-maps.js\";\nimport { reindent, xmlEscape } from \"./utils.js\";\nimport css from \"../styles/ui.css.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/ui\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\ninsertStyle();\n\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-ui-styles\";\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\nfunction ariaDecorate(elem, ariaMap) {\n if (!elem) {\n return;\n }\n Array.from(ariaMap).forEach(([name, value]) => {\n elem.setAttribute(`aria-${name}`, value);\n });\n}\n\nconst respecUI = html`<div id=\"respec-ui\" class=\"removeOnSave\" hidden></div>`;\nconst menu = html`<ul\n id=\"respec-menu\"\n role=\"menu\"\n aria-labelledby=\"respec-pill\"\n hidden\n></ul>`;\nconst closeButton = html`<button\n class=\"close-button\"\n onclick=${() => ui.closeModal()}\n title=\"Close\"\n>\n āŒ\n</button>`;\nwindow.addEventListener(\"load\", () => trapFocus(menu));\nlet modal;\nlet overlay;\nconst errors = [];\nconst warnings = [];\nconst buttons = {};\n\nsub(\"start-all\", () => document.body.prepend(respecUI), { once: true });\nsub(\"end-all\", () => document.body.prepend(respecUI), { once: true });\n\nconst respecPill = html`<button id=\"respec-pill\" disabled>ReSpec</button>`;\nrespecUI.appendChild(respecPill);\nrespecPill.addEventListener(\"click\", e => {\n e.stopPropagation();\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n menu.querySelector(\"li:first-child button\").focus();\n});\n\ndocument.documentElement.addEventListener(\"click\", () => {\n if (!menu.hidden) {\n toggleMenu();\n }\n});\nrespecUI.appendChild(menu);\n\nmenu.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\" && !menu.hidden) {\n respecPill.setAttribute(\"aria-expanded\", String(menu.hidden));\n toggleMenu();\n respecPill.focus();\n }\n});\n\nfunction toggleMenu() {\n menu.classList.toggle(\"respec-hidden\");\n menu.classList.toggle(\"respec-visible\");\n menu.hidden = !menu.hidden;\n}\n\n// Code adapted from https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element\nfunction trapFocus(element) {\n const focusableEls = element.querySelectorAll(\n \"a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])\"\n );\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (firstFocusableEl) {\n firstFocusableEl.focus();\n }\n element.addEventListener(\"keydown\", e => {\n if (e.key !== \"Tab\") {\n return;\n }\n // shift + tab\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n }\n // tab\n else if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n });\n}\n\nconst ariaMap = new Map([\n [\"controls\", \"respec-menu\"],\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"label\", \"ReSpec Menu\"],\n]);\nariaDecorate(respecPill, ariaMap);\n\nfunction errWarn(err, arr, butName, title) {\n arr.push(err);\n if (!buttons.hasOwnProperty(butName)) {\n buttons[butName] = createWarnButton(butName, arr, title);\n respecUI.appendChild(buttons[butName]);\n }\n const button = buttons[butName];\n button.textContent = arr.length;\n const label = arr.length === 1 ? pluralize.singular(title) : title;\n const ariaMap = new Map([[\"label\", `${arr.length} ${label}`]]);\n ariaDecorate(button, ariaMap);\n}\n\nfunction createWarnButton(butName, arr, title) {\n const buttonId = `respec-pill-${butName}`;\n const button = html`<button\n id=\"${buttonId}\"\n class=\"respec-info-button\"\n ></button>`;\n button.addEventListener(\"click\", () => {\n button.setAttribute(\"aria-expanded\", \"true\");\n const ol = html`<ol class=\"${`respec-${butName}-list`}\"></ol>`;\n for (const err of arr) {\n const fragment = document\n .createRange()\n .createContextualFragment(rsErrorToHTML(err));\n const li = document.createElement(\"li\");\n // if it's only a single element, just copy the contents into li\n if (fragment.firstElementChild === fragment.lastElementChild) {\n li.append(...fragment.firstElementChild.childNodes);\n // Otherwise, take everything.\n } else {\n li.appendChild(fragment);\n }\n ol.appendChild(li);\n }\n ui.freshModal(title, ol, button);\n });\n const ariaMap = new Map([\n [\"expanded\", \"false\"],\n [\"haspopup\", \"true\"],\n [\"controls\", `respec-pill-${butName}-modal`],\n ]);\n ariaDecorate(button, ariaMap);\n return button;\n}\n\nexport const ui = {\n show() {\n try {\n respecUI.hidden = false;\n } catch (err) {\n console.error(err);\n }\n },\n hide() {\n respecUI.hidden = true;\n },\n enable() {\n respecPill.removeAttribute(\"disabled\");\n },\n /**\n * @param {string} _keyShort shortcut key. unused - kept for backward compatibility.\n */\n addCommand(label, handler, _keyShort, icon) {\n icon = icon || \"\";\n const id = `respec-button-${label.toLowerCase().replace(/\\s+/, \"-\")}`;\n const button = html`<button id=\"${id}\" class=\"respec-option\">\n <span class=\"respec-cmd-icon\" aria-hidden=\"true\">${icon}</span> ${label}ā€¦\n </button>`;\n const menuItem = html`<li role=\"menuitem\">${button}</li>`;\n menuItem.addEventListener(\"click\", handler);\n menu.appendChild(menuItem);\n return button;\n },\n error(rsError) {\n errWarn(rsError, errors, \"error\", \"ReSpec Errors\");\n },\n warning(rsError) {\n errWarn(rsError, warnings, \"warning\", \"ReSpec Warnings\");\n },\n closeModal(owner) {\n if (overlay) {\n overlay.classList.remove(\"respec-show-overlay\");\n overlay.classList.add(\"respec-hide-overlay\");\n overlay.addEventListener(\"transitionend\", () => {\n overlay.remove();\n overlay = null;\n });\n }\n if (owner) {\n owner.setAttribute(\"aria-expanded\", \"false\");\n }\n if (!modal) return;\n modal.remove();\n modal = null;\n respecPill.focus();\n },\n freshModal(title, content, currentOwner) {\n if (modal) modal.remove();\n if (overlay) overlay.remove();\n overlay = html`<div id=\"respec-overlay\" class=\"removeOnSave\"></div>`;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`<div\n id=\"${id}\"\n class=\"respec-modal removeOnSave\"\n role=\"dialog\"\n aria-labelledby=\"${headingId}\"\n >\n ${closeButton}\n <h3 id=\"${headingId}\">${title}</h3>\n <div class=\"inside\">${content}</div>\n </div>`;\n const ariaMap = new Map([[\"labelledby\", headingId]]);\n ariaDecorate(modal, ariaMap);\n document.body.append(overlay, modal);\n overlay.addEventListener(\"click\", () => this.closeModal(currentOwner));\n overlay.classList.toggle(\"respec-show-overlay\");\n modal.hidden = false;\n trapFocus(modal);\n },\n};\ndocument.addEventListener(\"keydown\", ev => {\n if (ev.key === \"Escape\") {\n ui.closeModal();\n }\n});\nwindow.respecUI = ui;\nsub(\"error\", details => ui.error(details));\nsub(\"warn\", details => ui.warning(details));\n\nfunction rsErrorToHTML(err) {\n if (typeof err === \"string\") {\n return err;\n }\n\n const plugin = err.plugin\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${xmlEscape(err.message)}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\n}\n","import { runAll } from \"./core/base-runner.js\";\nimport { ui } from \"./core/ui.js\";\n\n// In case everything else fails, we want the error\nwindow.addEventListener(\"error\", ev => {\n console.error(ev.error, ev.message, ev);\n});\n\nexport async function run(plugins) {\n try {\n ui.show();\n await domReady();\n await runAll(plugins);\n } finally {\n ui.enable();\n }\n}\n\nasync function domReady() {\n if (document.readyState === \"loading\") {\n await new Promise(resolve =>\n document.addEventListener(\"DOMContentLoaded\", resolve)\n );\n }\n}\n","import * as ReSpec from \"../src/respec.js\";\n\nconst modules = [\n // order is significant\n import(\"../src/core/location-hash.js\"),\n import(\"../src/core/l10n.js\"),\n import(\"../src/w3c/group.js\"),\n import(\"../src/w3c/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/w3c/style.js\"),\n import(\"../src/core/github.js\"),\n import(\"../src/core/data-include.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/core/reindent.js\"),\n import(\"../src/core/title.js\"),\n import(\"../src/w3c/level.js\"),\n import(\"../src/w3c/headers.js\"),\n import(\"../src/w3c/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/w3c/conformance.js\"),\n import(\"../src/core/dfn.js\"),\n import(\"../src/core/pluralize.js\"),\n import(\"../src/core/examples.js\"),\n import(\"../src/core/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n import(\"../src/core/tables.js\"),\n import(\"../src/core/webidl.js\"),\n import(\"../src/core/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/xref.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/dfn-index.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/webidl-index.js\"),\n import(\"../src/core/structure.js\"),\n import(\"../src/core/informative.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/core/caniuse.js\"),\n import(\"../src/core/mdn-annotation.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/search-specref.js\"),\n import(\"../src/ui/search-xref.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/w3c/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/webidl-clipboard.js\"),\n import(\"../src/core/data-tests.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n import(\"../src/core/web-monetization.js\"),\n import(\"../src/core/dfn-contract.js\"),\n import(\"../src/core/before-save.js\"),\n /* Linters must be the last thing to run */\n import(\"../src/core/linter-rules/check-charset.js\"),\n import(\"../src/core/linter-rules/check-punctuation.js\"),\n import(\"../src/core/linter-rules/check-internal-slots.js\"),\n import(\"../src/core/linter-rules/local-refs-exist.js\"),\n import(\"../src/core/linter-rules/no-captionless-tables.js\"),\n import(\"../src/core/linter-rules/no-unused-dfns.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/w3c/linter-rules/required-sections.js\"),\n import(\"../src/core/linter-rules/wpt-tests-exist.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n import(\"../src/core/linter-rules/a11y.js\"),\n import(\"../src/core/linter-rules/informative-dfn.js\"),\n];\n\nPromise.all(modules)\n .then(plugins => ReSpec.run(plugins))\n .catch(err => console.error(err));\n","// @ts-check\n// Module core/location-hash\n// As ReSpec injects a bunch of stuff async, the scroll position is not always\n// at the right place when we are done processing. The purpose of this module\n// is to reset window's location hash, which will cause the browser to scroll\n// the window to the correct point in the document when processing is done.\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!window.location.hash) {\n return;\n }\n\n // We have to use .then() here because otherwise we would get stuck\n // awaiting this plugin to finish.\n document.respec.ready.then(() => {\n const hash = decodeURIComponent(window.location.hash).slice(1);\n\n let newHash = hash;\n /** @type {HTMLElement|null} */\n const element = document.getElementById(newHash);\n\n // Check if hash contains any non-word character.\n const isLegacyFrag = /\\W/.test(newHash);\n\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/speced/respec/issues/1353\n if (!element && isLegacyFrag) {\n const id = newHash\n // Replace all non-word characters with a dash.\n .replace(/[\\W]+/gim, \"-\")\n // Remove any leading dashes.\n .replace(/^-+/, \"\")\n // Remove any trailing dashes.\n .replace(/-+$/, \"\");\n\n /** @type {HTMLElement|null} */\n const updatedElement = document.getElementById(id);\n if (updatedElement) {\n newHash = id;\n }\n }\n window.location.hash = `#${newHash}`;\n });\n}\n","// @ts-check\n/**\n * @module w3c/group\n * The purpose of this module is to fetch and set the working group configuration details.\n */\nimport { docLink, fetchAndCache, showError } from \"../core/utils.js\";\n\nexport const name = \"w3c/group\";\n\nconst W3C_GROUPS_API = \"https://respec.org/w3c/groups/\";\n\n/**\n * Fetches the group configuration details and adds them to the document's configuration.\n * @param {Conf} conf The document configuration object.\n * @return {Promise<void>} Resolves after setting the group configuration details.\n */\nexport async function run(conf) {\n if (!conf.group) {\n return;\n }\n\n const { group } = conf;\n const groupDetails = Array.isArray(group)\n ? await getMultipleGroupDetails(group)\n : await getGroupDetails(group);\n Object.assign(conf, groupDetails);\n}\n\n/**\n * Fetches configuration details for multiple groups concurrently.\n * @param {string[]} groups An array of group identifiers.\n * @return {Promise<object>} Resolves to an object containing the configuration details for each group.\n */\nasync function getMultipleGroupDetails(groups) {\n const details = await Promise.all(groups.map(getGroupDetails));\n /** @type {{ [key in keyof GroupDetails]: GroupDetails[key][] }} */\n const result = {\n wg: [],\n wgId: [],\n wgURI: [],\n wgPatentURI: [],\n wgPatentPolicy: [],\n groupType: [],\n };\n for (const groupDetails of details.filter(Boolean)) {\n for (const key of Object.keys(result)) {\n result[key].push(groupDetails[key]);\n }\n }\n return result;\n}\n\n/**\n * Fetches configuration details for a single group.\n * @param {string} group A group identifier.\n * @return {Promise<GroupDetails|undefined>} Resolves to an object containing the group's configuration details, or undefined if the group could not be fetched.\n */\nasync function getGroupDetails(group) {\n let type = \"\";\n let shortname = group;\n if (group.includes(\"/\")) {\n [type, shortname] = group.split(\"/\", 2);\n }\n const url = new URL(`${shortname}/${type}`, W3C_GROUPS_API);\n const res = await fetchAndCache(url.href);\n if (res.ok) {\n const json = await res.json();\n const {\n id: wgId,\n name: wg,\n patentURI: wgPatentURI,\n patentPolicy: wgPatentPolicy,\n type: groupType,\n wgURI,\n } = json;\n return { wg, wgId, wgURI, wgPatentURI, wgPatentPolicy, groupType };\n }\n\n const text = await res.text();\n let message = `Failed to fetch group details (HTTP: ${res.status}).`;\n let hint;\n if (res.status === 409) {\n [message, hint] = text.split(\"\\n\", 2);\n } else if (res.status === 404) {\n hint = docLink`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${\"[group]\"} configuration option.`;\n }\n showError(message, name, { hint });\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"core/templates/show-link\";\n\n/**\n * @param {object} link\n * @param {string} link.key\n * @param {string} [link.class]\n * @param {LinkData[]} [link.data]\n */\nexport default function showLink(link) {\n if (!link.key) {\n const msg =\n \"Found a link without `key` attribute in the configuration. See dev console.\";\n showWarning(msg, name);\n console.warn(msg, link);\n return;\n }\n return html`\n <dt class=\"${link.class ? link.class : null}\">${link.key}</dt>\n ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n `;\n}\n\n/**\n * @typedef {object} LinkData\n * @property {string} [LinkData.class]\n * @property {string} [LinkData.href]\n * @property {string} [LinkData.value]\n * @param {LinkData} data\n */\nfunction showLinkData(data) {\n return html`<dd class=\"${data.class ? data.class : null}\">\n ${data.href\n ? html`<a href=\"${data.href}\">${data.value || data.href}</a>`\n : data.value}\n </dd>`;\n}\n","// @ts-check\nimport { docLink, showError } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst name = \"core/templates/show-logo\";\n\n/**\n * Logo mapper. Takes a logo structure and converts it to HTML.\n *\n * @param {object} logo\n * @param {string} logo.src\n * @param {string} logo.url\n * @param {string} logo.alt\n * @param {string} [logo.id]\n * @param {number} [logo.width]\n * @param {number} [logo.height]\n * @param {number} index\n */\nexport default function showLogo(logo, index) {\n /** @type {HTMLAnchorElement} */\n const a = html`<a href=\"${logo.url || null}\" class=\"logo\"\n ><img\n alt=\"${logo.alt || null}\"\n crossorigin\n height=\"${logo.height || null}\"\n id=\"${logo.id || null}\"\n src=\"${logo.src || null}\"\n width=\"${logo.width || null}\"\n />\n </a>`;\n if (!logo.alt) {\n const src = logo.src ? `, with \\`src\\` ${logo.src}, ` : \"\";\n const msg = `Logo at index ${index}${src} is missing required \"\\`alt\\`\" property.`;\n const hint = docLink`Add the missing \"\\`alt\\`\" property describing the logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n if (!logo.src) {\n const msg = `Logo at index ${index} is missing \"\\`src\\`\" property.`;\n const hint = docLink`The \\`src\\` property is required on every logo. See ${\"[logos]\"} for more information.`;\n showError(msg, name, { hint, elements: [a] });\n }\n return a;\n}\n","// @ts-check\n\nconst name = \"core/templates/show-people\";\n\nimport {\n W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nconst localizationStrings = {\n en: {\n until(date) {\n return html` Until ${date} `;\n },\n },\n es: {\n until(date) {\n return html` Hasta ${date} `;\n },\n },\n ko: {\n until(date) {\n return html` ${date} ģ“ģ „ `;\n },\n },\n ja: {\n until(date) {\n return html` ${date} 仄前 `;\n },\n },\n de: {\n until(date) {\n return html` bis ${date} `;\n },\n },\n zh: {\n until(date) {\n return html` ē›“到 ${date} `;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst orcidIcon = () =>\n html`<svg\n width=\"16\"\n height=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n >\n <style>\n .st1 {\n fill: #fff;\n }\n </style>\n <path\n d=\"M256 128c0 70.7-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0s128 57.3 128 128z\"\n fill=\"#a6ce39\"\n />\n <path\n class=\"st1\"\n d=\"M86.3 186.2H70.9V79.1h15.4v107.1zM108.9 79.1h41.6c39.6 0 57 28.3 57 53.6 0 27.5-21.5 53.6-56.8 53.6h-41.8V79.1zm15.4 93.3h24.5c34.9 0 42.9-26.5 42.9-39.7C191.7 111.2 178 93 148 93h-23.7v79.4zM88.7 56.8c0 5.5-4.5 10.1-10.1 10.1s-10.1-4.6-10.1-10.1c0-5.6 4.5-10.1 10.1-10.1s10.1 4.6 10.1 10.1z\"\n />\n </svg>`;\n\n/**\n * @param {Conf} conf\n * @param {\"editors\" | \"authors\" | \"formerEditors\"} propName - the name of the property of the people to render.\n */\nexport default function showPeople(conf, propName) {\n const people = conf[propName];\n if (!Array.isArray(people) || !people.length) return; // nothing to show...\n\n const validatePerson = personValidator(propName);\n return people.filter(validatePerson).map(personToHTML);\n}\n\n/**\n * @param {Person} person\n */\nfunction personToHTML(person) {\n // The following are treated as opt-in HTML by hyperHTML\n // we need to deprecate this!\n const personName = [person.name];\n const company = [person.company];\n const editorId = person.w3cid || null;\n const contents = [];\n if (person.mailto) {\n person.url = `mailto:${person.mailto}`;\n }\n if (person.url) {\n const url = new URL(person.url, document.location.href);\n const classList =\n url.protocol === \"mailto:\"\n ? \"ed_mailto u-email email p-name\"\n : \"u-url url p-name fn\";\n contents.push(\n html`<a class=\"${classList}\" href=\"${person.url}\">${personName}</a>`\n );\n } else {\n contents.push(html`<span class=\"p-name fn\">${personName}</span>`);\n }\n if (person.orcid) {\n contents.push(\n html`<a class=\"p-name orcid\" href=\"${person.orcid}\">${orcidIcon()}</a>`\n );\n }\n if (person.company) {\n const hCard = \"p-org org h-org\";\n const companyElem = person.companyURL\n ? html`<a class=\"${hCard}\" href=\"${person.companyURL}\">${company}</a>`\n : html`<span class=\"${hCard}\">${company}</span>`;\n contents.push(html` (${companyElem})`);\n }\n if (person.note) {\n contents.push(document.createTextNode(` (${person.note})`));\n }\n if (person.extras) {\n contents.push(...person.extras.map(extra => html`, ${renderExtra(extra)}`));\n }\n const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(retiredDate))}</time\n >`;\n contents.push(html` - ${l10n.until(time)} `);\n }\n const dd = html`<dd\n class=\"editor p-author h-card vcard\"\n data-editor-id=\"${editorId}\"\n >\n ${contents}\n </dd>`;\n return dd;\n}\n\nfunction renderExtra(extra) {\n const classVal = extra.class || null;\n const { name, href } = extra;\n return href\n ? html`<a href=\"${href}\" class=\"${classVal}\">${name}</a>`\n : html`<span class=\"${classVal}\">${name}</span>`;\n}\n\n/**\n *\n * @param {string} prop\n */\nfunction personValidator(prop) {\n /**\n * @param {Person} person\n * @param {Number} index\n */\n return function validatePerson(person, index) {\n const docsUrl = \"https://respec.org/docs/\";\n const seePersonHint = `See [person](${docsUrl}#person) configuration for available options.`;\n const preamble =\n `Error processing the [person object](${docsUrl}#person) ` +\n `at index ${index} of the \"[\\`${prop}\\`](${docsUrl}#${prop})\" configuration option.`;\n\n if (!person.name) {\n const msg = `${preamble} Missing required property \\`\"name\"\\`.`;\n showError(msg, name, { hint: seePersonHint });\n return false;\n }\n\n if (person.orcid) {\n const { orcid } = person;\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n\n if (orcidUrl.origin !== \"https://orcid.org\") {\n const msg = `${preamble} ORCID \"${person.orcid}\" at index ${index} is invalid.`;\n const hint = `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`;\n showError(msg, name, { hint });\n return false;\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n const msg = `${preamble} ORCID \"${orcidId}\" has wrong format.`;\n const hint = `ORCIDs have the format \"1234-1234-1234-1234.\"`;\n showError(msg, name, { hint });\n return false;\n }\n\n if (!checkOrcidChecksum(orcid)) {\n const msg = `${preamble} ORCID \"${orcid}\" failed checksum check.`;\n const hint = \"Please check that the ORCID is valid.\";\n showError(msg, name, { hint });\n return false;\n }\n\n // canonical form\n person.orcid = orcidUrl.href;\n }\n\n if (person.retiredDate && !isValidConfDate(person.retiredDate)) {\n const msg = `${preamble} The property \"\\`retiredDate\\`\" is not a valid date.`;\n showError(msg, name, {\n hint: `The expected format is YYYY-MM-DD. ${seePersonHint}`,\n });\n return false;\n }\n\n if (\n person.hasOwnProperty(\"extras\") &&\n !validateExtras(person.extras, seePersonHint, preamble)\n ) {\n return false;\n }\n\n if (person.url && person.mailto) {\n const msg = `${preamble} Has both \"url\" and \"mailto\" property.`;\n showWarning(msg, name, {\n hint: `Please choose either \"url\" or \"mailto\" (\"url\" is preferred). ${seePersonHint}`,\n });\n }\n\n if (person.companyURL && !person.company) {\n const msg = `${preamble} Has a \"\\`companyURL\\`\" property but no \"\\`company\\`\" property.`;\n showWarning(msg, name, {\n hint: `Please add a \"\\`company\\`\" property. ${seePersonHint}.`,\n });\n }\n return true;\n };\n}\n\n/**\n *\n * @param {PersonExtras[]} extras\n * @param {string} hint\n * @param {string} preamble\n */\nfunction validateExtras(extras, hint, preamble) {\n if (!Array.isArray(extras)) {\n showError(\n `${preamble}. A person's \"extras\" member must be an array.`,\n name,\n { hint }\n );\n return false;\n }\n return extras.every((extra, index) => {\n switch (true) {\n case typeof extra !== \"object\":\n showError(\n `${preamble}. Member \"extra\" at index ${index} is not an object.`,\n name,\n {\n hint,\n }\n );\n return false;\n case !extra.hasOwnProperty(\"name\"):\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} is missing required \"name\" member.`,\n name,\n { hint }\n );\n return false;\n case typeof extra.name === \"string\" && extra.name.trim() === \"\":\n showError(\n `${preamble} \\`PersonExtra\\` object at index ${index} \"name\" can't be empty.`,\n name,\n { hint }\n );\n return false;\n }\n return true;\n });\n}\n\n/**\n * @param {string} orcid\n * @returns {boolean}\n */\nfunction checkOrcidChecksum(orcid) {\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcid[orcid.length - 1];\n const remainder = orcid\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n return lastDigit === lastDigitShould;\n}\n","// @ts-check\nimport { ISODate, W3CDate, getIntlData } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\nimport { sub } from \"../../core/pubsubhub.js\";\n\nconst localizationStrings = {\n en: {\n archives: \"archives\",\n author: \"Author:\",\n authors: \"Authors:\",\n commit_history: \"Commit history\",\n edited_in_place: \"edited in place\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n feedback: \"Feedback:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n history: \"History:\",\n implementation_report: \"Implementation report:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest published version:\",\n latest_recommendation: \"Latest Recommendation:\",\n message_topic: \"ā€¦ message topic ā€¦\",\n more_details_about_this_doc: \"More details about this document\",\n multiple_alternates(plural) {\n return `This document is also available in ${\n plural ? \"these non-normative formats\" : \"this non-normative format\"\n }:`;\n },\n prev_editor_draft: \"Previous editor's draft:\",\n prev_recommendation: \"Previous Recommendation:\",\n prev_version: \"Previous version:\",\n publication_history: \"Publication history\",\n test_suite: \"Test suite:\",\n this_version: \"This version:\",\n with_subject_line: \"with subject line\",\n your_topic_here: \"YOUR TOPIC HERE\",\n },\n ko: {\n author: \"ģ €ģž:\",\n authors: \"ģ €ģž:\",\n editor: \"ķŽøģ§‘ģž:\",\n editors: \"ķŽøģ§‘ģž:\",\n former_editor: \"ģ“ģ „ ķŽøģ§‘ģž:\",\n former_editors: \"ģ“ģ „ ķŽøģ§‘ģž:\",\n latest_editors_draft: \"ģµœģ‹  ķŽøģ§‘ ģ“ˆģ•ˆ:\",\n latest_published_version: \"ģµœģ‹  ė²„ģ „:\",\n this_version: \"ķ˜„ģž¬ ė²„ģ „:\",\n },\n zh: {\n author: \"ä½œč€…ļ¼š\",\n authors: \"ä½œč€…ļ¼š\",\n commit_history: \"Gitꏐäŗ¤åŽ†å²\",\n editor: \"ē¼–č¾‘ļ¼š\",\n editors: \"ē¼–č¾‘ļ¼š\",\n feedback: \"反馈ļ¼š\",\n former_editor: \"原ē¼–č¾‘ļ¼š\",\n former_editors: \"原ē¼–č¾‘ļ¼š\",\n history: \"历史ļ¼š\",\n implementation_report: \"实ēŽ°ęŠ„告ļ¼š\",\n latest_editors_draft: \"꜀ꖰē¼–č¾‘č‰ēØæļ¼š\",\n latest_published_version: \"ęœ€ę–°å‘åøƒē‰ˆęœ¬ļ¼š\",\n latest_recommendation: \"ęœ€ę–°å‘åøƒēš„ę­£å¼ęŽØčę ‡å‡†ļ¼š\",\n message_topic: \"ā€¦ 邮件äø»é¢˜ ā€¦\",\n prev_editor_draft: \"äøŠäø€ē‰ˆē¼–č¾‘č‰ēØæļ¼š\",\n prev_recommendation: \"äøŠäø€ē‰ˆę­£å¼ęŽØčę ‡å‡†ļ¼š\",\n prev_version: \"äøŠäø€ē‰ˆļ¼š\",\n test_suite: \"굋čƕ儗件ļ¼š\",\n this_version: \"ęœ¬ē‰ˆęœ¬ļ¼š\",\n },\n ja: {\n archives: \"ć‚¢ćƒ¼ć‚«ć‚¤ćƒ–\",\n author: \"著者ļ¼š\",\n authors: \"著者ļ¼š\",\n commit_history: \"ę›“ę–°å±„ę­“\",\n edited_in_place: \"ę”¹ē‰ˆćŖćę›“ę–°\",\n editor: \"ē·Ø者ļ¼š\",\n editors: \"ē·Ø者ļ¼š\",\n feedback: \"ćƒ•ć‚£ćƒ¼ćƒ‰ćƒćƒƒć‚Æ:\",\n former_editor: \"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š\",\n former_editors: \"ä»„å‰ć®ē‰ˆć®ē·Ø者ļ¼š\",\n history: \"å±„ę­“:\",\n implementation_report: \"å®Ÿč£…ćƒ¬ćƒćƒ¼ćƒˆļ¼š\",\n latest_editors_draft: \"ęœ€ę–°ć®ē·Ø集ē”Øč‰ę”ˆļ¼š\",\n latest_published_version: \"ęœ€ę–°ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š\",\n latest_recommendation: \"ęœ€ę–°ć®å‹§å‘Šē‰ˆ:\",\n message_topic: \"ā€¦ ćƒ”ćƒ¼ćƒ«ä»¶å ā€¦\",\n more_details_about_this_doc: \"恓恮ꖇę›øć«ć¤ć„ć¦ć®ć‚ˆć‚Šč©³ē“°\",\n prev_editor_draft: \"å‰å›žć®ē·Ø集ē”Øč‰ę”ˆ:\",\n prev_recommendation: \"å‰å›žć®å‹§å‘Šē‰ˆ:\",\n prev_version: \"å‰å›žć®ćƒćƒ¼ć‚øćƒ§ćƒ³:\",\n publication_history: \"公č”Øå±„ę­“\",\n test_suite: \"ćƒ†ć‚¹ćƒˆć‚¹ć‚¤ćƒ¼ćƒˆļ¼š\",\n this_version: \"ć“ć®ćƒćƒ¼ć‚øćƒ§ćƒ³ļ¼š\",\n with_subject_line: \"ę¬”ć®ä»¶åć§\",\n },\n nl: {\n author: \"Auteur:\",\n authors: \"Auteurs:\",\n editor: \"Redacteur:\",\n editors: \"Redacteurs:\",\n latest_editors_draft: \"Laatste werkversie:\",\n latest_published_version: \"Laatst gepubliceerde versie:\",\n this_version: \"Deze versie:\",\n },\n es: {\n archives: \"archivos\",\n author: \"Autor:\",\n authors: \"Autores:\",\n commit_history: \"Historial de cambios\",\n edited_in_place: \"editado en lugar\",\n editor: \"Editor:\",\n editors: \"Editores:\",\n feedback: \"Comentarios:\",\n former_editor: \"Antiguo editor:\",\n former_editors: \"Antiguos editores:\",\n history: \"Historia:\",\n implementation_report: \"Informe de implementaciĆ³n:\",\n latest_editors_draft: \"ƚltima versiĆ³n del editor:\",\n latest_published_version: \"ƚltima versiĆ³n publicada:\",\n latest_recommendation: \"RecomendaciĆ³n mĆ”s reciente:\",\n message_topic: \"ā€¦ detalles de mensaje ā€¦\",\n more_details_about_this_doc: \"MĆ”s detalles sobre este documento:\",\n publication_history: \"Historial de publicaciĆ³n\",\n prev_editor_draft: \"ƚltima versiĆ³n del editor:\",\n prev_recommendation: \"ƚltima RecomendaciĆ³n:\",\n prev_version: \"ƚltima versiĆ³n:\",\n test_suite: \"Suite de pruebas:\",\n this_version: \"Esta versiĆ³n:\",\n with_subject_line: \"con lĆ­nea de asunto\",\n your_topic_here: \"TU SUJETO AQUƍ\",\n },\n de: {\n archives: \"Archiv\",\n author: \"Autor/in:\",\n authors: \"Autor/innen:\",\n commit_history: \"Commit-Historie\",\n edited_in_place: \"zuletzt geƤndert am\",\n editor: \"Redaktion:\",\n editors: \"Redaktion:\",\n feedback: \"Feedback:\",\n former_editor: \"FrĆ¼here Mitwirkende:\",\n former_editors: \"FrĆ¼here Mitwirkende:\",\n history: \"Verlauf:\",\n implementation_report: \"Umsetzungsbericht:\",\n latest_editors_draft: \"Letzter Entwurf:\",\n latest_published_version: \"Letzte publizierte Fassung:\",\n latest_recommendation: \"Aktuellste Empfehlung:\",\n more_details_about_this_doc: \"Mehr Informationen Ć¼ber dieses Dokument\",\n multiple_alternates(plural) {\n return `Dieses Dokument ist ebenfalls in ${\n plural\n ? \"diesen nicht-normativen Formaten verfĆ¼gbar\"\n : \"diesem nicht-normativen Format verfĆ¼gbar\"\n }:`;\n },\n prev_editor_draft: \"Vorheriger Entwurf:\",\n prev_recommendation: \"Vorherige Empfehlung:\",\n prev_version: \"Vorherige Version:\",\n publication_history: \"Verƶffentlichungsverlauf\",\n test_suite: \"Testumgebung:\",\n this_version: \"Diese Fassung:\",\n },\n};\nexport const l10n = getIntlData(localizationStrings);\n\nexport function getSpecSubTitleElem(conf) {\n let specSubTitleElem = document.querySelector(\"h2#subtitle\");\n\n if (specSubTitleElem && specSubTitleElem.parentElement) {\n specSubTitleElem.remove();\n conf.subtitle = specSubTitleElem.textContent.trim();\n } else if (conf.subtitle) {\n specSubTitleElem = document.createElement(\"h2\");\n specSubTitleElem.textContent = conf.subtitle;\n specSubTitleElem.id = \"subtitle\";\n }\n if (specSubTitleElem) {\n specSubTitleElem.classList.add(\"subtitle\");\n }\n return specSubTitleElem;\n}\n\nexport default (conf, options) => {\n /**\n * After export, we let fixup.js handle the <details>.\n */\n sub(\"beforesave\", doc => {\n const details = doc.querySelector(\".head details\");\n if (details) details.open = true;\n });\n return html`<div class=\"head\">\n ${conf.logos.length\n ? html`<p class=\"logos\">${conf.logos.map(showLogo)}</p>`\n : \"\"}\n ${document.querySelector(\"h1#title\")} ${getSpecSubTitleElem(conf)}\n <p id=\"w3c-state\">${renderSpecTitle(conf)}</p>\n <details open=\"${localStorage.getItem(\"tr-metadata\") || \"true\"}\">\n <summary>${l10n.more_details_about_this_doc}</summary>\n <dl>\n ${conf.thisVersion\n ? html`<dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>`\n : \"\"}\n ${\"latestVersion\" in conf // latestVersion can be falsy\n ? html`<dt>${l10n.latest_published_version}</dt>\n <dd>\n ${conf.latestVersion\n ? html`<a href=\"${conf.latestVersion}\"\n >${conf.latestVersion}</a\n >`\n : \"none\"}\n </dd>`\n : \"\"}\n ${conf.edDraftURI\n ? html`\n <dt>${l10n.latest_editors_draft}</dt>\n <dd><a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a></dd>\n `\n : \"\"}\n ${conf.historyURI || conf.github\n ? html`<dt>${l10n.history}</dt>\n ${conf.historyURI\n ? html`<dd>\n <a href=\"${conf.historyURI}\">${conf.historyURI}</a>\n </dd>`\n : \"\"}\n ${conf.github\n ? html`<dd>\n <a href=\"${conf.github.commitHistoryURL}\"\n >${l10n.commit_history}</a\n >\n </dd>`\n : \"\"}`\n : \"\"}\n ${conf.testSuiteURI\n ? html`\n <dt>${l10n.test_suite}</dt>\n <dd><a href=\"${conf.testSuiteURI}\">${conf.testSuiteURI}</a></dd>\n `\n : \"\"}\n ${conf.implementationReportURI\n ? html`\n <dt>${l10n.implementation_report}</dt>\n <dd>\n <a href=\"${conf.implementationReportURI}\"\n >${conf.implementationReportURI}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.prevED\n ? html`\n <dt>${l10n.prev_editor_draft}</dt>\n <dd><a href=\"${conf.prevED}\">${conf.prevED}</a></dd>\n `\n : \"\"}\n ${conf.showPreviousVersion\n ? html`\n <dt>${l10n.prev_version}</dt>\n <dd><a href=\"${conf.prevVersion}\">${conf.prevVersion}</a></dd>\n `\n : \"\"}\n ${!conf.prevRecURI\n ? \"\"\n : conf.isRec\n ? html`\n <dt>${l10n.prev_recommendation}</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `\n : html`\n <dt>${l10n.latest_recommendation}</dt>\n <dd><a href=\"${conf.prevRecURI}\">${conf.prevRecURI}</a></dd>\n `}\n ${conf.editors.length\n ? html`\n <dt>${conf.editors.length > 1 ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n `\n : \"\"}\n ${conf.formerEditors.length\n ? html`\n <dt>\n ${conf.formerEditors.length > 1\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors.length\n ? html`\n <dt>${conf.authors.length > 1 ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.github || conf.wgPublicList\n ? html`<dt>${l10n.feedback}</dt>\n ${renderFeedback(conf)}`\n : \"\"}\n ${conf.errata\n ? html`<dt>Errata:</dt>\n <dd><a href=\"${conf.errata}\">Errata exists</a>.</dd>`\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n </details>\n ${conf.isRec\n ? html`<p>\n See also\n <a\n href=\"${`https://www.w3.org/Translations/?technology=${conf.shortName}`}\"\n >\n <strong>translations</strong></a\n >.\n </p>`\n : \"\"}\n ${conf.alternateFormats\n ? html`<p>\n ${l10n.multiple_alternates(options.multipleAlternates)}\n ${options.alternatesHTML}\n </p>`\n : \"\"}\n ${renderCopyright(conf)}\n <hr title=\"Separator for header\" />\n </div>`;\n};\n\nexport function renderFeedback(conf) {\n const definitions = [];\n // Github feedback...\n if (conf.github) {\n const { repoURL, issuesURL, newIssuesURL, pullsURL, fullName } =\n conf.github;\n definitions.push(\n html`<dd>\n <a href=\"${repoURL}\">GitHub ${fullName}</a>\n (<a href=\"${pullsURL}\">pull requests</a>,\n <a href=\"${newIssuesURL}\">new issue</a>,\n <a href=\"${issuesURL}\">open issues</a>)\n </dd>`\n );\n }\n\n // The <a href=\"mailto:list?subject\"> link for the public list\n if (conf.wgPublicList) {\n const mailToURL = new URL(`mailto:${conf.wgPublicList}@w3.org`);\n const subject =\n conf.subjectPrefix ?? `[${conf.shortName}] ${l10n.your_topic_here}`;\n const mailingListLink = html`<a\n href=\"${mailToURL.href}?subject=${encodeURIComponent(subject)}\"\n >${mailToURL.pathname}</a\n >`;\n\n // The subject line...\n const subjectLine =\n conf.subjectPrefix ||\n html`[${conf.shortName}] <em>${l10n.message_topic}</em>`;\n const emailSubject = html`${l10n.with_subject_line}${\" \"}\n <kbd>${subjectLine}</kbd>`;\n\n // Archives link\n const archiveURL = new URL(\n conf.wgPublicList,\n \"https://lists.w3.org/Archives/Public/\"\n );\n const archiveLink = html`(<a href=\"${archiveURL}\" rel=\"discussion\"\n >${l10n.archives}</a\n >)`;\n\n definitions.push(\n html`<dd>${mailingListLink} ${emailSubject} ${archiveLink}</dd>`\n );\n }\n return definitions;\n}\n\nfunction renderSpecTitle(conf) {\n const specType = conf.isCR || conf.isCRY ? conf.longStatus : conf.textStatus;\n const preamble = conf.prependW3C\n ? html`<a href=\"https://www.w3.org/standards/types#${conf.specStatus}\"\n >W3C ${specType}</a\n >`\n : html`${specType}`;\n return html`${preamble}${\" \"}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${W3CDate.format(conf.publishDate)}</time\n >${conf.modificationDate\n ? html`, ${l10n.edited_in_place}${\" \"}\n <time\n class=\"dt-modified\"\n datetime=\"${ISODate.format(conf.modificationDate)}\"\n >${W3CDate.format(conf.modificationDate)}</time\n >`\n : \"\"}`;\n}\n\n/**\n * @param { LicenseInfo } licenseInfo license information\n */\nfunction linkLicense(licenseInfo) {\n const { url, short, name } = licenseInfo;\n if (name === \"unlicensed\") {\n return html`. <span class=\"issue\">THIS DOCUMENT IS UNLICENSED</span>.`;\n }\n return html` and\n <a rel=\"license\" href=\"${url}\" title=\"${name}\">${short}</a> rules apply.`;\n}\n\nfunction renderCopyright(conf) {\n // If there is already a copyright, let's relocate it.\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n return existingCopyright;\n }\n if (conf.isUnofficial && conf.licenseInfo) {\n return html`<p class=\"copyright\">\n Copyright ©\n ${conf.copyrightStart ? `${conf.copyrightStart}-` : \"\"}${conf.publishYear}\n the document editors/authors.\n ${conf.licenseInfo.name !== \"unlicensed\"\n ? html`Text is available under the\n <a rel=\"license\" href=\"${conf.licenseInfo.url}\"\n >${conf.licenseInfo.name}</a\n >; additional terms may apply.`\n : \"\"}\n </p>`;\n }\n return renderOfficialCopyright(conf);\n}\n\nfunction renderOfficialCopyright(conf) {\n return html`<p class=\"copyright\">\n <a href=\"https://www.w3.org/policies/#copyright\">Copyright</a>\n ©\n ${conf.copyrightStart ? `${conf.copyrightStart}-` : \"\"}${conf.publishYear}\n ${conf.additionalCopyrightHolders\n ? html` ${[conf.additionalCopyrightHolders]} & `\n : \"\"}\n <a href=\"https://www.w3.org/\">World Wide Web Consortium</a>.\n <abbr title=\"World Wide Web Consortium\">W3C</abbr><sup>®</sup>\n <a href=\"https://www.w3.org/policies/#Legal_Disclaimer\">liability</a>,\n <a href=\"https://www.w3.org/policies/#W3C_Trademarks\">trademark</a\n >${linkLicense(conf.licenseInfo)}\n </p>`;\n}\n","// @ts-check\nimport { getSpecSubTitleElem, l10n, renderFeedback } from \"./headers.js\";\nimport { W3CDate } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport showLink from \"../../core/templates/show-link.js\";\nimport showLogo from \"../../core/templates/show-logo.js\";\nimport showPeople from \"../../core/templates/show-people.js\";\n\nexport default (conf, options) => {\n const existingCopyright = document.querySelector(\".copyright\");\n if (existingCopyright) {\n existingCopyright.remove();\n }\n\n const specTitleElem = document.querySelector(\"h1#title\");\n const specTitleElemClone = specTitleElem.cloneNode(true);\n\n return html`<div class=\"head\">\n ${conf.logos.length\n ? html`<p class=\"logos\">${conf.logos.map(showLogo)}</p>`\n : \"\"}\n ${specTitleElem} ${getSpecSubTitleElem(conf)}\n <p id=\"w3c-state\">\n <a href=\"https://www.w3.org/standards/types#reports\"\n >${conf.longStatus}</a\n >\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${W3CDate.format(conf.publishDate)}</time\n >\n </p>\n <dl>\n ${conf.thisVersion\n ? html`<dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>`\n : \"\"}\n ${\"latestVersion\" in conf // latestVersion can be falsy\n ? html`<dt>${l10n.latest_published_version}</dt>\n <dd>\n ${conf.latestVersion\n ? html`<a href=\"${conf.latestVersion}\"\n >${conf.latestVersion}</a\n >`\n : \"none\"}\n </dd>`\n : \"\"}\n ${conf.edDraftURI\n ? html`\n <dt>${l10n.latest_editors_draft}</dt>\n <dd><a href=\"${conf.edDraftURI}\">${conf.edDraftURI}</a></dd>\n `\n : \"\"}\n ${conf.testSuiteURI\n ? html`\n <dt>Test suite:</dt>\n <dd><a href=\"${conf.testSuiteURI}\">${conf.testSuiteURI}</a></dd>\n `\n : \"\"}\n ${conf.implementationReportURI\n ? html`\n <dt>Implementation report:</dt>\n <dd>\n <a href=\"${conf.implementationReportURI}\"\n >${conf.implementationReportURI}</a\n >\n </dd>\n `\n : \"\"}\n ${conf.prevVersion\n ? html`\n <dt>Previous version:</dt>\n <dd><a href=\"${conf.prevVersion}\">${conf.prevVersion}</a></dd>\n `\n : \"\"}\n ${!conf.isCGFinal\n ? html`\n ${conf.prevED\n ? html`\n <dt>Previous editor's draft:</dt>\n <dd><a href=\"${conf.prevED}\">${conf.prevED}</a></dd>\n `\n : \"\"}\n `\n : \"\"}\n ${conf.editors.length\n ? html`\n <dt>${conf.editors.length > 1 ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n `\n : \"\"}\n ${conf.formerEditors.length\n ? html`\n <dt>\n ${conf.formerEditors.length > 1\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors.length\n ? html`\n <dt>${conf.authors.length > 1 ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.github || conf.wgPublicList\n ? html`<dt>${l10n.feedback}</dt>\n ${renderFeedback(conf)}`\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n ${conf.alternateFormats\n ? html`<p>\n ${options.multipleAlternates\n ? \"This document is also available in these non-normative formats:\"\n : \"This document is also available in this non-normative format:\"}\n ${options.alternatesHTML}\n </p>`\n : \"\"}\n ${existingCopyright\n ? existingCopyright\n : html`<p class=\"copyright\">\n <a href=\"https://www.w3.org/policies/#copyright\">Copyright</a>\n ©\n ${conf.copyrightStart\n ? `${conf.copyrightStart}-`\n : \"\"}${conf.publishYear}\n ${conf.additionalCopyrightHolders\n ? html` ${[conf.additionalCopyrightHolders]} & `\n : \"\"}\n the Contributors to the ${specTitleElemClone.childNodes}\n Specification, published by the\n <a href=\"${conf.wgURI}\">${conf.wg}</a> under the\n ${conf.isCGFinal\n ? html`\n <a href=\"https://www.w3.org/community/about/agreements/fsa/\"\n >W3C Community Final Specification Agreement (FSA)</a\n >. A human-readable\n <a\n href=\"https://www.w3.org/community/about/agreements/fsa-deed/\"\n >summary</a\n >\n is available.\n `\n : html`\n <a href=\"https://www.w3.org/community/about/agreements/cla/\"\n >W3C Community Contributor License Agreement (CLA)</a\n >. A human-readable\n <a\n href=\"https://www.w3.org/community/about/agreements/cla-deed/\"\n >summary</a\n >\n is available.\n `}\n </p>`}\n <hr title=\"Separator for header\" />\n </div>`;\n};\n","// @ts-check\nimport { W3CDate, getIntlData, htmlJoinAnd } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport { status2track } from \"../headers.js\";\nconst localizationStrings = {\n en: {\n sotd: \"Status of This Document\",\n status_at_publication: html`This section describes the status of this\n document at the time of its publication. A list of current W3C\n publications and the latest revision of this technical report can be found\n in the <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> at\n https://www.w3.org/TR/.`,\n },\n ko: {\n sotd: \"ķ˜„ģž¬ ė¬øģ„œģ˜ ģƒķƒœ\",\n status_at_publication: html`ģ“ ė¶€ė¶„ģ€ ķ˜„ģž¬ ė¬øģ„œģ˜ ė°œķ–‰ ė‹¹ģ‹œ ģƒķƒœģ— ėŒ€ķ•“\n źø°ģˆ ķ•©ė‹ˆė‹¤. W3C ė°œķ–‰ ė¬øģ„œģ˜ ģµœģ‹  ėŖ©ė” ė° ķ…Œķ¬ė‹ˆģ»¬ ė¦¬ķ¬ķŠø ģµœģ‹ ķŒģ„\n https://www.w3.org/TR/ ģ˜\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> ģ—ģ„œ\n ģ—“ėžŒķ•  ģˆ˜ ģžˆģŠµė‹ˆė‹¤.`,\n },\n zh: {\n sotd: \"关äŗŽęœ¬ę–‡ę”£\",\n // eslint-disable-next-line prettier/prettier\n status_at_publication: html`ęœ¬ē« čŠ‚ꏏčæ°äŗ†ęœ¬ę–‡ę”£ēš„发åøƒēŠ¶ę€ć€‚W3Cēš„ę–‡ę”£åˆ—č”Øå’Œęœ€ę–°ē‰ˆęœ¬åÆ通čæ‡<a\n href=\"https://www.w3.org/TR/\"\n >W3CꊀęœÆęŠ„å‘Š</a\n >ē“¢å¼•č®æ问怂`,\n },\n ja: {\n sotd: \"恓恮ꖇę›øć®ä½ē½®ä»˜ć‘\",\n status_at_publication: html`恓恮ēÆ€ć«ćÆć€å…¬é–‹ę™‚ē‚¹ć§ć®ć“恮ꖇę›øć®ä½ē½®ć„恑恌čØ˜ć•ć‚Œć¦ć„ć‚‹ć€‚ē¾ę™‚ē‚¹ć§ć®W3C恮ē™ŗč”Œę–‡ę›øćØć“ć®ćƒ†ć‚Æćƒ‹ć‚«ćƒ«ćƒ¬ćƒćƒ¼ćƒˆć®ęœ€ę–°ē‰ˆćÆ态äø‹čØ˜ć‹ć‚‰å‚ē…§ć§ćć‚‹ć€‚\n <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a>\n (https://www.w3.org/TR/)`,\n },\n nl: {\n sotd: \"Status van dit document\",\n },\n es: {\n sotd: \"Estado de este Document\",\n status_at_publication: html`Esta secciĆ³n describe el estado del presente\n documento al momento de su publicaciĆ³n. Una lista de las publicaciones\n actuales del W3C y la Ćŗltima revisiĆ³n del presente informe tĆ©cnico puede\n hallarse en http://www.w3.org/TR/\n <a href=\"https://www.w3.org/TR/\">el Ć­ndice de informes tĆ©cnicos</a> del\n W3C.`,\n },\n de: {\n sotd: \"Status dieses Dokuments\",\n status_at_publication: html`Dieser Abschnitt beschreibt den Status des\n Dokuments zum Zeitpunkt der Publikation. Eine Liste der aktuellen\n Publikatinen des W3C und die aktuellste Fassung dieser Spezifikation kann\n im <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> unter\n https://www.w3.org/TR/ abgerufen werden.`,\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nconst processLink = \"https://www.w3.org/policies/process/20231103/\";\n\nfunction prefix(word) {\n return /^[aeiou]/i.test(word) ? `an ${word}` : `a ${word}`;\n}\n\nexport default (conf, opts) => {\n return html`\n <h2>${l10n.sotd}</h2>\n ${conf.isPreview ? renderPreview(conf) : \"\"}\n ${conf.isUnofficial\n ? renderIsUnofficial(opts)\n : conf.isTagFinding\n ? opts.additionalContent\n : conf.isNoTrack\n ? renderIsNoTrack(conf, opts)\n : html`\n <p><em>${l10n.status_at_publication}</em></p>\n ${conf.isMemberSubmission\n ? noteForSubmission(conf, opts)\n : html`\n ${!conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${!conf.overrideStatus\n ? html` ${linkToWorkingGroup(conf)} `\n : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${conf.isRec ? renderIsRec(conf) : renderNotRec(conf)}\n ${renderDeliverer(conf)}\n <p>\n This document is governed by the\n <a id=\"w3c_process_revision\" href=\"${processLink}\"\n >03 November 2023 W3C Process Document</a\n >.\n </p>\n `}\n `}\n ${opts.additionalSections}\n `;\n};\n\nexport function renderPreview(conf) {\n const { prUrl, prNumber, edDraftURI } = conf;\n return html`<details class=\"annoying-warning\" open=\"\">\n <summary>\n This is a\n preview${prUrl && prNumber\n ? html`\n of pull request\n <a href=\"${prUrl}\">#${prNumber}</a>\n `\n : \"\"}\n </summary>\n <p>\n Do not attempt to implement this version of the specification. Do not\n reference this version as authoritative in any way.\n ${edDraftURI\n ? html`\n Instead, see\n <a href=\"${edDraftURI}\">${edDraftURI}</a> for the Editor's draft.\n `\n : \"\"}\n </p>\n </details>`;\n}\n\nfunction renderIsUnofficial(opts) {\n const { additionalContent } = opts;\n return html`\n <p>\n This document is a draft of a potential specification. It has no official\n standing of any kind and does not represent the support or consensus of\n any standards organization.\n </p>\n ${additionalContent}\n `;\n}\n\nfunction renderIsNoTrack(conf, opts) {\n const { isMO } = conf;\n const { additionalContent } = opts;\n return html`\n <p>\n This document is merely a W3C-internal\n ${isMO ? \"member-confidential\" : \"\"} document. It has no official standing\n of any kind and does not represent consensus of the W3C Membership.\n </p>\n ${additionalContent}\n `;\n}\n\nfunction renderNotRec(conf) {\n const updatableRec = document.querySelector(\"#sotd.updateable-rec\");\n let statusExplanation = null;\n let reviewPolicy = null;\n let endorsement = html`Publication as ${prefix(conf.textStatus)} does not\n imply endorsement by W3C and its Members.`;\n let updatePolicy = html`<p>\n This is a draft document and may be updated, replaced or obsoleted by other\n documents at any time. It is inappropriate to cite this document as other\n than work in progress.\n ${updatableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}\n </p>`;\n if (conf.specStatus === \"DISC\") {\n updatePolicy = html`<p>\n Publication as a Discontinued Draft implies that this document is no\n longer intended to advance or to be maintained. It is inappropriate to\n cite this document as other than abandoned work.\n </p>`;\n }\n const lsUpdatePolicy = html`<p>\n This document is maintained and updated at any time. Some parts of this\n document are work in progress.\n </p>`;\n switch (conf.specStatus) {\n case \"STMT\":\n endorsement = html`<p>\n A W3C Statement is a specification that, after extensive\n consensus-building, has received the endorsement of the\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members.\n </p>`;\n break;\n case \"RY\":\n endorsement = html`<p>W3C recommends the wide usage of this registry.</p>\n <p>\n A W3C Registry is a specification that, after extensive\n consensus-building, has received the endorsement of the\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members.\n </p>`;\n break;\n case \"CRD\":\n statusExplanation = html`A Candidate Recommendation Draft integrates\n changes from the previous Candidate Recommendation that the Working Group\n intends to include in a subsequent Candidate Recommendation Snapshot.`;\n if (conf.pubMode === \"LS\") {\n updatePolicy = lsUpdatePolicy;\n }\n break;\n case \"CRYD\":\n statusExplanation = html`A Candidate Registry Draft integrates changes\n from the previous Candidate Registry Snapshot that the Working Group\n intends to include in a subsequent Candidate Registry Snapshot.`;\n if (conf.pubMode === \"LS\") {\n updatePolicy = lsUpdatePolicy;\n }\n break;\n case \"CRY\":\n statusExplanation = html`A Candidate Registry Snapshot has received\n <a href=\"${processLink}#dfn-wide-review\">wide review</a>.`;\n reviewPolicy = html`<p>\n The W3C Membership and other interested parties are invited to review\n the document and send comments through ${conf.humanPREnd}. Advisory\n Committee Representatives should consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >. Note that substantive technical comments were expected during the\n Candidate Recommendation review period that ended ${conf.humanCREnd}.\n </p>`;\n break;\n case \"CR\":\n statusExplanation = html`A Candidate Recommendation Snapshot has received\n <a href=\"${processLink}#dfn-wide-review\">wide review</a>, is intended to\n gather\n <a href=\"${conf.implementationReportURI}\">implementation experience</a>,\n and has commitments from Working Group members to\n <a href=\"https://www.w3.org/policies/patent-policy/#sec-Requirements\"\n >royalty-free licensing</a\n >\n for implementations.`;\n updatePolicy = html`${updatableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}`;\n if (conf.pubMode === \"LS\") {\n reviewPolicy = html`<p>\n Comments are welcome at any time but most especially before\n ${W3CDate.format(conf.crEnd)}.\n </p>`;\n } else {\n reviewPolicy = html`<p>\n This Candidate Recommendation is not expected to advance to Proposed\n Recommendation any earlier than ${W3CDate.format(conf.crEnd)}.\n </p>`;\n }\n break;\n case \"PR\":\n reviewPolicy = html`<p>\n The W3C Membership and other interested parties are invited to review\n the document and send comments through ${W3CDate.format(conf.prEnd)}.\n Advisory Committee Representatives should consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >. Note that substantive technical comments were expected during the\n Candidate Recommendation review period that ended\n ${W3CDate.format(conf.crEnd)}.\n </p>`;\n break;\n case \"DNOTE\":\n endorsement = html`${conf.textStatus}s are not endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> nor its Members.`;\n break;\n case \"NOTE\":\n endorsement = html`This ${conf.textStatus} is endorsed by\n ${getWgHTML(conf)}, but is not endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> itself nor its\n Members.`;\n break;\n }\n return html`<p>${endorsement} ${statusExplanation}</p>\n ${updatePolicy} ${reviewPolicy}`;\n}\n\nfunction renderIsRec(conf) {\n const { revisedRecEnd } = conf;\n const updatableRec = document.querySelector(\"#sotd.updateable-rec\");\n let reviewTarget = \"\";\n if (document.querySelector(\".proposed-addition\")) {\n reviewTarget = \"additions\";\n } else if (document.querySelector(\".proposed-correction\")) {\n reviewTarget = \"corrections\";\n }\n return html`\n <p>\n W3C recommends the wide deployment of this specification as a standard for\n the Web.\n </p>\n\n <p>\n A W3C Recommendation is a specification that, after extensive\n consensus-building, is endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members, and\n has commitments from Working Group members to\n <a href=\"https://www.w3.org/policies/patent-policy/#sec-Requirements\"\n >royalty-free licensing</a\n >\n for implementations.\n ${updatableRec\n ? html`Future updates to this Recommendation may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}\n </p>\n ${document.querySelector(\".addition\")\n ? html`<p class=\"addition\">\n Candidate additions are marked in the document.\n </p>`\n : \"\"}\n ${document.querySelector(\".correction\")\n ? html`<p class=\"correction\">\n Candidate corrections are marked in the document.\n </p>`\n : \"\"}\n ${document.querySelector(\".proposed-addition\")\n ? html`<p class=\"addition proposed\">\n Proposed additions are marked in the document.\n </p>`\n : \"\"}\n ${document.querySelector(\".proposed-correction\")\n ? html`<p class=\"correction proposed\">\n Proposed corrections are marked in the document.\n </p>`\n : \"\"}\n ${reviewTarget\n ? html`<p>\n The W3C Membership and other interested parties are invited to review\n the proposed ${reviewTarget} and send comments through\n ${W3CDate.format(revisedRecEnd)}. Advisory Committee Representatives\n should consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >.\n </p>`\n : \"\"}\n `;\n}\n\nfunction renderDeliverer(conf) {\n const {\n isNote,\n isRegistry,\n wgId,\n multipleWGs,\n wgPatentHTML,\n wgPatentURI,\n wgPatentPolicy,\n } = conf;\n\n const patentPolicyURL =\n wgPatentPolicy === \"PP2017\"\n ? \"https://www.w3.org/Consortium/Patent-Policy-20170801/\"\n : \"https://www.w3.org/policies/patent-policy/\";\n\n const producers = !(isNote || isRegistry)\n ? html`\n This document was produced by ${multipleWGs ? \"groups\" : \"a group\"}\n operating under the\n <a href=\"${patentPolicyURL}\"\n >${wgPatentPolicy === \"PP2017\" ? \"1 August 2017 \" : \"\"}W3C Patent\n Policy</a\n >.\n `\n : html`\n The\n <a href=\"${patentPolicyURL}\"\n >${wgPatentPolicy === \"PP2017\" ? \"1 August 2017 \" : \"\"}W3C Patent\n Policy</a\n >\n does not carry any licensing requirements or commitments on this\n document.\n `;\n return html`<p data-deliverer=\"${isNote || isRegistry ? wgId : null}\">\n ${producers}\n ${!(isNote || isRegistry)\n ? html`\n ${multipleWGs\n ? html` W3C maintains ${wgPatentHTML} `\n : html`\n W3C maintains a\n <a href=\"${[wgPatentURI]}\" rel=\"disclosure\"\n >public list of any patent disclosures</a\n >\n `}\n made in connection with the deliverables of\n ${multipleWGs\n ? \"each group; these pages also include\"\n : \"the group; that page also includes\"}\n instructions for disclosing a patent. An individual who has actual\n knowledge of a patent which the individual believes contains\n <a href=\"${patentPolicyURL}#def-essential\">Essential Claim(s)</a>\n must disclose the information in accordance with\n <a href=\"${patentPolicyURL}#sec-Disclosure\"\n >section 6 of the W3C Patent Policy</a\n >.\n `\n : \"\"}\n </p>`;\n}\n\nfunction noteForSubmission(conf, opts) {\n return html`\n ${opts.additionalContent}\n ${conf.isMemberSubmission ? noteForMemberSubmission(conf) : \"\"}\n `;\n}\n\nfunction noteForMemberSubmission(conf) {\n const teamComment = `https://www.w3.org/Submission/${conf.publishDate.getUTCFullYear()}/${\n conf.submissionCommentNumber\n }/Comment/`;\n\n const patentPolicyURL =\n conf.wgPatentPolicy === \"PP2017\"\n ? \"https://www.w3.org/Consortium/Patent-Policy-20170801/\"\n : \"https://www.w3.org/policies/patent-policy/\";\n\n return html`<p>\n By publishing this document, W3C acknowledges that the\n <a href=\"${conf.thisVersion}\">Submitting Members</a> have made a formal\n Submission request to W3C for discussion. Publication of this document by\n W3C indicates no endorsement of its content by W3C, nor that W3C has, is, or\n will be allocating any resources to the issues addressed by it. This\n document is not the product of a chartered W3C group, but is published as\n potential input to the\n <a href=\"https://www.w3.org/policies/process/\">W3C Process</a>. A\n <a href=\"${teamComment}\">W3C Team Comment</a> has been published in\n conjunction with this Member Submission. Publication of acknowledged Member\n Submissions at the W3C site is one of the benefits of\n <a href=\"https://www.w3.org/Consortium/Prospectus/Joining\">\n W3C Membership</a\n >. Please consult the requirements associated with Member Submissions of\n <a href=\"${patentPolicyURL}#sec-submissions\"\n >section 3.3 of the W3C Patent Policy</a\n >. Please consult the complete\n <a href=\"https://www.w3.org/Submission\"\n >list of acknowledged W3C Member Submissions</a\n >.\n </p>`;\n}\n\nexport function renderPublicList(conf, opts) {\n const { mailToWGPublicListWithSubject, mailToWGPublicListSubscription } =\n opts;\n const { wgPublicList, subjectPrefix } = conf;\n const archivesURL = `https://lists.w3.org/Archives/Public/${wgPublicList}/`;\n return html`<p>\n If you wish to make comments regarding this document, please send them to\n <a href=\"${mailToWGPublicListWithSubject}\">${wgPublicList}@w3.org</a>\n (<a href=\"${mailToWGPublicListSubscription}\">subscribe</a>,\n <a href=\"${archivesURL}\">archives</a>)${subjectPrefix\n ? html` with <code>${subjectPrefix}</code> at the start of your email's\n subject`\n : \"\"}.\n </p>`;\n}\n\nfunction linkToWorkingGroup(conf) {\n if (!conf.wg) {\n return;\n }\n let changes = null;\n const proposedAdditions = document.querySelector(\".proposed-addition\");\n const proposedCorrections = document.querySelector(\".proposed-correction\");\n const additions = document.querySelector(\".addition\");\n const corrections = document.querySelector(\".correction\");\n const hasRevisions =\n proposedAdditions || proposedCorrections || additions || corrections;\n if (conf.isRec && hasRevisions) {\n if (\n (proposedAdditions && proposedCorrections) ||\n (additions && corrections)\n ) {\n changes = html`It includes\n ${proposedAdditions\n ? html`<a href=\"${processLink}#proposed-amendments\">\n proposed amendments</a\n >`\n : html`<a href=\"${processLink}#candidate-amendments\">\n candidate amendments</a\n >`},\n introducing substantive changes and new features since the previous\n Recommendation.`;\n } else if (proposedAdditions || additions) {\n changes = html`It includes\n ${proposedAdditions\n ? html`<a href=\"${processLink}#proposed-addition\">\n proposed additions</a\n >`\n : html`<a href=\"${processLink}#candidate-addition\">\n candidate additions</a\n >`},\n introducing new features since the previous Recommendation.`;\n } else if (proposedCorrections || corrections) {\n changes = html`It includes\n ${proposedCorrections\n ? html`<a href=\"${processLink}#proposed-correction\">\n proposed corrections</a\n >`\n : html`<a href=\"${processLink}#candidate-correction\">\n candidate corrections</a\n >`}.`;\n }\n }\n const track = status2track[conf.specStatus]\n ? html` using the\n <a href=\"${processLink}#recs-and-notes\"\n >${status2track[conf.specStatus]} track</a\n >`\n : \"\";\n return html`<p>\n This document was published by ${getWgHTML(conf)} as\n ${prefix(conf.longStatus)}${track}. ${changes}\n </p>`;\n}\n\nfunction getWgHTML(conf) {\n if (Array.isArray(conf.wg)) {\n return htmlJoinAnd(conf.wg, (wg, idx) => {\n return html`the <a href=\"${conf.wgURI[idx]}\">${wg}</a>`;\n });\n } else if (conf.wg) {\n return html`the <a href=\"${conf.wgURI}\">${conf.wg}</a>`;\n }\n}\n\nexport function linkToCommunity(conf, opts) {\n if (!conf.github && !conf.wgPublicList) {\n return;\n }\n return html`<p>\n ${conf.github\n ? html`\n <a href=\"${conf.issueBase}\">GitHub Issues</a> are preferred for\n discussion of this specification.\n `\n : \"\"}\n ${conf.wgPublicList\n ? html`\n ${conf.github && conf.wgPublicList\n ? \"Alternatively, you can send comments to our mailing list.\"\n : \"Comments regarding this document are welcome.\"}\n Please send them to\n <a href=\"${opts.mailToWGPublicListWithSubject}\"\n >${conf.wgPublicList}@w3.org</a\n >\n (<a href=\"${opts.mailToWGPublicListSubscription}\">subscribe</a>,\n <a\n href=\"${`https://lists.w3.org/Archives/Public/${conf.wgPublicList}/`}\"\n >archives</a\n >)${conf.subjectPrefix\n ? html` with <code>${conf.subjectPrefix}</code> at the start of your\n email's subject`\n : \"\"}.\n `\n : \"\"}\n </p>`;\n}\n","// @ts-check\nimport {\n l10n,\n linkToCommunity,\n renderPreview,\n renderPublicList,\n} from \"./sotd.js\";\nimport { html } from \"../../core/import-maps.js\";\n\nexport default (conf, opts) => {\n return html`\n <h2>${l10n.sotd}</h2>\n ${conf.isPreview ? renderPreview(conf) : \"\"}\n <p>\n This specification was published by the\n <a href=\"${conf.wgURI}\">${conf.wg}</a>. It is not a W3C Standard nor is it\n on the W3C Standards Track.\n ${conf.isCGFinal\n ? html`\n Please note that under the\n <a href=\"https://www.w3.org/community/about/agreements/final/\"\n >W3C Community Final Specification Agreement (FSA)</a\n >\n other conditions apply.\n `\n : html`\n Please note that under the\n <a href=\"https://www.w3.org/community/about/agreements/cla/\"\n >W3C Community Contributor License Agreement (CLA)</a\n >\n there is a limited opt-out and other conditions apply.\n `}\n Learn more about\n <a href=\"https://www.w3.org/community/\"\n >W3C Community and Business Groups</a\n >.\n </p>\n ${!conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${!conf.github && conf.wgPublicList ? renderPublicList(conf, opts) : \"\"}\n ${conf.github ? linkToCommunity(conf, opts) : \"\"}\n ${conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${opts.additionalSections}\n `;\n};\n","// @ts-check\n// Module w3c/headers\n// Generate the headers material based on the provided configuration.\n// CONFIGURATION\n// - specStatus: the short code for the specification's maturity level or type (required)\n// - shortName: the small name that is used after /TR/ in published reports (required)\n// - editors: an array of people editing the document (at least one is required). People\n// are defined using:\n// - name: the person's name (required)\n// - url: URI for the person's home page\n// - company: the person's company\n// - companyURL: the URI for the person's company\n// - mailto: the person's email\n// - note: a note on the person (e.g. former editor)\n// - authors: an array of people who are contributing authors of the document.\n// - formerEditors: an array of people that had earlier edited the document but no longer edit.\n// - subtitle: a subtitle for the specification\n// - publishDate: the date to use for the publication, default to document.lastModified, and\n// failing that to now. The format is YYYY-MM-DD or a Date object.\n// - previousPublishDate: the date on which the previous version was published.\n// - previousMaturity: the specStatus of the previous version\n// - errata: the URI of the errata document, if any\n// - alternateFormats: a list of alternate formats for the document, each of which being\n// defined by:\n// - uri: the URI to the alternate\n// - label: a label for the alternate\n// - lang: optional language\n// - type: optional MIME type\n// - logos: a list of logos to use instead of the W3C logo, each of which being defined by:\n// - src: the URI to the logo (target of <img src=>)\n// - alt: alternate text for the image (<img alt=>), defaults to \"Logo\" or \"Logo 1\", \"Logo 2\", ...\n// if src is not specified, this is the text of the \"logo\"\n// - height: optional height of the logo (<img height=>)\n// - width: optional width of the logo (<img width=>)\n// - url: the URI to the organization represented by the logo (target of <a href=>)\n// - id: optional id for the logo, permits custom CSS (wraps logo in <span id=>)\n// - each logo element must specify either src or alt\n// - testSuiteURI: the URI to the test suite, if any\n// - implementationReportURI: the URI to the implementation report, if any\n// - noRecTrack: set to true if this document is not intended to be on the Recommendation track\n// - edDraftURI: the URI of the Editor's Draft for this document, if any. Required if\n// specStatus is set to \"ED\".\n// - additionalCopyrightHolders: a copyright owner in addition to W3C (or the only one if specStatus\n// is unofficial)\n// - copyrightStart: the year from which the copyright starts running\n// - prevED: the URI of the previous Editor's Draft if it has moved\n// - prevRecShortname: the short name of the previous Recommendation, if the name has changed\n// - prevRecURI: the URI of the previous Recommendation if not directly generated from\n// prevRecShortname.\n// - wg: the name of the WG in charge of the document. This may be an array in which case wgURI\n// and wgPatentURI need to be arrays as well, of the same length and in the same order\n// - wgURI: the URI to the group's page, or an array of such\n// - wgPatentURI: the URI to the group's patent information page, or an array of such. NOTE: this\n// is VERY IMPORTANT information to provide and get right, do not just paste this without checking\n// that you're doing it right\n// - wgPublicList: the name of the mailing list where discussion takes place. Note that this cannot\n// be an array as it is assumed that there is a single list to discuss the document, even if it\n// is handled by multiple groups\n// - charterDisclosureURI: used for IGs (when publishing IG-NOTEs) to provide a link to the IPR commitment\n// defined in their charter.\n// - thisVersion: the URI to the dated current version of the specification. ONLY ever use this for CG/BG\n// documents, for all others it is autogenerated.\n// - latestVersion: the URI to the latest version of the specification.\n// - prevVersion: the URI to the previous (dated) version of the specification. ONLY ever use this for CG/BG\n// documents, for all others it is autogenerated.\n// - subjectPrefix: the string that is expected to be used as a subject prefix when posting to the mailing\n// list of the group.\n// - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc).\n// Example of usage: [{key: \"foo\", href:\"https://b\"}, {key: \"bar\", href:\"https://\"}].\n// Allowed values are:\n// - key: the key for the <dt> (e.g., \"Bug Tracker\"). Required.\n// - value: The value that will appear in the <dd> (e.g., \"GitHub\"). Optional.\n// - href: a URL for the value (e.g., \"https://foo.com/issues\"). Optional.\n// - class: a string representing CSS classes. Optional.\n// - license: can be one of the following\n// - \"cc-by\", which is experimentally available in some groups (but likely to be phased out).\n// Note that this is a dual licensing regime.\n// - \"document\", which is the old, but still available, document license.\n// - \"dual\", dual license.\n// - \"cc0\", an extremely permissive license. It is only recommended if you are working on a document that is\n// intended to be pushed to the WHATWG.\n// - \"w3c-software\", a permissive and attributions license (but GPL-compatible).\n// - \"w3c-software-doc\", (default) the W3C Software and Document License\n// https://www.w3.org/copyright/software-license-2023/\nimport {\n ISODate,\n codedJoinAnd,\n codedJoinOr,\n concatDate,\n docLink,\n htmlJoinAnd,\n norm,\n showError,\n showWarning,\n} from \"../core/utils.js\";\nimport cgbgHeadersTmpl from \"./templates/cgbg-headers.js\";\nimport cgbgSotdTmpl from \"./templates/cgbg-sotd.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { pub } from \"../core/pubsubhub.js\";\nimport sotdTmpl from \"./templates/sotd.js\";\n\nexport const name = \"w3c/headers\";\n\n/**\n * Resolves against https://www.w3.org.\n * @param {string} href\n */\nfunction w3Url(href) {\n return new URL(href, \"https://www.w3.org/\").href;\n}\n\nconst status2maturity = {\n LS: \"WD\",\n LD: \"WD\",\n FPWD: \"WD\",\n \"Member-SUBM\": \"SUBM\",\n};\n\nexport const status2text = {\n DNOTE: \"Group Draft Note\",\n NOTE: \"Group Note\",\n STMT: \"Statement\",\n \"Member-SUBM\": \"Member Submission\",\n MO: \"Member-Only Document\",\n ED: \"Editor's Draft\",\n LS: \"Living Standard\",\n LD: \"Living Document\",\n FPWD: \"First Public Working Draft\",\n WD: \"Working Draft\",\n CR: \"Candidate Recommendation\",\n CRD: \"Candidate Recommendation\",\n PR: \"Proposed Recommendation\",\n REC: \"Recommendation\",\n DISC: \"Discontinued Draft\",\n RSCND: \"Rescinded Recommendation\",\n DRY: \"Draft Registry\",\n CRYD: \"Candidate Registry\",\n CRY: \"Candidate Registry\",\n RY: \"Registry\",\n unofficial: \"Unofficial Draft\",\n UD: \"Unofficial Draft\",\n base: \"\",\n finding: \"TAG Finding\",\n \"draft-finding\": \"Draft TAG Finding\",\n \"editor-draft-finding\": \"Draft TAG Finding\",\n \"CG-DRAFT\": \"Draft Community Group Report\",\n \"CG-FINAL\": \"Final Community Group Report\",\n \"BG-DRAFT\": \"Draft Business Group Report\",\n \"BG-FINAL\": \"Final Business Group Report\",\n};\nconst status2long = {\n ...status2text,\n CR: \"Candidate Recommendation Snapshot\",\n CRD: \"Candidate Recommendation Draft\",\n CRY: \"Candidate Registry Snapshot\",\n CRYD: \"Candidate Registry Draft\",\n};\nexport const status2track = {\n DNOTE: \"Note\",\n NOTE: \"Note\",\n STMT: \"Note\",\n \"WG-NOTE\": \"Note\",\n \"IG-NOTE\": \"Note\",\n FPWD: \"Recommendation\",\n WD: \"Recommendation\",\n CR: \"Recommendation\",\n CRD: \"Recommendation\",\n PR: \"Recommendation\",\n REC: \"Recommendation\",\n DISC: \"Recommendation\",\n RSCND: \"Recommendation\",\n DRY: \"Registry\",\n CRYD: \"Registry\",\n CRY: \"Registry\",\n RY: \"Registry\",\n};\nexport const W3CNotes = [\"DNOTE\", \"NOTE\", \"STMT\"];\nexport const recTrackStatus = [\n \"CR\",\n \"CRD\",\n \"DISC\",\n \"FPWD\",\n \"PR\",\n \"REC\",\n \"RSCND\",\n \"WD\",\n];\nexport const registryTrackStatus = [\"DRY\", \"CRY\", \"CRYD\", \"RY\"];\nexport const tagStatus = [\"draft-finding\", \"finding\", \"editor-draft-finding\"];\nexport const cgStatus = [\"CG-DRAFT\", \"CG-FINAL\"];\nexport const bgStatus = [\"BG-DRAFT\", \"BG-FINAL\"];\nexport const cgbgStatus = [...cgStatus, ...bgStatus];\nexport const trStatus = [\n ...W3CNotes,\n ...recTrackStatus,\n ...registryTrackStatus,\n];\nexport const noTrackStatus = [\n \"base\",\n ...cgStatus,\n ...bgStatus,\n \"editor-draft-finding\",\n \"draft-finding\",\n \"finding\",\n \"MO\",\n \"unofficial\",\n];\n/** @type {Map<string, LicenseInfo>} */\nexport const licenses = new Map([\n [\n \"cc0\",\n {\n name: \"Creative Commons 0 Public Domain Dedication\",\n short: \"CC0\",\n url: \"https://creativecommons.org/publicdomain/zero/1.0/\",\n },\n ],\n [\n \"w3c-software\",\n {\n name: \"W3C Software Notice and License\",\n short: \"W3C Software\",\n url: \"https://www.w3.org/copyright/software-license-2002/\",\n },\n ],\n [\n \"w3c-software-doc\",\n {\n name: \"W3C Software and Document Notice and License\",\n short: \"permissive document license\",\n url: \"https://www.w3.org/copyright/software-license-2023/\",\n },\n ],\n [\n \"cc-by\",\n {\n name: \"Creative Commons Attribution 4.0 International Public License\",\n short: \"CC-BY\",\n url: \"https://creativecommons.org/licenses/by/4.0/legalcode\",\n },\n ],\n [\n \"document\",\n {\n name: \"W3C Document License\",\n short: \"document use\",\n url: \"https://www.w3.org/copyright/document-license/\",\n },\n ],\n [\n \"dual\",\n {\n name: \"W3C Dual License\",\n short: \"dual license\",\n url: \"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html\",\n },\n ],\n [\n undefined,\n {\n name: \"unlicensed\",\n url: null,\n short: \"UNLICENSED\",\n },\n ],\n]);\n\nconst patentPolicies = [\"PP2017\", \"PP2020\"];\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg = docLink`${prop} is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nfunction deriveLicenseInfo(conf) {\n let license = undefined;\n if (typeof conf.license === \"string\") {\n const lCaseLicense = conf.license.toLowerCase();\n if (!licenses.has(lCaseLicense)) {\n const msg = `The license \"\\`${conf.license}\\`\" is not supported.`;\n const choices = codedJoinOr(\n [...licenses.keys()].filter(k => k),\n {\n quotes: true,\n }\n );\n const hint = docLink`Please set\n ${\"[license]\"} to one of: ${choices}. If in doubt, remove \\`license\\` and let ReSpec pick one for you.`;\n showError(msg, name, { hint });\n } else {\n license = lCaseLicense;\n }\n }\n\n if (conf.isUnofficial && !license) {\n license = \"cc-by\";\n }\n\n // W3C docs can't be CC-BY or CC0\n if (!conf.isUnofficial && [\"cc-by\", \"cc0\"].includes(license)) {\n const msg = docLink`License \"\\`${conf.license}\\`\" is not allowed for W3C Specifications.`;\n const hint = docLink`Please set ${\"[license]\"} to \\`\"w3c-software-doc\"\\` instead.`;\n showError(msg, name, { hint });\n }\n const licenseInfo = licenses.get(license);\n return licenseInfo;\n}\n\nexport async function run(conf) {\n conf.isBasic = conf.specStatus === \"base\";\n conf.isCGBG = cgbgStatus.includes(conf.specStatus);\n conf.isCGFinal = conf.isCGBG && conf.specStatus.endsWith(\"G-FINAL\");\n conf.isCR = conf.specStatus === \"CR\" || conf.specStatus === \"CRD\";\n conf.isCRDraft = conf.specStatus === \"CRD\";\n conf.isCRY = conf.specStatus === \"CRY\" || conf.specStatus === \"CRYD\";\n conf.isEd = conf.specStatus === \"ED\";\n conf.isMemberSubmission = conf.specStatus === \"Member-SUBM\";\n conf.isMO = conf.specStatus === \"MO\";\n conf.isNote = W3CNotes.includes(conf.specStatus);\n conf.isNoTrack = noTrackStatus.includes(conf.specStatus);\n conf.isPR = conf.specStatus === \"PR\";\n conf.isRecTrack = recTrackStatus.includes(conf.specStatus);\n conf.isRec = conf.isRecTrack && conf.specStatus === \"REC\";\n conf.isRegistry = registryTrackStatus.includes(conf.specStatus);\n conf.isRegular = !conf.isCGBG && !conf.isBasic;\n conf.isTagEditorFinding = conf.specStatus === \"editor-draft-finding\";\n conf.isTagFinding = tagStatus.includes(conf.specStatus);\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n conf.licenseInfo = deriveLicenseInfo(conf);\n conf.prependW3C = !conf.isBasic && !conf.isUnofficial;\n conf.longStatus = status2long[conf.specStatus];\n conf.textStatus = status2text[conf.specStatus];\n conf.showPreviousVersion = false;\n\n if (conf.isRegular && !conf.shortName) {\n const msg = docLink`The ${\"[shortName]\"} configuration option is required for this kind of document.`;\n const hint = docLink`Please set ${\"[shortName]\"} to a short name for the specification.`;\n showError(msg, name, { hint });\n }\n\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.publishYear = conf.publishDate.getUTCFullYear();\n if (conf.modificationDate) {\n conf.modificationDate = validateDateAndRecover(\n conf,\n \"modificationDate\",\n document.lastModified\n );\n }\n\n if (conf.isRecTrack && !conf.github && !conf.wgPublicList) {\n const msg =\n \"W3C Process requires a either a link to a public repository or mailing list.\";\n const hint = docLink`Use the ${\"[github]\"} configuration option to add a link to a repository. Alternatively use ${\"[wgPublicList]\"} to link to a mailing list.`;\n showError(msg, name, {\n hint,\n });\n }\n\n if (conf.isEd && !conf.edDraftURI) {\n const msg = docLink`Editor's Drafts should set ${\"[edDraftURI]\"} configuration option.`;\n const hint = docLink`Please set ${\"[edDraftURI]\"} to the URL of the Editor's Draft. Alternatively, use the set ${\"[github]\"} option, which automatically sets it for you.`;\n showWarning(msg, name, { hint });\n }\n\n const pubSpace = derivePubSpace(conf);\n if (pubSpace && !conf.thisVersion) {\n const maturity = status2maturity[conf.specStatus] || conf.specStatus;\n const { shortName, publishDate } = conf;\n const date = concatDate(publishDate);\n const docVersion = `${maturity}-${shortName}-${date}`;\n const year = [...trStatus, \"Member-SUBM\"].includes(conf.specStatus)\n ? `${publishDate.getUTCFullYear()}/`\n : \"\";\n conf.thisVersion = w3Url(`${pubSpace}/${year}${docVersion}/`);\n }\n\n if (conf.isEd) conf.thisVersion = conf.edDraftURI;\n if (conf.isCGBG) validateCGBG(conf);\n if (conf.latestVersion !== null) {\n conf.latestVersion = conf.latestVersion\n ? w3Url(conf.latestVersion)\n : w3Url(`${pubSpace}/${conf.shortName}/`);\n }\n\n if (conf.latestVersion) validateIfAllowedOnTR(conf);\n\n const latestPath = `${pubSpace}/${conf.shortName}`;\n if (conf.previousPublishDate) {\n if (!conf.previousMaturity && !conf.isTagFinding) {\n const msg = docLink`${\"[`previousPublishDate`]\"} is set, but missing ${\"[`previousMaturity`]\"}.`;\n showError(msg, name);\n }\n\n conf.previousPublishDate = validateDateAndRecover(\n conf,\n \"previousPublishDate\"\n );\n\n const prevMaturity =\n status2maturity[conf.previousMaturity] ?? conf.previousMaturity;\n if (conf.isTagFinding && conf.latestVersion) {\n const pubDate = ISODate.format(conf.publishDate);\n conf.thisVersion = w3Url(`${latestPath}-${pubDate}`);\n const prevPubDate = ISODate.format(conf.previousPublishDate);\n conf.prevVersion = w3Url(`${latestPath}-${prevPubDate}}`);\n } else if (conf.isCGBG || conf.isBasic) {\n conf.prevVersion = conf.prevVersion || \"\";\n } else {\n const year = conf.previousPublishDate.getUTCFullYear();\n const { shortName } = conf;\n const date = concatDate(conf.previousPublishDate);\n conf.prevVersion = w3Url(\n `${pubSpace}/${year}/${prevMaturity}-${shortName}-${date}/`\n );\n }\n }\n if (conf.prevRecShortname && !conf.prevRecURI)\n conf.prevRecURI = w3Url(`${pubSpace}/${conf.prevRecShortname}`);\n\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n\n if (conf.editors.length === 0) {\n const msg = \"At least one editor is required.\";\n const hint = docLink`Add one or more editors using the ${\"[editors]\"} configuration option.`;\n showError(msg, name, { hint });\n } else if (conf.editors.length && conf.isRecTrack) {\n // check that every editor has w3cid\n conf.editors.forEach((editor, i) => {\n if (editor.w3cid) return;\n const msg = docLink`Editor ${\n editor.name ? `\"${editor.name}\"` : `number ${i + 1}`\n } is missing their ${\"[w3cid]\"}.`;\n const hint = docLink`See ${\"[w3cid]\"} for instructions for how to retrieve it and add it.`;\n showError(msg, name, { hint });\n });\n }\n\n if (conf.alternateFormats?.some(({ uri, label }) => !uri || !label)) {\n const msg = docLink`Every ${\"[`alternateFormats`]\"} entry must have a \\`uri\\` and a \\`label\\`.`;\n showError(msg, name);\n }\n if (conf.copyrightStart == conf.publishYear) conf.copyrightStart = \"\";\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n conf.shortISODate = ISODate.format(conf.publishDate);\n validatePatentPolicies(conf);\n await deriveHistoryURI(conf);\n if (conf.isTagEditorFinding) {\n delete conf.thisVersion;\n delete conf.latestVersion;\n }\n if (conf.isTagFinding) {\n conf.showPreviousVersion = conf.previousPublishDate ? true : false;\n }\n // configuration done - yay!\n\n const options = {\n get multipleAlternates() {\n return conf.alternateFormats && conf.alternateFormats.length > 1;\n },\n get alternatesHTML() {\n return (\n conf.alternateFormats &&\n htmlJoinAnd(\n // We need to pass a string here...\n conf.alternateFormats.map(({ label }) => label),\n (_, i) => {\n const alt = conf.alternateFormats[i];\n return html`<a\n rel=\"alternate\"\n href=\"${alt.uri}\"\n hreflang=\"${alt?.lang ?? null}\"\n type=\"${alt?.type ?? null}\"\n >${alt.label}</a\n >`;\n }\n )\n );\n },\n };\n\n // insert into document\n const header = (conf.isCGBG ? cgbgHeadersTmpl : headersTmpl)(conf, options);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // handle SotD\n const sotd =\n document.getElementById(\"sotd\") || document.createElement(\"section\");\n if ((conf.isCGBG || !conf.isNoTrack || conf.isTagFinding) && !sotd.id) {\n const msg =\n \"A Status of This Document must include at least on custom paragraph.\";\n const hint =\n \"Add a `<p>` in the 'sotd' section that reflects the status of this specification.\";\n showError(msg, name, { elements: [sotd], hint });\n }\n sotd.id = sotd.id || \"sotd\";\n sotd.classList.add(\"introductory\");\n // NOTE:\n // When arrays, wg and wgURI have to be the same length (and in the same order).\n // Technically wgURI could be longer but the rest is ignored.\n // However wgPatentURI can be shorter. This covers the case where multiple groups\n // publish together but some aren't used for patent policy purposes (typically this\n // happens when one is foolish enough to do joint work with the TAG). In such cases,\n // the groups whose patent policy applies need to be listed first, and wgPatentURI\n // can be shorter ā€” but it still needs to be an array.\n const wgPotentialArray = [conf.wg, conf.wgURI, conf.wgPatentURI];\n if (\n wgPotentialArray.some(item => Array.isArray(item)) &&\n !wgPotentialArray.every(item => Array.isArray(item))\n ) {\n const msg = docLink`If one of ${\"[wg]\"}, ${\"[wgURI]\"}, or ${\"[wgPatentURI]\"} is an array, they all have to be.`;\n const hint = docLink`Use the ${\"[group]\"} option with an array instead.`;\n showError(msg, name, { hint });\n }\n if (Array.isArray(conf.wg)) {\n conf.multipleWGs = conf.wg.length > 1;\n conf.wgPatentHTML = htmlJoinAnd(conf.wg, (wg, i) => {\n return html`a\n <a href=\"${conf.wgPatentURI[i]}\" rel=\"disclosure\"\n >public list of any patent disclosures (${wg})</a\n >`;\n });\n } else {\n conf.multipleWGs = false;\n }\n if (conf.isPR && !conf.crEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PR\" but no ${\"[crEnd]\"} is specified in the ${\"[respecConfig]\"} (needed to indicate end of previous CR).`;\n showError(msg, name);\n }\n\n if (conf.isCR && !conf.crEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"CR\", but no ${\"[crEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.crEnd = validateDateAndRecover(conf, \"crEnd\");\n\n if (conf.isPr && !conf.prEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PR\" but no ${\"[prEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.prEnd = validateDateAndRecover(conf, \"prEnd\");\n\n const isUpdatableRec = sotd.classList.contains(\"updateable-rec\");\n const hasCorrections = document.querySelector(\".correction\") !== null;\n const hasProposedCorrections =\n document.querySelector(\".proposed-correction\") !== null;\n const hasAdditions = document.querySelector(\".addition\") !== null;\n const hasProposedAdditions =\n document.querySelector(\".proposed-addition\") !== null;\n const hasRevisions =\n hasCorrections ||\n hasAdditions ||\n hasProposedAdditions ||\n hasProposedCorrections;\n\n if (conf.isRec && !conf.errata && !hasRevisions) {\n const msg = \"Recommendations must have an errata link.\";\n const hint = docLink`Add an ${\"[errata]\"} URL to your ${\"[respecConfig]\"}.`;\n showError(msg, name, { hint });\n }\n\n if (!isUpdatableRec && (hasAdditions || hasCorrections)) {\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with proposed additions but the Recommendation is not marked as allowing new features.`;\n showError(msg, name);\n }\n\n if (\n conf.isRec &&\n isUpdatableRec &&\n (hasProposedAdditions || hasProposedCorrections) &&\n !conf.revisedRecEnd\n ) {\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with proposed corrections or additions but no ${\"[revisedRecEnd]\"} is specified in the ${\"[respecConfig]\"}.`;\n showError(msg, name);\n }\n conf.revisedRecEnd = validateDateAndRecover(conf, \"revisedRecEnd\");\n\n if (conf.noRecTrack && recTrackStatus.includes(conf.specStatus)) {\n const msg = docLink`Document configured as ${\"[noRecTrack]\"}, but its status (\"${conf.specStatus}\") puts it on the W3C Rec Track.`;\n const notAllowed = codedJoinOr(recTrackStatus, { quotes: true });\n const hint = `Status **can't** be any of: ${notAllowed}.`;\n showError(msg, name, { hint });\n }\n if (!sotd.classList.contains(\"override\")) {\n html.bind(sotd)`${populateSoTD(conf, sotd)}`;\n }\n\n if (!conf.implementationReportURI && conf.isCR) {\n const msg = docLink`Missing ${\"[implementationReportURI]\"} configuration option in ${\"[respecConfig]\"}.`;\n const hint = docLink`CR documents must have an ${\"[implementationReportURI]\"} that describes the [implementation experience](https://www.w3.org/policies/process/#implementation-experience).`;\n showError(msg, name, { hint });\n }\n if (!conf.implementationReportURI && conf.isPR) {\n const msg = docLink`PR documents should include an ${\"[implementationReportURI]\"}, which needs to link to a document that describes the [implementation experience](https://www.w3.org/policies/process-20190301/#implementation-experience).`;\n showWarning(msg, name);\n }\n\n // Requested by https://github.com/speced/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: norm(\n document.getElementById(\"w3c-state\")?.textContent ?? \"\"\n ),\n });\n}\n\nfunction validateIfAllowedOnTR(conf) {\n const latestVersionURL = new URL(conf.latestVersion);\n const isW3C =\n latestVersionURL.origin === \"https://www.w3.org\" ||\n latestVersionURL.origin === \"https://w3.org/\";\n if (\n isW3C &&\n latestVersionURL.pathname.startsWith(\"/TR/\") &&\n [\"ED\", ...trStatus].includes(conf.specStatus) === false\n ) {\n const msg = docLink`Documents with a status of \\`\"${conf.specStatus}\"\\` can't be published on the W3C's /TR/ (Technical Report) space.`;\n const hint = docLink`Ask a W3C Team Member for a W3C URL where the report can be published and change ${\"[latestVersion]\"} to something else.`;\n showError(msg, name, { hint });\n return;\n }\n}\n\nfunction derivePubSpace(conf) {\n const { specStatus, group } = conf;\n if (trStatus.includes(specStatus) || conf.groupType === \"wg\") {\n return `/TR`;\n }\n\n switch (specStatus) {\n case \"CG-FINAL\":\n case \"BG-FINAL\":\n return `/community/reports/${group}`;\n case \"finding\":\n case \"draft-finding\":\n return \"/2001/tag/doc\";\n case \"Member-SUBM\":\n return `/Submission`;\n }\n\n return \"\";\n}\n\nfunction validateCGBG(conf) {\n const reportType = status2text[conf.specStatus];\n const latestVersionURL = conf.latestVersion\n ? new URL(w3Url(conf.latestVersion))\n : null;\n\n if (!conf.wg) {\n const msg = docLink`The ${\"[group]\"} configuration option is required for this kind of document (${reportType}).`;\n showError(msg, name);\n return;\n }\n\n // Deal with final reports\n if (conf.isCGFinal) {\n // Final report require a w3.org URL.\n const isW3C =\n latestVersionURL?.origin === \"https://www.w3.org\" ||\n latestVersionURL?.origin === \"https://w3.org/\";\n if (isW3C === false) {\n const msg = docLink`For ${reportType}, the ${\"[latestVersion]\"} URL must point to somewhere at https://www.w3.org/.`;\n const hint = `Ask a W3C Team Member for a W3C URL where the report can be published.`;\n showError(msg, name, { hint });\n return;\n }\n }\n}\n\nasync function deriveHistoryURI(conf) {\n if (!conf.shortName || conf.historyURI === null || !conf.latestVersion) {\n return; // Nothing to do\n }\n\n const canShowHistory = conf.isEd || trStatus.includes(conf.specStatus);\n\n if (conf.historyURI && !canShowHistory) {\n const msg = docLink`The ${\"[historyURI]\"} can't be used with non /TR/ documents.`;\n const hint = docLink`Please remove ${\"[historyURI]\"}.`;\n showError(msg, name, { hint });\n conf.historyURI = null;\n return;\n }\n\n const historyURL = new URL(\n conf.historyURI ?? `${conf.shortName}/`,\n \"https://www.w3.org/standards/history/\"\n );\n\n // If it's on the Rec Track or it's TR worthy, then allow history override.\n // Also make a an exception for FPWD, DNOTE, NOTE and DRY.\n if (\n (conf.historyURI && canShowHistory) ||\n [\"FPWD\", \"DNOTE\", \"NOTE\", \"DRY\"].includes(conf.specStatus)\n ) {\n conf.historyURI = historyURL.href;\n return;\n }\n\n // Let's get the history from the W3C.\n // Do a fetch HEAD request to see if the history exists...\n // We don't discriminate... if it's on the W3C website with a history,\n // we show it.\n try {\n const response = await fetch(historyURL, { method: \"HEAD\" });\n if (response.ok) {\n conf.historyURI = response.url;\n }\n } catch {\n // Ignore fetch errors\n }\n}\n\nfunction validatePatentPolicies(conf) {\n if (!conf.wgPatentPolicy) return;\n const policies = new Set([].concat(conf.wgPatentPolicy));\n if (\n policies.size &&\n ![...policies].every(policy => patentPolicies.includes(policy))\n ) {\n const invalidPolicies = [...policies].filter(\n policy => !patentPolicies.includes(policy)\n );\n const msg = docLink`Invalid ${\"[wgPatentPolicy]\"} value(s): ${codedJoinAnd(\n invalidPolicies\n )}.`;\n const hint = `Please use one of: ${codedJoinOr(patentPolicies)}.`;\n showError(msg, name, { hint });\n }\n if (policies.size !== 1) {\n const msg =\n \"When collaborating across multiple groups, they must use the same patent policy.\";\n const hint = docLink`For ${\"[wgPatentPolicy]\"}, please check the patent policies of each group. The patent policies were: ${[\n ...policies,\n ].join(\", \")}.`;\n showError(msg, name, { hint });\n }\n // We take the first policy\n conf.wgPatentPolicy = [...policies][0];\n}\n\n/**\n * @param {*} conf\n * @param {HTMLElement} sotd\n */\nfunction populateSoTD(conf, sotd) {\n const options = {\n ...collectSotdContent(sotd, conf),\n\n get mailToWGPublicList() {\n return `mailto:${conf.wgPublicList}@w3.org`;\n },\n get mailToWGPublicListWithSubject() {\n const fragment = conf.subjectPrefix\n ? `?subject=${encodeURIComponent(conf.subjectPrefix)}`\n : \"\";\n return this.mailToWGPublicList + fragment;\n },\n get mailToWGPublicListSubscription() {\n return `mailto:${conf.wgPublicList}-request@w3.org?subject=subscribe`;\n },\n };\n const template = conf.isCGBG ? cgbgSotdTmpl : sotdTmpl;\n return template(conf, options);\n}\n\n/**\n * @param {HTMLElement} sotd\n */\nfunction collectSotdContent(sotd, { isTagFinding = false }) {\n const sotdClone = sotd.cloneNode(true);\n const additionalContent = document.createDocumentFragment();\n // we collect everything until we hit a section,\n // that becomes the custom content.\n while (sotdClone.hasChildNodes()) {\n if (\n sotdClone.nodeType === Node.ELEMENT_NODE &&\n // @ts-ignore\n sotdClone.firstChild.localName === \"section\"\n ) {\n break;\n }\n additionalContent.appendChild(sotdClone.firstChild);\n }\n if (isTagFinding && !additionalContent.hasChildNodes()) {\n const msg = docLink`ReSpec does not support automated SotD generation for TAG findings.`;\n const hint = `Please add the prerequisite content in the 'sotd' section.`;\n showWarning(msg, name, { hint });\n }\n return {\n additionalContent,\n // Whatever sections are left, we throw at the end.\n additionalSections: sotdClone.childNodes,\n };\n}\n","// @ts-check\n/**\n * Sets the core defaults\n */\nexport const name = \"core/defaults\";\n\nexport const coreDefaults = {\n lint: {\n \"no-headingless-sections\": true,\n \"no-http-props\": true,\n \"no-unused-vars\": false,\n \"check-punctuation\": false,\n \"local-refs-exist\": true,\n \"check-internal-slots\": false,\n \"check-charset\": false,\n \"privsec-section\": false,\n },\n pluralize: true,\n specStatus: \"base\",\n highlightVars: true,\n addSectionLinks: true,\n};\n","// @ts-check\n/**\n * Sets the defaults for W3C specs\n */\nexport const name = \"w3c/defaults\";\nimport {\n W3CNotes,\n bgStatus,\n cgStatus,\n recTrackStatus,\n registryTrackStatus,\n status2text,\n tagStatus,\n trStatus,\n} from \"./headers.js\";\nimport { codedJoinOr, docLink, showError } from \"../core/utils.js\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst w3cLogo = {\n src: \"https://www.w3.org/StyleSheets/TR/2021/logos/W3C\",\n alt: \"W3C\",\n height: 48,\n width: 72,\n url: \"https://www.w3.org/\",\n};\n\nconst memSubmissionLogo = {\n alt: \"W3C Member Submission\",\n href: \"https://www.w3.org/Submission/\",\n src: \"https://www.w3.org/Icons/member_subm-v.svg\",\n width: \"211\",\n height: \"48\",\n};\n\nconst w3cDefaults = {\n lint: {\n \"privsec-section\": false,\n \"required-sections\": true,\n \"wpt-tests-exist\": false,\n \"informative-dfn\": \"warn\",\n \"no-unused-dfns\": \"warn\",\n a11y: false,\n },\n doJsonLd: false,\n logos: [],\n xref: true,\n wgId: \"\",\n otherLinks: [],\n excludeGithubLinks: true,\n subtitle: \"\",\n prevVersion: \"\",\n formerEditors: [],\n editors: [],\n authors: [],\n};\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...w3cDefaults.lint,\n ...conf.lint,\n };\n\n Object.assign(conf, {\n ...coreDefaults,\n ...w3cDefaults,\n ...conf,\n lint,\n });\n\n if (conf.specStatus !== \"unofficial\" && !conf.hasOwnProperty(\"license\")) {\n conf.license = \"w3c-software-doc\";\n }\n\n validateStatusForGroup(conf);\n processLogos(conf);\n}\n\nfunction processLogos(conf) {\n // Primarily include the W3C logo and license for W3C Recommendation track\n // that have an actual working group.\n const { specStatus, wg } = conf;\n const isWgStatus = [\n ...recTrackStatus,\n ...registryTrackStatus,\n ...W3CNotes,\n ...tagStatus,\n \"ED\",\n ].includes(specStatus);\n const inWorkingGroup = wg && wg.length && isWgStatus;\n // Member submissions don't need to be in a Working Group.\n const doesNotNeedWG = [\"Member-SUBM\"].includes(specStatus);\n const canShowW3CLogo = inWorkingGroup || doesNotNeedWG;\n if (canShowW3CLogo) {\n conf.logos.unshift(w3cLogo);\n if (specStatus === \"Member-SUBM\") {\n conf.logos.push(memSubmissionLogo);\n }\n }\n}\n\nfunction validateStatusForGroup(conf) {\n const { specStatus, groupType, group } = conf;\n\n if (!specStatus) {\n const msg = docLink`The ${\"[specStatus]\"} configuration option is required.`;\n const hint = docLink`Select an appropriate status from ${\"[specStatus]\"} based on your W3C group. If in doubt, use \\`\"unofficial\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"base\";\n return;\n }\n\n if (status2text[specStatus] === undefined) {\n const msg = docLink`The ${\"[specStatus]\"} \"\\`${specStatus}\\`\" is not supported at for this type of document.`;\n const choices = codedJoinOr(Object.keys(status2text), { quotes: true });\n const hint = docLink`set ${\"[specStatus]\"} to one of: ${choices}.`;\n showError(msg, name, { hint });\n conf.specStatus = \"base\";\n return;\n }\n\n switch (groupType) {\n case \"cg\": {\n if (![...cgStatus, \"unofficial\", \"UD\"].includes(specStatus)) {\n const msg = docLink`W3C Community Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr(cgStatus, { quotes: true });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"CG-DRAFT\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"CG-DRAFT\";\n }\n break;\n }\n case \"bg\": {\n if (![...bgStatus, \"unofficial\", \"UD\"].includes(specStatus)) {\n const msg = docLink`W3C Business Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr(bgStatus, { quotes: true });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"BG-DRAFT\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"BG-DRAFT\";\n }\n break;\n }\n case \"wg\": {\n if (![...trStatus, \"unofficial\", \"UD\", \"ED\"].includes(specStatus)) {\n const msg = docLink`W3C Working Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const hint = docLink`Pleas see ${\"[specStatus]\"} for appropriate status for W3C Working Group documents.`;\n showError(msg, name, { hint });\n }\n break;\n }\n case \"other\":\n if (\n group === \"tag\" &&\n ![\"ED\", ...trStatus, ...tagStatus].includes(specStatus)\n ) {\n const msg = docLink`The W3C Technical Architecture Group's documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr([\"ED\", ...trStatus, ...tagStatus], {\n quotes: true,\n });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"unofficial\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"unofficial\";\n }\n break;\n default:\n if (\n !conf.wgId &&\n ![\"unofficial\", \"base\", \"UD\", \"Member-SUBM\"].includes(conf.specStatus)\n ) {\n const msg =\n \"Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.\";\n const hint = docLink`Use the ${\"[group]\"} configuration option to associated this document with a W3C group.`;\n conf.specStatus = \"base\";\n showError(msg, name, { hint });\n }\n }\n}\n","/* ReSpec specific CSS */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n@keyframes pop {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1.25, 1.25);\n opacity: 0.75;\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n\n/* --- INLINES --- */\na.internalDFN {\n color: inherit;\n border-bottom: 1px solid #99c;\n text-decoration: none;\n}\n\na.externalDFN {\n color: inherit;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\na.bibref {\n text-decoration: none;\n}\n\n.respec-offending-element:target {\n animation: pop 0.25s ease-in-out 0s 1;\n}\n\n.respec-offending-element,\na[href].respec-offending-element {\n text-decoration: red wavy underline;\n}\n@supports not (text-decoration: red wavy underline) {\n .respec-offending-element:not(pre) {\n display: inline-block;\n }\n .respec-offending-element {\n /* Red squiggly line */\n background: url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=)\n bottom repeat-x;\n }\n}\n\n#references :target {\n background: #eaf3ff;\n animation: pop 0.4s ease-in-out 0s 1;\n}\n\ncite .bibref {\n font-style: normal;\n}\n\na[href].orcid {\n padding-left: 4px;\n padding-right: 4px;\n}\n\na[href].orcid > svg {\n margin-bottom: -2px;\n}\n\n/* --- TOF --- */\nul.tof,\nol.tof {\n list-style: none outside none;\n}\n\n.caption {\n margin-top: 0.5em;\n font-style: italic;\n}\n#issue-summary > ul {\n column-count: 2;\n}\n\n#issue-summary li {\n list-style: none;\n display: inline-block;\n}\n\ndetails.respec-tests-details {\n margin-left: 1em;\n display: inline-block;\n vertical-align: top;\n}\n\ndetails.respec-tests-details > * {\n padding-right: 2em;\n}\n\ndetails.respec-tests-details[open] {\n z-index: 999999;\n position: absolute;\n border: thin solid #cad3e2;\n border-radius: 0.3em;\n background-color: white;\n padding-bottom: 0.5em;\n}\n\ndetails.respec-tests-details[open] > summary {\n border-bottom: thin solid #cad3e2;\n padding-left: 1em;\n margin-bottom: 1em;\n line-height: 2em;\n}\n\ndetails.respec-tests-details > ul {\n width: 100%;\n margin-top: -0.3em;\n}\n\ndetails.respec-tests-details > li {\n padding-left: 1em;\n}\n\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"Ā§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// The purpose of this module is to insert the default ReSpec CSS into the document.\n// If you don't want to use the default ReSpec CSS, set the `noReSpecCSS` configuration\n// option to `true`. If you want to use your own styles, create a ReSpec profile that\n// includes your own styles and sets the `noReSpecCSS` configuration option to `true`.\n\n/**\n * Module Name.\n * @type {string}\n */\nexport const name = \"core/style\";\n\nimport css from \"../styles/respec.css.js\";\n\n// Opportunistically inserts the style to reduce some FOUC.\n/** @type {HTMLStyleElement} */\nconst styleElement = insertStyle();\n\n/**\n * Inserts the ReSpec CSS as a `style` element into the document's `head`.\n * @return {HTMLStyleElement} The `style` element that was inserted.\n */\nfunction insertStyle() {\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"respec-mainstyle\";\n styleElement.textContent = css;\n document.head.appendChild(styleElement);\n return styleElement;\n}\n\n/**\n * Removes the ReSpec CSS if the `noReSpecCSS` configuration option is `true`.\n * @param {Conf} conf The document configuration object.\n */\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","// @ts-check\n/**\n * Module w3c/style\n * Inserts a link to the appropriate W3C style for the specification's maturity level.\n * */\n\nimport { W3CNotes, recTrackStatus, registryTrackStatus } from \"./headers.js\";\nimport { createResourceHint } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { sub } from \"../core/pubsubhub.js\";\n\nexport const name = \"w3c/style\";\n\nfunction attachFixupScript() {\n const script = document.createElement(\"script\");\n script.src = \"https://www.w3.org/scripts/TR/2021/fixup.js\";\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n document.body.appendChild(script);\n}\n\n// Creates a collection of resource hints to improve the loading performance\n// of the W3C resources.\nfunction createResourceHints() {\n /** @type {ResourceHintOption[]} */\n const opts = [\n {\n hint: \"preconnect\", // for W3C styles and scripts.\n href: \"https://www.w3.org\",\n },\n {\n hint: \"preload\", // all specs need it, and we attach it on end-all.\n href: \"https://www.w3.org/scripts/TR/2021/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: getStyleUrl(\"base.css\").href,\n as: \"style\",\n },\n {\n hint: \"preload\",\n href: getStyleUrl(\"dark.css\").href,\n as: \"style\",\n },\n {\n hint: \"preload\", // all specs show the logo.\n href: \"https://www.w3.org/StyleSheets/TR/2021/logos/W3C\",\n as: \"image\",\n corsMode: \"anonymous\",\n },\n ];\n const resourceHints = document.createDocumentFragment();\n for (const link of opts.map(createResourceHint)) {\n resourceHints.appendChild(link);\n }\n return resourceHints;\n}\n\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// Opportunistically apply base style\nelements.appendChild(\n html`<link\n rel=\"stylesheet\"\n href=\"https://www.w3.org/StyleSheets/TR/2021/base.css\"\n class=\"removeOnSave\"\n />`\n);\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(\n html`<meta\n name=\"viewport\"\n content=\"width=device-width, initial-scale=1, shrink-to-fit=no\"\n />`\n );\n}\n\ndocument.head.prepend(elements);\n\n/**\n * @param {URL|string} linkURL\n * @returns {(exportDoc: Document) => void}\n */\nfunction styleMover(linkURL) {\n return exportDoc => {\n const w3cStyle = exportDoc.querySelector(`head link[href=\"${linkURL}\"]`);\n exportDoc.querySelector(\"head\").append(w3cStyle);\n };\n}\n\n/**\n * @param {Conf} conf\n */\nexport function run(conf) {\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\"end-all\", attachFixupScript, { once: true });\n }\n\n const finalStyleURL = getStyleUrl(getStyleFile(conf));\n document.head.appendChild(\n html`<link rel=\"stylesheet\" href=\"${finalStyleURL.href}\" />`\n );\n // Make sure the W3C stylesheet is the last stylesheet, as required by W3C Pub Rules.\n sub(\"beforesave\", styleMover(finalStyleURL));\n\n // Add color scheme meta tag and style\n /** @type HTMLMetaElement */\n let colorScheme = document.querySelector(\"head meta[name=color-scheme]\");\n if (!colorScheme) {\n // Default to light mode during transitional period.\n colorScheme = html`<meta name=\"color-scheme\" content=\"light\" />`;\n document.head.appendChild(colorScheme);\n }\n if (colorScheme.content.includes(\"dark\")) {\n const darkModeStyleUrl = getStyleUrl(\"dark.css\");\n document.head.appendChild(\n html`<link\n rel=\"stylesheet\"\n href=\"${darkModeStyleUrl.href}\"\n media=\"(prefers-color-scheme: dark)\"\n />`\n );\n // As required by W3C Pub Rules.\n sub(\"beforesave\", styleMover(darkModeStyleUrl));\n }\n}\n\n/** @param {Conf} conf */\nfunction getStyleFile(conf) {\n const canonicalStatus = conf.specStatus?.toUpperCase() ?? \"\";\n let styleFile = \"\";\n const canUseW3CStyle =\n [\n ...recTrackStatus,\n ...registryTrackStatus,\n ...W3CNotes,\n \"ED\",\n \"MEMBER-SUBM\",\n ].includes(canonicalStatus) && conf.wgId;\n\n // Figure out which style file to use.\n switch (canonicalStatus) {\n case \"WD\":\n case \"FPWD\":\n styleFile = canUseW3CStyle ? \"W3C-WD\" : \"base.css\";\n break;\n case \"CG-DRAFT\":\n case \"CG-FINAL\":\n case \"BG-DRAFT\":\n case \"BG-FINAL\":\n styleFile = canonicalStatus.toLowerCase();\n break;\n case \"UD\":\n case \"UNOFFICIAL\":\n styleFile = \"W3C-UD\";\n break;\n case \"FINDING\":\n case \"DRAFT-FINDING\":\n case \"EDITOR-DRAFT-FINDING\":\n case \"BASE\":\n styleFile = \"base.css\";\n break;\n case \"MEMBER-SUBM\":\n styleFile = \"W3C-Member-SUBM\";\n break;\n default:\n styleFile = canUseW3CStyle ? `W3C-${conf.specStatus}` : \"base.css\";\n }\n\n return styleFile;\n}\n\nfunction getStyleUrl(styleFile = \"base.css\") {\n return new URL(`/StyleSheets/TR/2021/${styleFile}`, \"https://www.w3.org/\");\n}\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/speced/respec/wiki/github\n */\n\nimport { docLink, getIntlData, showError, showWarning } from \"../core/utils.js\";\nexport const name = \"core/github\";\n\nlet resolveGithubPromise;\nlet rejectGithubPromise;\n/** @type {Promise<{ apiBase: string, fullName: string, branch: string, repoURL: string } | null>} */\nexport const github = new Promise((resolve, reject) => {\n resolveGithubPromise = resolve;\n rejectGithubPromise = message => {\n showError(message, name);\n reject(new Error(message));\n };\n});\n\nconst localizationStrings = {\n en: {\n file_a_bug: \"File an issue\",\n participate: \"Participate:\",\n commit_history: \"Commit history\",\n },\n ko: {\n participate: \"ģ°øģ—¬\",\n },\n zh: {\n file_a_bug: \"反馈错čÆÆ\",\n participate: \"参äøŽļ¼š\",\n },\n ja: {\n commit_history: \"å¤‰ę›“å±„ę­“\",\n file_a_bug: \"問锌報告\",\n participate: \"å‚åŠ ę–¹ę³•ļ¼š\",\n },\n nl: {\n commit_history: \"Revisiehistorie\",\n file_a_bug: \"Dien een melding in\",\n participate: \"Doe mee:\",\n },\n es: {\n commit_history: \"Historia de cambios\",\n file_a_bug: \"Nota un bug\",\n participate: \"Participe:\",\n },\n de: {\n commit_history: \"Revisionen\",\n file_a_bug: \"Fehler melden\",\n participate: \"Mitmachen:\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.hasOwnProperty(\"github\") || !conf.github) {\n // nothing to do, bail out.\n resolveGithubPromise(null);\n return;\n }\n if (\n typeof conf.github === \"object\" &&\n !conf.github.hasOwnProperty(\"repoURL\")\n ) {\n const msg = docLink`Config option ${\"[github]\"} is missing property \\`repoURL\\`.`;\n rejectGithubPromise(msg);\n return;\n }\n let tempURL = conf.github.repoURL || conf.github;\n if (!tempURL.endsWith(\"/\")) tempURL += \"/\";\n /** @type URL */\n let ghURL;\n try {\n ghURL = new URL(tempURL, \"https://github.com\");\n } catch {\n const msg = docLink`${\"[github]\"} configuration option is not a valid URL? (${tempURL}).`;\n rejectGithubPromise(msg);\n return;\n }\n if (ghURL.origin !== \"https://github.com\") {\n const msg = docLink`${\"[github]\"} configuration option must be HTTPS and pointing to GitHub. (${ghURL.href}).`;\n rejectGithubPromise(msg);\n return;\n }\n const [org, repo] = ghURL.pathname.split(\"/\").filter(item => item);\n if (!org || !repo) {\n const msg = docLink`${\"[github]\"} URL needs a path. For example, \"w3c/my-spec\".`;\n rejectGithubPromise(msg);\n return;\n }\n const branch = conf.github.branch || \"gh-pages\";\n const issueBase = new URL(\"./issues/\", ghURL).href;\n const commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\n const newProps = {\n edDraftURI: `https://${org.toLowerCase()}.github.io/${repo}/`,\n githubToken: undefined,\n githubUser: undefined,\n issueBase,\n atRiskBase: issueBase,\n otherLinks: [],\n pullBase: new URL(\"./pulls/\", ghURL).href,\n shortName: repo,\n };\n // Assign new properties, but retain existing ones\n let githubAPI = \"https://respec.org/github\";\n if (conf.githubAPI) {\n if (new URL(conf.githubAPI).hostname === window.parent.location.hostname) {\n // for testing\n githubAPI = conf.githubAPI;\n } else {\n const msg =\n \"The `githubAPI` configuration option is private and should not be added manually.\";\n showWarning(msg, name);\n }\n }\n if (!conf.excludeGithubLinks) {\n const otherLink = {\n key: l10n.participate,\n data: [\n {\n value: `GitHub ${org}/${repo}`,\n href: ghURL,\n },\n {\n value: l10n.file_a_bug,\n href: newProps.issueBase,\n },\n {\n value: l10n.commit_history,\n href: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\n constructor(doc) {\n this.doc = doc;\n this.root = doc.createDocumentFragment();\n this.stack = [this.root];\n this.current = this.root;\n }\n findPosition(header) {\n return parseInt(header.tagName.charAt(1), 10);\n }\n findParent(position) {\n let parent;\n while (position > 0) {\n position--;\n parent = this.stack[position];\n if (parent) return parent;\n }\n }\n findHeader({ firstChild: node }) {\n while (node) {\n if (/H[1-6]/.test(node.tagName)) {\n return node;\n }\n node = node.nextSibling;\n }\n return null;\n }\n\n addHeader(header) {\n const section = this.doc.createElement(\"section\");\n const position = this.findPosition(header);\n\n section.appendChild(header);\n this.findParent(position).appendChild(section);\n this.stack[position] = section;\n this.stack.length = position + 1;\n this.current = section;\n }\n\n addSection(node) {\n const header = this.findHeader(node);\n const position = header ? this.findPosition(header) : 1;\n const parent = this.findParent(position);\n\n if (header) {\n node.removeChild(header);\n }\n\n node.appendChild(structure(node));\n\n if (header) {\n node.prepend(header);\n }\n\n parent.appendChild(node);\n this.current = parent;\n }\n\n addElement(node) {\n this.current.appendChild(node);\n }\n}\n/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\n if (\n structuredInternals.firstElementChild.localName === \"section\" &&\n elem.localName === \"section\"\n ) {\n const section = structuredInternals.firstElementChild;\n section.remove();\n elem.append(...section.childNodes);\n } else {\n elem.textContent = \"\";\n }\n elem.appendChild(structuredInternals);\n}\n\nexport function run() {\n restructure(document.body);\n}\n","// @ts-check\n// Module core/data-include\n// Support for the data-include attribute. Causes external content to be included inside an\n// element that has data-include='some URI'. There is also a data-oninclude attribute that\n// features a white space separated list of global methods that will be called with the\n// module object, the content, and the included URI.\n//\n// IMPORTANT:\n// This module only really works when you are in an HTTP context, and will most likely\n// fail if you are editing your documents on your local drive. That is due to security\n// restrictions in the browser.\nimport { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.js\";\n\nexport const name = \"core/data-include\";\n\n/**\n * @param {HTMLElement} el\n * @param {string} data\n * @param {object} options\n * @param {boolean} options.replace\n */\nfunction fillWithText(el, data, { replace }) {\n const { includeFormat } = el.dataset;\n let fill = data;\n if (includeFormat === \"markdown\") {\n fill = markdownToHtml(fill);\n }\n\n if (includeFormat === \"text\") {\n el.textContent = fill;\n } else {\n el.innerHTML = fill;\n }\n\n if (includeFormat === \"markdown\") {\n restructure(el);\n }\n\n if (replace) {\n el.replaceWith(...el.childNodes);\n }\n}\n\n/**\n * @param {string} rawData\n * @param {string} id\n * @param {string} url\n */\nfunction processResponse(rawData, id, url) {\n /** @type {HTMLElement} */\n const el = document.querySelector(`[data-include-id=${id}]`);\n const data = runTransforms(rawData, el.dataset.oninclude, url);\n const replace = typeof el.dataset.includeReplace === \"string\";\n fillWithText(el, data, { replace });\n // If still in the dom tree, clean up\n if (!replace) {\n removeIncludeAttributes(el);\n }\n}\n/**\n * Removes attributes after they are used for inclusion, if present.\n *\n * @param {Element} el The element to clean up.\n */\nfunction removeIncludeAttributes(el) {\n [\n \"data-include\",\n \"data-include-format\",\n \"data-include-replace\",\n \"data-include-id\",\n \"oninclude\",\n ].forEach(attr => el.removeAttribute(attr));\n}\n\nexport async function run() {\n await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\n const promisesToInclude = Array.from(includables).map(async el => {\n const url = el.dataset.include;\n if (!url) {\n return; // just skip it\n }\n const id = `include-${String(Math.random()).slice(2)}`;\n el.dataset.includeId = id;\n try {\n const response = await fetch(url);\n const text = await response.text();\n processResponse(text, id, url);\n if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\n } catch (err) {\n const msg = `\\`data-include\\` failed: \\`${url}\\` (${err.message}).`;\n showError(msg, name, { elements: [el], cause: err });\n }\n });\n await Promise.all(promisesToInclude);\n}\n","// @ts-check\n/**\n * @module core/reindent\n *\n * Normalizes indents across the pre elements in the document,\n * so that indentation inside <pre> won't affect the rendered result.\n */\nimport { reindent } from \"./utils.js\";\nexport const name = \"core/reindent\";\n\nexport function run() {\n for (const pre of document.getElementsByTagName(\"pre\")) {\n pre.innerHTML = reindent(pre.innerHTML);\n }\n}\n","/**\n * This module handles the creation of the h1#title of a spec and\n * makes sure the <title> always matches the h1.\n *\n * If no h1#title is included, then the <title> becomes the h1#title.\n *\n * When a h1#title is included, it always takes precedence over the\n * <title> of a spec. An error will be displayed in case of\n * any mismatch.\n *\n */\n\nimport { getIntlData, norm, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/title\";\n\nconst localizationStrings = {\n en: {\n default_title: \"No Title\",\n },\n de: {\n default_title: \"Kein Titel\",\n },\n zh: {\n default_title: \"ę— ę ‡é¢˜\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {HTMLElement} */\n const h1Elem =\n document.querySelector(\"h1#title\") || html`<h1 id=\"title\"></h1>`;\n\n // check existing element is ok to use\n if (h1Elem.isConnected && h1Elem.textContent.trim() === \"\") {\n const msg =\n \"The document is missing a title, so using a default title. \" +\n \"To fix this, please give your document a `<title>`. \" +\n \"If you need special markup in the document's title, \" +\n 'please use a `<h1 id=\"title\">`.';\n const title = \"Document is missing a title\";\n showError(msg, name, { title, elements: [h1Elem] });\n }\n\n // Decorate the spec title\n if (!h1Elem.id) h1Elem.id = \"title\";\n h1Elem.classList.add(\"title\");\n\n setDocumentTitle(conf, h1Elem);\n\n // This will get relocated by a template later.\n document.body.prepend(h1Elem);\n}\n\nfunction setDocumentTitle(conf, h1Elem) {\n // If the h1 is newly created, it won't be connected. In this case\n // we use the <title> or a localized fallback.\n if (!h1Elem.isConnected) {\n h1Elem.textContent = document.title || `${l10n.default_title}`;\n }\n // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.textContent);\n\n if (conf.isPreview && conf.prNumber) {\n const prUrl = conf.prUrl || `${conf.github.repoURL}pull/${conf.prNumber}`;\n const { childNodes } = html`\n Preview of PR <a href=\"${prUrl}\">#${conf.prNumber}</a>:\n `;\n h1Elem.prepend(...childNodes);\n documentTitle = `Preview of PR #${conf.prNumber}: ${documentTitle}`;\n }\n\n document.title = documentTitle;\n\n // conf.title is deperecated - we are keeping this here just to\n // retain backwards compat as we think the ePub generator\n // relies on it.\n conf.title = documentTitle;\n}\n","/**\n * This module updates the title and shortName\n * of a spec when there is a valid level configuration.\n *\n * Levels should be integers >= 0.\n *\n * @module w3c/level\n */\n\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"w3c/level\";\n/** @type {LocalizationStrings} */\nconst localizationStrings = {\n en: {\n level: \"Level\",\n },\n ja: {\n level: \"ćƒ¬ćƒ™ćƒ«\",\n },\n nl: {\n level: \"Niveau\",\n },\n de: {\n level: \"Stufe\",\n },\n zh: {\n level: \"ēŗ§åˆ«\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * Updates the title and shortName of a spec based on the level configuration.\n *\n * @param {Conf} conf - The configuration object.\n */\nexport function run(conf) {\n if (!conf.hasOwnProperty(\"level\")) return;\n\n const h1Elem = document.querySelector(\"h1#title\");\n\n const level = parseInt(conf.level);\n if (!Number.isInteger(level) || level < 0) {\n const msg = `The \\`level\\` configuration option must be a number greater or equal to 0. It is currently set to \\`${level}\\``;\n const title = \"Invalid level config.\";\n showError(msg, name, { title, elements: [h1Elem] });\n return;\n }\n\n h1Elem.append(` ${l10n.level} ${level}`);\n document.title = `${document.title} ${l10n.level} ${level}`;\n conf.shortName = `${conf.shortName}-${level}`;\n conf.level = level;\n}\n","/**\n * Module w3c/abstract\n *\n * This module handles the abstract section properly by adding necessary elements and\n * performing validations.\n *\n * @module w3c/abstract\n */\n\nimport { getIntlData, norm, renameElement, showError } from \"../core/utils.js\";\nimport { lang as docLang } from \"../core/l10n.js\";\nimport { html } from \"../core/import-maps.js\";\n\nexport const name = \"w3c/abstract\";\n\n/** @type {LocalizationStrings} */\nconst localizationStrings = {\n en: { abstract: \"Abstract\" },\n ko: { abstract: \"ģš”ģ•½\" },\n zh: { abstract: \"ę‘˜č¦\" },\n ja: { abstract: \"要ē“„\" },\n nl: { abstract: \"Samenvatting\" },\n es: { abstract: \"Resumen\" },\n de: { abstract: \"Zusammenfassung\" },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * Handles the abstract section of the document.\n */\nexport async function run() {\n const abstract = findAbstract();\n if (!abstract) {\n showError('Document must have one `<section id=\"abstract\">`.', name);\n return;\n }\n\n abstract.classList.add(\"introductory\");\n abstract.id = \"abstract\";\n if (!abstract.querySelector(\"h2\")) {\n abstract.prepend(html`<h2>${l10n.abstract}</h2>`);\n }\n}\n\n/**\n * Finds the abstract section in the document.\n *\n * @returns {HTMLElement | null} The abstract section element.\n */\nfunction findAbstract() {\n const abstract = document.getElementById(\"abstract\");\n if (abstract) {\n switch (abstract.localName) {\n case \"section\":\n return abstract;\n case \"div\":\n return renameElement(abstract, \"section\");\n default:\n showError(\"The abstract should be a `<section>` element.\", name, {\n elements: [abstract],\n });\n return abstract;\n }\n }\n\n const searchString = l10n.abstract.toLocaleLowerCase(docLang);\n for (const header of document.querySelectorAll(\"h2, h3, h4, h5, h6\")) {\n if (norm(header.textContent).toLocaleLowerCase(docLang) === searchString) {\n return header.closest(\"section\");\n }\n }\n\n return abstract;\n}\n","// @ts-check\n// Module core/data-transform\n// Support for the data-transform attribute\n// Any element in the tree that has a data-transform attribute is processed here.\n// The data-transform attribute can contain a white space separated list of functions\n// to call (these must have been defined globally). Each is called with a reference to\n// the core/utils plugin and the innerHTML of the element. The output of each is fed\n// as the input to the next, and the output of the last one replaces the HTML content\n// of the element.\n// IMPORTANT:\n// It is unlikely that you should use this module. The odds are that unless you really\n// know what you are doing, you should be using a dedicated module instead. This feature\n// is not actively supported and support for it may be dropped. It is not accounted for\n// in the test suite, and therefore could easily break.\nimport { runTransforms } from \"./utils.js\";\n\nexport const name = \"core/data-transform\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const transformables = document.querySelectorAll(\"[data-transform]\");\n transformables.forEach(el => {\n el.innerHTML = runTransforms(el.innerHTML, el.dataset.transform);\n el.removeAttribute(\"data-transform\");\n });\n}\n","// @ts-check\n// Module core/data-abbr\n// - Finds all elements with data-abbr attribute and processes them.\nimport { showError } from \"./utils.js\";\nexport const name = \"core/dfn-abbr\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elements = document.querySelectorAll(\"[data-abbr]\");\n for (const elem of elements) {\n const { localName } = elem;\n switch (localName) {\n case \"dfn\":\n processDfnElement(elem);\n break;\n default: {\n const msg = `\\`data-abbr\\` attribute not supported on \\`${localName}\\` elements.`;\n showError(msg, name, {\n elements: [elem],\n title: \"Error: unsupported.\",\n });\n }\n }\n }\n}\n/**\n * @param {HTMLElement} dfn\n */\nfunction processDfnElement(dfn) {\n const abbr = generateAbbreviation(dfn);\n // get normalized <dfn> textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (<abbr title=\"${fullForm}\">${abbr}</abbr>)`\n );\n const lt = dfn.dataset.lt || \"\";\n dfn.dataset.lt = lt\n .split(\"|\")\n .filter(i => i.trim())\n .concat(abbr)\n .join(\"|\");\n}\n\nfunction generateAbbreviation(elem) {\n if (elem.dataset.abbr) return elem.dataset.abbr;\n // Generates abbreviation from textContent\n // e.g., \"Permanent Account Number\" -> \"PAN\"\n return elem.textContent\n .match(/\\b([a-z])/gi)\n .join(\"\")\n .toUpperCase();\n}\n","// @ts-check\n// Parses an inline IDL string (`{{ idl string }}`)\n// and renders its components as HTML\n\nimport { htmlJoinComma, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst idlPrimitiveRegex = /^[a-z]+(\\s+[a-z]+)+\\??$/; // {{unrestricted double?}} {{ double }}\nconst exceptionRegex = /\\B\"([^\"]*)\"\\B/; // {{ \"SomeException\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\w+)(?:\\((?:([^\\\\)]*))\\))?)?$/;\n\nexport const slotRegex = /\\[\\[(\\w+(?: +\\w+)*)\\]\\](\\([^)]*\\))?$/;\n// matches: `value` or `[[value]]`\n// NOTE: [[value]] is actually a slot, but database has this as type=\"attribute\"\nconst attributeRegex = /^((?:\\[\\[)?(?:\\w+(?: +\\w+)*)(?:\\]\\])?)$/;\nconst baseRegex = /^(?:\\w+)\\??$/;\nconst enumRegex = /^(\\w+)\\[\"([\\w- ]*)\"\\]$/;\n// TODO: const splitRegex = /(?<=\\]\\]|\\b)\\./\n// https://github.com/speced/respec/pull/1848/files#r225087385\nconst methodSplitRegex = /\\.?(\\w+\\(.*\\)$)/;\nconst slotSplitRegex = /\\/(.+)/;\nconst isProbablySlotRegex = /\\[\\[.+\\]\\]/;\n/**\n * @typedef {object} IdlBase\n * @property {\"base\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {boolean} nullable\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlAttribute\n * @property {\"attribute\"} type\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlInternalSlot\n * @property {\"internal-slot\"} type\n * @property {string} identifier\n * @property {string[]} [args]\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n * @property {\"attribute\"|\"method\"} slotType\n *\n * @typedef {object} IdlMethod\n * @property {\"method\"} type\n * @property {string} identifier\n * @property {string[]} args\n * @property {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlEnum\n * @property {\"enum\"} type\n * @property {string} [identifier]\n * @property {string} enumValue\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlException\n * @property {\"exception\"} type\n * @property {string} identifier\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {object} IdlPrimitive\n * @property {\"idl-primitive\"} type\n * @property {boolean} nullable\n * @property {string} identifier\n * @property {boolean} renderParent\n * @property {InlineIdl | null} [parent]\n *\n * @typedef {IdlBase | IdlAttribute | IdlInternalSlot | IdlMethod | IdlEnum | IdlException | IdlPrimitive} InlineIdl\n */\n\n/**\n * @param {string} str\n * @returns {InlineIdl[]}\n */\nfunction parseInlineIDL(str) {\n // If it's got [[ string ]], then split as an internal slot\n const isSlot = isProbablySlotRegex.test(str);\n const splitter = isSlot ? slotSplitRegex : methodSplitRegex;\n const [forPart, childString] = str.split(splitter);\n if (isSlot && forPart && !childString) {\n throw new SyntaxError(\n `Internal slot missing \"for\" part. Expected \\`{{ InterfaceName/${forPart}}}\\` }.`\n );\n }\n const tokens = forPart\n .split(/[./]/)\n .concat(childString)\n .filter(s => s && s.trim())\n .map(s => s.trim());\n const renderParent = !str.includes(\"/\");\n /** @type {InlineIdl[]} */\n const results = [];\n while (tokens.length) {\n const value = tokens.pop();\n // Method\n if (methodRegex.test(value)) {\n const [, identifier, allArgs, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\n continue;\n }\n // Enum[\"enum value\"]\n if (enumRegex.test(value)) {\n const [, identifier, enumValue] = value.match(enumRegex);\n results.push({ type: \"enum\", identifier, enumValue, renderParent });\n continue;\n }\n // Exception - \"NotAllowedError\"\n // Or alternate enum syntax: {{ EnumContainer / \"some enum value\" }}\n if (exceptionRegex.test(value)) {\n const [, identifier] = value.match(exceptionRegex);\n if (renderParent) {\n results.push({ type: \"exception\", identifier });\n } else {\n results.push({ type: \"enum\", enumValue: identifier, renderParent });\n }\n continue;\n }\n // internal slot\n if (slotRegex.test(value)) {\n const [, identifier, allArgs] = value.match(slotRegex);\n const slotType = allArgs ? \"method\" : \"attribute\";\n const args = allArgs\n ?.slice(1, -1)\n .split(/,\\s*/)\n .filter(arg => arg);\n results.push({\n type: \"internal-slot\",\n slotType,\n identifier,\n args,\n renderParent,\n });\n continue;\n }\n // attribute\n if (attributeRegex.test(value) && tokens.length) {\n const [, identifier] = value.match(attributeRegex);\n results.push({ type: \"attribute\", identifier, renderParent });\n continue;\n }\n if (idlPrimitiveRegex.test(value)) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({\n type: \"idl-primitive\",\n identifier,\n renderParent,\n nullable,\n });\n continue;\n }\n // base, always final token\n if (baseRegex.test(value) && tokens.length === 0) {\n const nullable = value.endsWith(\"?\");\n const identifier = nullable ? value.slice(0, -1) : value;\n results.push({ type: \"base\", identifier, renderParent, nullable });\n continue;\n }\n throw new SyntaxError(`IDL micro-syntax parsing error in \\`{{ ${str} }}\\``);\n }\n // link the list\n results.forEach((item, i, list) => {\n item.parent = list[i + 1] || null;\n });\n // return them in the order we found them...\n return results.reverse();\n}\n\n/**\n * @param {IdlBase} details\n */\nfunction renderBase(details) {\n // Check if base is a local variable in a section\n const { identifier, renderParent, nullable } = details;\n if (renderParent) {\n return html`<a\n data-xref-type=\"_IDL_\"\n data-link-type=\"idl\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n }\n}\n\n/**\n * Internal slot: .[[identifier]] or [[identifier]]\n * @param {IdlInternalSlot} details\n */\nfunction renderInternalSlot(details) {\n const { identifier, parent, slotType, renderParent, args } = details;\n const { identifier: linkFor } = parent || {};\n const isMethod = slotType === \"method\";\n const argsHtml = isMethod\n ? html`(${htmlJoinComma(args, htmlArgMapper)})`\n : null;\n const textArgs = isMethod ? `(${args.join(\", \")})` : \"\";\n const lt = `[[${identifier}]]${textArgs}`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-xref-type=\"${slotType}\"\n data-link-type=\"${slotType}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${lt}\"\n ><code>[[${identifier}]]${argsHtml}</code></a\n >`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`<var>${str}</var>`;\n // only the last argument can be variadic\n const parts = str.split(/(^\\.{3})(.+)/);\n const isVariadic = parts.length > 1;\n const arg = isVariadic ? parts[2] : parts[0];\n return html`${isVariadic ? \"...\" : null}<var>${arg}</var>`;\n}\n/**\n * Attribute: .identifier\n * @param {IdlAttribute} details\n */\nfunction renderAttribute(details) {\n const { parent, identifier, renderParent } = details;\n const { identifier: linkFor } = parent || {};\n const element = html`${renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"attribute|dict-member|const\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n ><code>${identifier}</code></a\n >`;\n return element;\n}\n\n/**\n * Method: .identifier(arg1, arg2, ...), identifier(arg1, arg2, ...)\n * @param {IdlMethod} details\n */\nfunction renderMethod(details) {\n const { args, identifier, type, parent, renderParent } = details;\n const { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}<a\n data-link-type=\"idl\"\n data-xref-type=\"${type}\"\n data-link-for=\"${linkFor}\"\n data-xref-for=\"${linkFor}\"\n data-lt=\"${searchText}\"\n ><code>${text || identifier}</code></a\n >${!text || textArgs ? html`<code>(${argsText})</code>` : \"\"}`;\n return element;\n}\n\n/**\n * Enum:\n * Identifier[\"enum value\"]\n * Identifer / \"enum value\"\n * @param {IdlEnum} details\n */\nfunction renderEnum(details) {\n const { identifier, enumValue, parent } = details;\n const forContext = parent ? parent.identifier : identifier;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-xref-type=\"enum-value\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${!enumValue ? \"the-empty-string\" : null}\"\n ><code>${enumValue}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Exception value: \"NotAllowedError\"\n * Only the WebIDL spec can define exceptions\n * @param {IdlException} details\n */\nfunction renderException(details) {\n const { identifier } = details;\n const element = html`\"<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"exception\"\n ><code>${identifier}</code></a\n >\"`;\n return element;\n}\n\n/**\n * Interface types: {{ unrestricted double }} {{long long}}\n * Only the WebIDL spec defines these types.\n * @param {IdlPrimitive} details\n */\nfunction renderIdlPrimitiveType(details) {\n const { identifier, nullable } = details;\n const element = html`<a\n data-link-type=\"idl\"\n data-cite=\"webidl\"\n data-xref-type=\"interface\"\n data-lt=\"${identifier}\"\n ><code>${identifier + (nullable ? \"?\" : \"\")}</code></a\n >`;\n return element;\n}\n\n/**\n * Generates HTML by parsing an IDL string\n * @param {String} str IDL string\n * @return {Node} html output\n */\nexport function idlStringToHtml(str) {\n let results;\n try {\n results = parseInlineIDL(str);\n } catch (error) {\n const el = html`<span>{{ ${str} }}</span>`;\n const title = \"Error: Invalid inline IDL string.\";\n showError(error.message, \"core/inlines\", { title, elements: [el] });\n return el;\n }\n const render = html(document.createDocumentFragment());\n const output = [];\n for (const details of results) {\n switch (details.type) {\n case \"base\": {\n const base = renderBase(details);\n if (base) output.push(base);\n break;\n }\n case \"attribute\":\n output.push(renderAttribute(details));\n break;\n case \"internal-slot\":\n output.push(renderInternalSlot(details));\n break;\n case \"method\":\n output.push(renderMethod(details));\n break;\n case \"enum\":\n output.push(renderEnum(details));\n break;\n case \"exception\":\n output.push(renderException(details));\n break;\n case \"idl-primitive\":\n output.push(renderIdlPrimitiveType(details));\n break;\n default:\n throw new Error(\"Unknown type.\");\n }\n }\n const result = render`${output}`;\n return result;\n}\n","// @ts-check\n/**\n * Module core/biblio-db\n *\n * Wraps IndexedDB, allowing the storage of references and aliases on the\n * client.\n *\n * It's a standalone module that can be imported into other modules.\n *\n */\nimport { idb } from \"./import-maps.js\";\n\nexport const name = \"core/biblio-db\";\n\n/**\n * @typedef {keyof BiblioDb} AllowedType\n * @type {Set<AllowedType>}\n */\nconst ALLOWED_TYPES = new Set([\"alias\", \"reference\"]);\n/* Database initialization tracker */\nconst readyPromise = openIdb();\n\n/**\n * @typedef {object} BiblioDb\n *\n * @property {object} alias Object store for alias objects\n * @property {string} alias.key\n * @property {object} alias.value\n * @property {object} alias.indexes\n * @property {string} alias.aliasOf\n *\n * @property {object} reference Object store for reference objects\n * @property {string} reference.key\n * @property {object} reference.value\n *\n * @returns {Promise<import(\"idb\").IDBPDatabase<BiblioDb>>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = await idb.openDB(\"respec-biblio2\", 12, {\n upgrade(db) {\n Array.from(db.objectStoreNames).map(storeName =>\n db.deleteObjectStore(storeName)\n );\n const store = db.createObjectStore(\"alias\", { keyPath: \"id\" });\n store.createIndex(\"aliasOf\", \"aliasOf\", { unique: false });\n db.createObjectStore(\"reference\", { keyPath: \"id\" });\n },\n });\n // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\n}\n\nexport const biblioDB = {\n get ready() {\n return readyPromise;\n },\n /**\n * Finds either a reference or an alias.\n * If it's an alias, it resolves it.\n *\n * @param {String} id The reference or alias to look for.\n * @return {Promise<BiblioData?>} The reference or null.\n */\n async find(id) {\n if (await this.isAlias(id)) {\n id = await this.resolveAlias(id);\n }\n return await this.get(\"reference\", id);\n },\n /**\n * Checks if the database has an id for a given type.\n *\n * @param {AllowedType} type One of the ALLOWED_TYPES.\n * @param {String} id The reference to find.\n * @return {Promise<Boolean>} True if it has it, false otherwise.\n */\n async has(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return !!result;\n },\n /**\n * Checks if a given id is an alias.\n *\n * @param {String} id The reference to check.\n * @return {Promise<Boolean>} Resolves with true if found.\n */\n async isAlias(id) {\n return await this.has(\"alias\", id);\n },\n /**\n * Resolves an alias to its corresponding reference id.\n *\n * @param {String} id The id of the alias to look up.\n * @return {Promise<String>} The id of the resolved reference.\n */\n async resolveAlias(id) {\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n\n const objectStore = db.transaction(\"alias\", \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value.aliasOf : result;\n },\n /**\n * Get a reference or alias out of the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {string} id The id for what to look up.\n * @return {Promise<BiblioData?>} Resolves with the retrieved object, or null.\n */\n async get(type, id) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (!id) {\n throw new TypeError(\"id is required\");\n }\n const db = await this.ready;\n const objectStore = db.transaction(type, \"readonly\").store;\n const range = IDBKeyRange.only(id);\n const result = await objectStore.openCursor(range);\n return result ? result.value : result;\n },\n /**\n * Adds references and aliases to database. This is usually the data from\n * Specref's output (parsed JSON).\n *\n * @param {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\n if (obj.aliasOf) {\n aliasesAndRefs.alias.push(obj);\n } else {\n aliasesAndRefs.reference.push(obj);\n }\n }\n const promisesToAdd = [...ALLOWED_TYPES].flatMap(type => {\n return aliasesAndRefs[type].map(details => this.add(type, details));\n });\n await Promise.all(promisesToAdd);\n },\n /**\n * Adds a reference or alias to the database.\n *\n * @param {AllowedType} type The type as per ALLOWED_TYPES.\n * @param {BiblioData} details The object to store.\n */\n async add(type, details) {\n if (!ALLOWED_TYPES.has(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n if (typeof details !== \"object\") {\n throw new TypeError(\"details should be an object\");\n }\n if (type === \"alias\" && !details.hasOwnProperty(\"aliasOf\")) {\n throw new TypeError(\"Invalid alias object.\");\n }\n const db = await this.ready;\n let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\n return isInDB ? await store.put(details) : await store.add(details);\n },\n /**\n * Closes the underlying database.\n *\n * @return {Promise<void>} Resolves after database closes.\n */\n async close() {\n const db = await this.ready;\n db.close();\n },\n\n /**\n * Clears the underlying database\n */\n async clear() {\n const db = await this.ready;\n const storeNames = [...ALLOWED_TYPES];\n const stores = db.transaction(storeNames, \"readwrite\");\n const clearStorePromises = storeNames.map(name => {\n return stores.objectStore(name).clear();\n });\n await Promise.all(clearStorePromises);\n },\n};\n","// @ts-check\n// Module core/biblio\n// Pre-processes bibliographic references\n// Configuration:\n// - localBiblio: override or supplement the official biblio with your own.\n\nimport { biblioDB } from \"./biblio-db.js\";\nimport { createResourceHint } from \"./utils.js\";\n\n/** @type {Conf['biblio']} */\nexport const biblio = {};\n\nexport const name = \"core/biblio\";\n\nconst bibrefsURL = new URL(\"https://api.specref.org/bibrefs?refs=\");\n\n// Opportunistically dns-prefetch to bibref server, as we don't know yet\n// if we will actually need to download references yet.\nconst link = createResourceHint({\n hint: \"dns-prefetch\",\n href: bibrefsURL.origin,\n});\ndocument.head.appendChild(link);\nlet doneResolver;\n\n/** @type {Promise<Conf['biblio']>} */\nconst done = new Promise(resolve => {\n doneResolver = resolve;\n});\n\nexport async function updateFromNetwork(\n refs,\n options = { forceUpdate: false }\n) {\n const refsToFetch = [...new Set(refs)].filter(ref => ref.trim());\n // Update database if needed, if we are online\n if (!refsToFetch.length || navigator.onLine === false) {\n return null;\n }\n let response;\n try {\n response = await fetch(bibrefsURL.href + refsToFetch.join(\",\"));\n } catch (err) {\n console.error(err);\n return null;\n }\n if ((!options.forceUpdate && !response.ok) || response.status !== 200) {\n return null;\n }\n /** @type {Conf['biblio']} */\n const data = await response.json();\n // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\n } catch (err) {\n console.error(err);\n }\n return data;\n}\n\n/**\n * @param {string} key\n * @returns {Promise<BiblioData>}\n */\nexport async function resolveRef(key) {\n const biblio = await done;\n if (!biblio.hasOwnProperty(key)) {\n return null;\n }\n const entry = biblio[key];\n if (entry.aliasOf) {\n return await resolveRef(entry.aliasOf);\n }\n return entry;\n}\n\n/**\n * @param {string[]} neededRefs\n */\nasync function getReferencesFromIdb(neededRefs) {\n const idbRefs = [];\n // See if we have them in IDB\n try {\n await biblioDB.ready; // can throw\n const promisesToFind = neededRefs.map(async id => ({\n id,\n data: await biblioDB.find(id),\n }));\n idbRefs.push(...(await Promise.all(promisesToFind)));\n } catch (err) {\n // IndexedDB died, so we need to go to the network for all\n // references\n idbRefs.push(...neededRefs.map(id => ({ id, data: null })));\n console.warn(err);\n }\n\n return idbRefs;\n}\n\nexport class Plugin {\n /** @param {Conf} conf */\n constructor(conf) {\n this.conf = conf;\n }\n\n /**\n * Normative references take precedence over informative ones,\n * so any duplicates ones are removed from the informative set.\n */\n normalizeReferences() {\n const normalizedNormativeRefs = new Set(\n [...this.conf.normativeReferences].map(key => key.toLowerCase())\n );\n Array.from(this.conf.informativeReferences)\n .filter(key => normalizedNormativeRefs.has(key.toLowerCase()))\n .forEach(redundantKey =>\n this.conf.informativeReferences.delete(redundantKey)\n );\n }\n\n getRefKeys() {\n return {\n informativeReferences: Array.from(this.conf.informativeReferences),\n normativeReferences: Array.from(this.conf.normativeReferences),\n };\n }\n\n async run() {\n const finish = () => {\n doneResolver(this.conf.biblio);\n };\n if (!this.conf.localBiblio) {\n this.conf.localBiblio = {};\n }\n this.conf.biblio = biblio;\n const localAliases = Object.keys(this.conf.localBiblio)\n .filter(key => this.conf.localBiblio[key].hasOwnProperty(\"aliasOf\"))\n .map(key => this.conf.localBiblio[key].aliasOf)\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key));\n this.normalizeReferences();\n const allRefs = this.getRefKeys();\n const neededRefs = Array.from(\n new Set(\n allRefs.normativeReferences\n .concat(allRefs.informativeReferences)\n // Filter, as to not go to network for local refs\n .filter(key => !this.conf.localBiblio.hasOwnProperty(key))\n // but include local aliases which refer to external specs\n .concat(localAliases)\n .sort()\n )\n );\n\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, this.conf.localBiblio);\n finish();\n }\n}\n","// @ts-check\n// Module core/render-biblio\n// renders the biblio data pre-processed in core/biblio\n\nimport { addId, getIntlData, showError } from \"./utils.js\";\nimport { biblio } from \"./biblio.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/render-biblio\";\n\nconst localizationStrings = {\n en: {\n info_references: \"Informative references\",\n norm_references: \"Normative references\",\n references: \"References\",\n reference_not_found: \"Reference not found.\",\n },\n ko: {\n references: \"ģ°øģ”°\",\n },\n nl: {\n info_references: \"Informatieve referenties\",\n norm_references: \"Normatieve referenties\",\n references: \"Referenties\",\n },\n es: {\n info_references: \"Referencias informativas\",\n norm_references: \"Referencias normativas\",\n references: \"Referencias\",\n reference_not_found: \"Referencia no encontrada.\",\n },\n ja: {\n info_references: \"参ē…§ē”Øå‚č€ƒę–‡ēŒ®\",\n norm_references: \"č¦ēƄēš„å‚č€ƒę–‡ēŒ®\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n de: {\n info_references: \"WeiterfĆ¼hrende Informationen\",\n norm_references: \"Normen und Spezifikationen\",\n references: \"Referenzen\",\n },\n zh: {\n info_references: \"éžč§„čŒƒę€§å¼•ē”Ø\",\n norm_references: \"č§„čŒƒę€§å¼•ē”Ø\",\n references: \"å‚č€ƒę–‡ēŒ®\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nconst REF_STATUSES = new Map([\n [\"CR\", \"W3C Candidate Recommendation\"],\n [\"ED\", \"W3C Editor's Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n]);\n\nconst endWithDot = endNormalizer(\".\");\n\n/** @param {Conf} conf */\nexport function run(conf) {\n const informs = Array.from(conf.informativeReferences);\n const norms = Array.from(conf.normativeReferences);\n\n if (!informs.length && !norms.length) return;\n\n /** @type {HTMLElement} */\n const refSection =\n document.querySelector(\"section#references\") ||\n html`<section id=\"references\"></section>`;\n\n if (!document.querySelector(\"section#references > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\n }\n\n refSection.classList.add(\"appendix\");\n\n if (norms.length) {\n const sec = createReferencesSection(norms, l10n.norm_references);\n refSection.appendChild(sec);\n }\n if (informs.length) {\n const sec = createReferencesSection(informs, l10n.info_references);\n refSection.appendChild(sec);\n }\n\n document.body.appendChild(refSection);\n}\n\n/**\n * @param {string[]} refs\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createReferencesSection(refs, title) {\n const { goodRefs, badRefs } = groupRefs(refs.map(toRefContent));\n const uniqueRefs = getUniqueRefs(goodRefs);\n\n const refsToShow = uniqueRefs\n .concat(badRefs)\n .sort((a, b) =>\n a.ref.toLocaleLowerCase().localeCompare(b.ref.toLocaleLowerCase())\n );\n\n const sec = html`<section>\n <h3>${title}</h3>\n <dl class=\"bibliography\">${refsToShow.map(showRef)}</dl>\n </section>`;\n addId(sec, \"\", title);\n\n const aliases = getAliases(goodRefs);\n decorateInlineReference(uniqueRefs, aliases);\n warnBadRefs(badRefs);\n\n return sec;\n}\n\n/**\n * returns refcontent and unique key for a reference among its aliases\n * and warns about circular references\n * @param {String} ref\n * @typedef {ReturnType<typeof toRefContent>} Ref\n */\nfunction toRefContent(ref) {\n let refcontent = biblio[ref];\n let key = ref;\n const circular = new Set([key]);\n while (refcontent && refcontent.aliasOf) {\n if (circular.has(refcontent.aliasOf)) {\n refcontent = null;\n const msg = `Circular reference in biblio DB between [\\`${ref}\\`] and [\\`${key}\\`].`;\n showError(msg, name);\n } else {\n key = refcontent.aliasOf;\n refcontent = biblio[key];\n circular.add(key);\n }\n }\n if (refcontent && !refcontent.id) {\n refcontent.id = ref.toLowerCase();\n }\n return { ref, refcontent };\n}\n\n/** @param {Ref[]} refs */\nfunction groupRefs(refs) {\n const goodRefs = [];\n const badRefs = [];\n for (const ref of refs) {\n if (ref.refcontent) {\n goodRefs.push(ref);\n } else {\n badRefs.push(ref);\n }\n }\n return { goodRefs, badRefs };\n}\n\n/** @param {Ref[]} refs */\nfunction getUniqueRefs(refs) {\n /** @type {Map<string, Ref>} */\n const uniqueRefs = new Map();\n for (const ref of refs) {\n if (!uniqueRefs.has(ref.refcontent.id)) {\n // the condition ensures that only the first used [[TERM]]\n // shows up in #references section\n uniqueRefs.set(ref.refcontent.id, ref);\n }\n }\n return [...uniqueRefs.values()];\n}\n\n/**\n * Render an inline citation\n *\n * @param {String} ref the inline reference.\n * @param {String} [linkText] custom link text\n * @returns HTMLElement\n */\nexport function renderInlineCitation(ref, linkText) {\n const key = ref.replace(/^(!|\\?)/, \"\");\n const href = `#bib-${key.toLowerCase()}`;\n const text = linkText || key;\n const elem = html`<cite\n ><a class=\"bibref\" href=\"${href}\" data-link-type=\"biblio\">${text}</a></cite\n >`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\n}\n\nfunction endNormalizer(endStr) {\n return str => {\n const trimmed = str.trim();\n const result =\n !trimmed || trimmed.endsWith(endStr) ? trimmed : trimmed + endStr;\n return result;\n };\n}\n\n/** @param {BiblioData|string} ref */\nfunction stringifyReference(ref) {\n if (typeof ref === \"string\") return ref;\n let output = `<cite>${ref.title}</cite>`;\n\n output = ref.href ? `<a href=\"${ref.href}\">${output}</a>. ` : `${output}. `;\n\n if (ref.authors && ref.authors.length) {\n output += ref.authors.join(\"; \");\n if (ref.etAl) output += \" et al\";\n if (!output.endsWith(\".\")) output += \". \";\n }\n if (ref.publisher) {\n output = `${output} ${endWithDot(ref.publisher)} `;\n }\n if (ref.date) output += `${ref.date}. `;\n if (ref.status) output += `${REF_STATUSES.get(ref.status) || ref.status}. `;\n if (ref.href) output += `URL: <a href=\"${ref.href}\">${ref.href}</a>`;\n return output;\n}\n\n/**\n * get aliases for a reference \"key\"\n */\nfunction getAliases(refs) {\n return refs.reduce((aliases, ref) => {\n const key = ref.refcontent.id;\n const keys = !aliases.has(key)\n ? aliases.set(key, []).get(key)\n : aliases.get(key);\n keys.push(ref.ref);\n return aliases;\n }, new Map());\n}\n\n/**\n * fix biblio reference URLs\n * Add title attribute to references\n */\nfunction decorateInlineReference(refs, aliases) {\n refs\n .map(({ ref, refcontent }) => {\n const refUrl = `#bib-${ref.toLowerCase()}`;\n const selectors = aliases\n .get(refcontent.id)\n .map(alias => `a.bibref[href=\"#bib-${alias.toLowerCase()}\"]`)\n .join(\",\");\n const elems = document.querySelectorAll(selectors);\n return { refUrl, elems, refcontent };\n })\n .forEach(({ refUrl, elems, refcontent }) => {\n elems.forEach(a => {\n a.setAttribute(\"href\", refUrl);\n a.setAttribute(\"title\", refcontent.title);\n a.dataset.linkType = \"biblio\";\n });\n });\n}\n\n/**\n * warn about bad references\n */\nfunction warnBadRefs(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\n }\n}\n","// @ts-check\n// Module core/inlines\n// Process all manners of inline information. These are done together despite it being\n// seemingly a better idea to orthogonalise them. The issue is that processing text nodes\n// is harder to orthogonalise, and in some browsers can also be particularly slow.\n// Things that are recognised are <abbr>/<acronym> which when used once are applied\n// throughout the document, [[REFERENCES]]/[[!REFERENCES]], {{ IDL }} and RFC2119 keywords.\n\nimport {\n InsensitiveStringSet,\n getIntlData,\n getTextNodes,\n norm,\n refTypeFromContext,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { idlStringToHtml } from \"./inline-idl-parser.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\n\nexport const name = \"core/inlines\";\nexport const rfc2119Usage = {};\n\n/** @param {RegExp[]} regexes */\nconst joinRegex = regexes => new RegExp(regexes.map(re => re.source).join(\"|\"));\n\nconst localizationStrings = {\n en: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUST(?:\\s+NOT)?\\b/,\n /\\bSHOULD(?:\\s+NOT)?\\b/,\n /\\bSHALL(?:\\s+NOT)?\\b/,\n /\\bMAY\\b/,\n /\\b(?:NOT\\s+)?REQUIRED\\b/,\n /\\b(?:NOT\\s+)?RECOMMENDED\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n de: {\n rfc2119Keywords() {\n return joinRegex([\n /\\bMUSS\\b/,\n /\\bMƜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NƖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDƜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKƖNNEN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:<!`) at the start when Firefox + Safari\n// add support.\nconst inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code`\nconst inlineIdlReference = /(?:{{[^}]+\\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }}\nconst inlineVariable = /\\B\\|\\w[\\w\\s]*(?:\\s*:[\\w\\s&;\"?<>]+\\??)?\\|\\B/; // |var : Type?|\nconst inlineCitation = /(?:\\[\\[(?:!|\\\\|\\?)?[\\w.-]+(?:|[^\\]]+)?\\]\\])/; // [[citation]]\nconst inlineExpansion = /(?:\\[\\[\\[(?:!|\\\\|\\?)?#?[\\w-.]+\\]\\]\\])/; // [[[expand]]]\nconst inlineAnchor = /(?:\\[=[^=]+=\\])/; // Inline [= For/link =]\nconst inlineElement = /(?:\\[\\^[^^]+\\^\\])/; // Inline [^element^]\n\n/**\n * @example [^iframe^] // [^element^]\n * @example [^iframe/allow^] // [^element/element-attr^]\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineElementMatches(matched) {\n const value = matched.slice(2, -2).trim();\n const [forPart, attribute, attrValue] = value\n .split(\"/\", 3)\n .map(s => s && s.trim())\n .filter(s => !!s);\n\n const [xrefType, xrefFor, textContent] = (() => {\n // [^ /role ^], for example\n const isGlobalAttr = value.startsWith(\"/\");\n if (isGlobalAttr) {\n return [\"element-attr\", null, forPart];\n } else if (attrValue) {\n return [\"attr-value\", `${forPart}/${attribute}`, attrValue];\n } else if (attribute) {\n return [\"element-attr\", forPart, attribute];\n } else {\n return [\"element\", null, forPart];\n }\n })();\n return html`<code\n ><a\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-for=\"${xrefFor}\"\n >${textContent}</a\n ></code\n >`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`<em class=\"rfc2119\">${value}</em>`;\n // remember which ones were used\n rfc2119Usage[value] = true;\n return nodeElement;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRefMatches(matched) {\n // slices \"[[[\" at the beginning and \"]]]\" at the end\n const ref = matched.slice(3, -3).trim();\n if (!ref.startsWith(\"#\")) {\n return html`<a data-cite=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></a>`;\n}\n\n/**\n * @param {string} matched\n * @param {Text} text\n */\nfunction inlineXrefMatches(matched, text) {\n // slices \"{{\" at the beginning and \"}}\" at the end\n const ref = norm(matched.slice(2, -2));\n if (ref.startsWith(\"\\\\\")) {\n return matched.replace(\"\\\\\", \"\");\n }\n\n const node = idlStringToHtml(ref);\n // If it's inside a dfn or a `a`, it should just be coded, not linked.\n // This is because dfn elements are treated as links by ReSpec via role=link.\n const renderAsCode = !!text.parentElement.closest(\"dfn,a\");\n return renderAsCode ? inlineCodeMatches(`\\`${node.textContent}\\``) : node;\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Object} conf\n * @return {Iterable<string | Node>}\n */\nfunction inlineBibrefMatches(matched, txt, conf) {\n // slices \"[[\" at the start and \"]]\" at the end\n const ref = matched.slice(2, -2);\n if (ref.startsWith(\"\\\\\")) {\n return [`[[${ref.slice(1)}]]`];\n }\n\n const [spec, linkText] = ref.split(\"|\").map(norm);\n const { type, illegal } = refTypeFromContext(spec, txt.parentElement);\n const cite = renderInlineCitation(spec, linkText);\n const cleanRef = spec.replace(/^(!|\\?)/, \"\");\n if (illegal && !conf.normativeReferences.has(cleanRef)) {\n const citeElem = cite.childNodes[1] || cite;\n const msg = `Normative references in informative sections are not allowed. `;\n const hint = `Remove '!' from the start of the reference \\`[[${ref}]]\\``;\n showWarning(msg, name, { elements: [citeElem], hint });\n }\n\n if (type === \"informative\" && !illegal) {\n conf.informativeReferences.add(cleanRef);\n } else {\n conf.normativeReferences.add(cleanRef);\n }\n return cite.childNodes[1] ? cite.childNodes : [cite];\n}\n\n/**\n * @param {string} matched\n * @param {Text} txt\n * @param {Map<string, string>} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`<abbr title=\"${abbrMap.get(matched)}\">${matched}</abbr>`;\n}\n\n/**\n * @example |varName: type| => <var data-type=\"type\">varName</var>\n * @example |varName| => <var>varName</var>\n * @param {string} matched\n */\nfunction inlineVariableMatches(matched) {\n // remove \"|\" at the beginning and at the end, then split at an optional `:`\n const matches = matched.slice(1, -1).split(\":\", 2);\n const [varName, type] = matches.map(s => s.trim());\n return html`<var data-type=\"${type}\">${varName}</var>`;\n}\n\n/**\n * @example [= foo =] => <a>foo</a>\n * @example [= bar/foo =] => <a data-link-for=\"bar\" data-xref-for=\"bar\">foo</a>\n * @example [= `foo` =] => <a><code>foo</code></a>\n * @example [= foo|bar =] => <a data-lt=\"foo\">bar</a>\n * @param {string} matched\n */\nfunction inlineAnchorMatches(matched) {\n matched = matched.slice(2, -2); // Chop [= =]\n const parts = splitByFor(matched);\n const [isFor, content] = parts.length === 2 ? parts : [null, parts[0]];\n const [linkingText, text] = content.includes(\"|\")\n ? content.split(\"|\", 2).map(s => s.trim())\n : [null, content];\n const processedContent = processInlineContent(text);\n const forContext = isFor ? norm(isFor) : null;\n return html`<a\n data-link-type=\"dfn|abstract-op\"\n data-link-for=\"${forContext}\"\n data-xref-for=\"${forContext}\"\n data-lt=\"${linkingText}\"\n >${processedContent}</a\n >`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`<code>${clean}</code>`;\n}\n\nfunction processInlineContent(text) {\n if (inlineCodeRegExp.test(text)) {\n // We use a capture group to split, so we can process all the parts.\n return text.split(/(`[^`]+`)(?!`)/).map(part => {\n return part.startsWith(\"`\")\n ? inlineCodeMatches(part)\n : processInlineContent(part);\n });\n }\n return document.createTextNode(text);\n}\n\nexport function run(conf) {\n const abbrMap = new Map();\n document.normalize();\n if (!document.querySelector(\"section#conformance\")) {\n // make the document informative\n document.body.classList.add(\"informative\");\n }\n conf.normativeReferences = new InsensitiveStringSet();\n conf.informativeReferences = new InsensitiveStringSet();\n\n if (!conf.respecRFC2119) conf.respecRFC2119 = rfc2119Usage;\n\n // PRE-PROCESSING\n /** @type {NodeListOf<HTMLElement>} */\n const abbrElements = document.querySelectorAll(\"abbr[title]:not(.exclude)\");\n for (const { textContent, title } of abbrElements) {\n const key = norm(textContent);\n const value = norm(title);\n abbrMap.set(key, value);\n }\n const abbrRx = abbrMap.size\n ? new RegExp(`(?:\\\\b${[...abbrMap.keys()].join(\"\\\\b)|(?:\\\\b\")}\\\\b)`)\n : null;\n\n // PROCESSING\n // Don't gather text nodes for these:\n const exclusions = [\"#respec-ui\", \".head\", \"pre\", \"svg\"];\n const txts = getTextNodes(document.body, exclusions, {\n wsNodes: false, // we don't want nodes with just whitespace\n });\n const keywords = l10n.rfc2119Keywords();\n\n const inlinesRegex = new RegExp(\n `(${\n joinRegex([\n keywords,\n inlineIdlReference,\n inlineVariable,\n inlineCitation,\n inlineExpansion,\n inlineAnchor,\n inlineCodeRegExp,\n inlineElement,\n ...(abbrRx ? [abbrRx] : []),\n ]).source\n })`\n );\n for (const txt of txts) {\n const subtxt = txt.data.split(inlinesRegex);\n if (subtxt.length === 1) continue;\n const df = document.createDocumentFragment();\n let matched = true;\n for (const t of subtxt) {\n matched = !matched;\n if (!matched) {\n df.append(t);\n continue;\n }\n switch (true) {\n case t.startsWith(\"{{\"):\n df.append(inlineXrefMatches(t, txt));\n break;\n case t.startsWith(\"[[[\"):\n df.append(inlineRefMatches(t));\n break;\n case t.startsWith(\"[[\"):\n df.append(...inlineBibrefMatches(t, txt, conf));\n break;\n case t.startsWith(\"|\"):\n df.append(inlineVariableMatches(t));\n break;\n case t.startsWith(\"[=\"):\n df.append(inlineAnchorMatches(t));\n break;\n case t.startsWith(\"`\"):\n df.append(inlineCodeMatches(t));\n break;\n case t.startsWith(\"[^\"):\n df.append(inlineElementMatches(t));\n break;\n case abbrMap.has(t):\n df.append(inlineAbbrMatches(t, txt, abbrMap));\n break;\n case keywords.test(t):\n df.append(inlineRFC2119Matches(t));\n break;\n }\n }\n txt.replaceWith(df);\n }\n}\n\n/**\n * Linking strings are always composed of:\n *\n * (for-part /)+ linking-text\n *\n * E.g., \" ReadableStream / set up / pullAlgorithm \".\n * Where \"ReadableStream/set up/\" is for-part, and \"pullAlgorithm\" is\n * the linking-text.\n *\n * The for part is optional, but when present can be two or three levels deep.\n *\n * @param {string} str\n *\n */\nfunction splitByFor(str) {\n /** @param {string} str */\n const cleanUp = str => str.replace(\"%%\", \"/\").split(\"/\").map(norm).join(\"/\");\n const safeStr = str.replace(\"\\\\/\", \"%%\");\n const lastSlashIdx = safeStr.lastIndexOf(\"/\");\n if (lastSlashIdx === -1) {\n return [cleanUp(safeStr)];\n }\n const forPart = safeStr.substring(0, lastSlashIdx);\n const linkingText = safeStr.substring(lastSlashIdx + 1, safeStr.length);\n return [cleanUp(forPart), cleanUp(linkingText)];\n}\n","// @ts-check\n// Module w3c/conformance\n// Handle the conformance section properly.\nimport { getIntlData, htmlJoinAnd, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { renderInlineCitation } from \"../core/render-biblio.js\";\nimport { rfc2119Usage } from \"../core/inlines.js\";\nexport const name = \"w3c/conformance\";\n\nconst localizationStrings = {\n en: {\n conformance: \"Conformance\",\n normativity:\n \"As well as sections marked as non-normative, all authoring guidelines, \" +\n \"diagrams, examples, and notes in this specification are non-normative. \" +\n \"Everything else in this specification is normative.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n The key word${plural ? \"s\" : \"\"} ${keywords} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n when, and only when, they appear in all capitals, as shown here.\n </p>`;\n },\n },\n de: {\n conformance: \"Anforderungen\",\n normativity:\n \"Neben den explizit als nicht-normativ gekennzeichneten Abschnitten \" +\n \"sind auch alle Diagramme, Beispiele und Hinweise in diesem Dokument \" +\n \"nicht normativ. Alle anderen Angaben sind normativ.\",\n keywordInterpretation(keywords, plural) {\n return html`<p>\n ${plural ? \"Die SchlĆ¼sselwƶrter\" : \"Das SchlĆ¼sselwort\"} ${keywords} in\n diesem Dokument ${plural ? \"sind\" : \"ist\"} gemƤƟ\n <a href=\"https://datatracker.ietf.org/doc/html/bcp14\">BCP 14</a>\n ${renderInlineCitation(\"RFC2119\")} ${renderInlineCitation(\"RFC8174\")}\n und unter BerĆ¼cksichtigung von\n <a href=\"https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst\"\n >2119de</a\n >\n zu interpretieren, wenn und nur wenn ${plural ? \"sie\" : \"es\"} wie hier\n gezeigt durchgehend groƟ geschrieben wurde${plural ? \"n\" : \"\"}.\n </p>`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n const terms = [...Object.keys(rfc2119Usage)];\n // Add RFC2119 to bibliography\n if (terms.length) {\n conf.normativeReferences.add(\"RFC2119\");\n conf.normativeReferences.add(\"RFC8174\");\n }\n // Put in the 2119 clause and reference\n const keywords = htmlJoinAnd(\n terms.sort(),\n item => html`<em class=\"rfc2119\">${item}</em>`\n );\n const plural = terms.length > 1;\n const content = html`\n <h1>${l10n.conformance}</h1>\n <p>${l10n.normativity}</p>\n ${terms.length ? l10n.keywordInterpretation(keywords, plural) : null}\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run(conf) {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance && !conformance.classList.contains(\"override\")) {\n processConformance(conformance, conf);\n }\n // Warn when there are RFC2119/RFC8174 keywords, but not conformance section\n if (!conformance && Object.keys(rfc2119Usage).length) {\n const msg = `Document uses RFC2119 keywords but lacks a conformance section.`;\n const hint = 'Please add a `<section id=\"conformance\">`.';\n showWarning(msg, name, { hint });\n }\n}\n","import { MIMEType } from \"./import-maps.js\";\nimport { showError } from \"./utils.js\";\n\n/**\n * Validates MIME types strings.\n *\n * @type {DefinitionValidator} */\nexport function validateMimeType(text, type, elem, pluginName) {\n try {\n // Constructor can throw.\n const type = new MIMEType(text);\n if (type.toString() !== text) {\n throw new Error(`Input doesn't match its canonical form: \"${type}\".`);\n }\n } catch (error) {\n const msg = `Invalid ${type} \"${text}\": ${error.message}.`;\n const hint =\n \"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`).\";\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n }\n return true;\n}\n\n/**\n * Validates the names of DOM attribute and elements.\n * @param {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\n document.createAttribute(text);\n return true;\n case \"element\":\n document.createElement(text);\n return true;\n }\n } catch (err) {\n const msg = `Invalid ${type} name \"${text}\": ${err.message}`;\n const hint = `Check that the ${type} name is allowed per the XML's Name production for ${type}.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n }\n return false;\n}\n\n/**\n * Validates common variable or other named thing in a spec, like event names.\n *\n * @type {DefinitionValidator}\n */\nexport function validateCommonName(text, type, elem, pluginName) {\n // Check a-z, maybe a dash and letters, case insensitive.\n // Also, no spaces.\n if (/^[a-z]+(-[a-z]+)*$/i.test(text)) {\n return true; // all good\n }\n const msg = `Invalid ${type} name \"${text}\".`;\n const hint = `Check that the ${type} name is allowed per the naming rules for this type.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n\n/**\n * @type {DefinitionValidator} */\nexport function validateQuotedString(text, type, elem, pluginName) {\n if (text.startsWith(`\"`) && text.endsWith(`\"`)) {\n return validateCommonName(text.slice(1, -1), type, elem, pluginName);\n }\n const msg = `Invalid ${type} \"${text}\".`;\n const hint = `Check that the ${type} is quoted with double quotes.`;\n showError(msg, pluginName, { hint, elements: [elem] });\n return false;\n}\n","// @ts-check\nimport { CaseInsensitiveMap } from \"./utils.js\";\n\n/** @type {CaseInsensitiveMap<Set<HTMLElement>>} */\nexport const definitionMap = new CaseInsensitiveMap();\n\n/**\n * @param {HTMLElement} dfn A definition element to register\n * @param {string[]} names Names to register the element by\n */\nexport function registerDefinition(dfn, names) {\n for (const name of names) {\n if (!definitionMap.has(name)) {\n definitionMap.set(name, new Set());\n }\n definitionMap.get(name).add(dfn);\n }\n}\n","// @ts-check\n// Module core/dfn\n// - Finds all <dfn> elements and populates definitionMap to identify them.\n\nimport {\n codedJoinOr,\n docLink,\n getDfnTitles,\n norm,\n showError,\n toMDCode,\n} from \"./utils.js\";\nimport {\n validateCommonName,\n validateDOMName,\n validateMimeType,\n validateQuotedString,\n} from \"./dfn-validators.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\nimport { slotRegex } from \"./inline-idl-parser.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map<string, { requiresFor: boolean, validator?: DefinitionValidator, associateWith?: string}>} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"event\", { requiresFor: false, validator: validateCommonName }],\n [\"http-header\", { requiresFor: false }],\n [\"media-type\", { requiresFor: false, validator: validateMimeType }],\n [\"scheme\", { requiresFor: false, validator: validateCommonName }],\n [\"permission\", { requiresFor: false, validator: validateQuotedString }],\n]);\n\nconst knownTypes = [...knownTypesMap.keys()];\n\nexport function run() {\n for (const dfn of document.querySelectorAll(\"dfn\")) {\n const titles = getDfnTitles(dfn);\n registerDefinition(dfn, titles);\n\n // It's a legacy cite or redefining a something it doesn't own, so it gets no benefit.\n if (dfn.dataset.cite && /\\b#\\b/.test(dfn.dataset.cite)) {\n continue;\n }\n\n const [linkingText] = titles;\n computeType(dfn, linkingText);\n computeExport(dfn);\n\n // Only add `lt`s that are different from the text content\n if (titles.length === 1 && linkingText === norm(dfn.textContent)) {\n continue;\n }\n dfn.dataset.lt = titles.join(\"|\");\n }\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} linkingText\n * */\nfunction computeType(dfn, linkingText) {\n let type = \"\";\n\n switch (true) {\n // class defined type (e.g., \"<dfn class=\"element\">)\n case knownTypes.some(name => dfn.classList.contains(name)):\n // First one wins\n type = [...dfn.classList].find(className => knownTypesMap.has(className));\n validateDefinition(linkingText, type, dfn);\n break;\n\n // Internal slots: attributes+ methods (e.g., [[some words]](with, optional, arguments))\n case slotRegex.test(linkingText):\n type = processAsInternalSlot(linkingText, dfn);\n break;\n }\n\n // Derive closest type\n if (!type && !dfn.matches(\"[data-dfn-type]\")) {\n /** @type {HTMLElement} */\n const closestType = dfn.closest(\"[data-dfn-type]\");\n type = closestType?.dataset.dfnType;\n }\n // only if we have type and one wasn't explicitly given.\n if (type && !dfn.dataset.dfnType) {\n dfn.dataset.dfnType = type;\n }\n // Finally, addContractDefaults() will add the type to the dfn if it's not there.\n // But other modules may end up adding a type (e.g., the WebIDL module)\n}\n\n// Deal with export/no export\nfunction computeExport(dfn) {\n switch (true) {\n // Error if we have both exports and no exports.\n case dfn.matches(\".export.no-export\"): {\n const msg = docLink`Declares both \"${\"[no-export]\"}\" and \"${\"[export]\"}\" CSS class.`;\n const hint = \"Please use only one.\";\n showError(msg, name, { elements: [dfn], hint });\n break;\n }\n\n // No export wins\n case dfn.matches(\".no-export, [data-noexport]\"):\n if (dfn.matches(\"[data-export]\")) {\n const msg = docLink`Declares ${\"[no-export]\"} CSS class, but also has a \"${\"[data-export]\"}\" attribute.`;\n const hint = \"Please chose only one.\";\n showError(msg, name, { elements: [dfn], hint });\n delete dfn.dataset.export;\n }\n dfn.dataset.noexport = \"\";\n break;\n\n // If the author explicitly asked for it to be exported, so let's export it.\n case dfn.matches(\":is(.export):not([data-noexport], .no-export)\"):\n dfn.dataset.export = \"\";\n break;\n }\n}\n\n/**\n * @param {string} text\n * @param {string} type\n * @param {HTMLElement} dfn\n */\nfunction validateDefinition(text, type, dfn) {\n const entry = knownTypesMap.get(type);\n if (entry.requiresFor && !dfn.dataset.dfnFor) {\n const msg = docLink`Definition of type \"\\`${type}\\`\" requires a ${\"[data-dfn-for]\"} attribute.`;\n const { associateWith } = entry;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this with ${associateWith}.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n if (entry.validator) {\n entry.validator(text, type, dfn, name);\n }\n}\n\n/**\n *\n * @param {string} title\n * @param {HTMLElement} dfn\n */\nfunction processAsInternalSlot(title, dfn) {\n if (!dfn.dataset.hasOwnProperty(\"idl\")) {\n dfn.dataset.idl = \"\";\n }\n\n // Automatically use the closest data-dfn-for as the parent.\n /** @type HTMLElement */\n const parent = dfn.closest(\"[data-dfn-for]\");\n if (dfn !== parent && parent?.dataset.dfnFor) {\n dfn.dataset.dfnFor = parent.dataset.dfnFor;\n }\n\n // Assure that it's data-dfn-for= something.\n if (!dfn.dataset.dfnFor) {\n const msg = `Internal slot \"${title}\" must be associated with a WebIDL interface.`;\n const hint = docLink`Use a ${\"[data-dfn-for]\"} attribute to associate this dfn with a WebIDL interface.`;\n showError(msg, name, { hint, elements: [dfn] });\n }\n\n // Don't export internal slots by default, as they are not supposed to be public.\n if (!dfn.matches(\".export, [data-export]\")) {\n dfn.dataset.noexport = \"\";\n }\n\n // If it ends with a ), then it's method. Attribute otherwise.\n const derivedType = title.endsWith(\")\") ? \"method\" : \"attribute\";\n if (!dfn.dataset.dfnType) {\n return derivedType;\n }\n\n // Perform validation on the dfn's type.\n const allowedSlotTypes = [\"attribute\", \"method\"];\n const { dfnType } = dfn.dataset;\n if (!allowedSlotTypes.includes(dfnType) || derivedType !== dfnType) {\n const msg = docLink`Invalid ${\"[data-dfn-type]\"} attribute on internal slot.`;\n const prettyTypes = codedJoinOr(allowedSlotTypes, {\n quotes: true,\n });\n const hint = `The only allowed types are: ${prettyTypes}. The slot \"${title}\" seems to be a \"${toMDCode(\n derivedType\n )}\"?`;\n showError(msg, name, { hint, elements: [dfn] });\n return \"dfn\";\n }\n return dfnType;\n}\n","// @ts-check\n// Adds automatic pluralization to dfns\n// If a dfn is referenced as it's plural (and plural of `data-lt` attributes),\n// plurals of it are automatically added to `data-plurals`.\n// The linking is done in core/link-to-dfn\n\nimport { norm as normalize } from \"./utils.js\";\nimport { pluralize } from \"./import-maps.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/pluralize\";\n\nexport function run(conf) {\n if (!conf.pluralize) return;\n\n const pluralizeDfn = getPluralizer();\n\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\n \"dfn:not([data-lt-no-plural]):not([data-lt-noDefault])\"\n );\n dfns.forEach(dfn => {\n const terms = [dfn.textContent];\n if (dfn.dataset.lt) terms.push(...dfn.dataset.lt.split(\"|\"));\n if (dfn.dataset.localLt) {\n terms.push(...dfn.dataset.localLt.split(\"|\"));\n }\n\n const plurals = new Set(terms.map(pluralizeDfn).filter(plural => plural));\n\n if (plurals.size) {\n const userDefinedPlurals = dfn.dataset.plurals\n ? dfn.dataset.plurals.split(\"|\")\n : [];\n const uniquePlurals = [...new Set([...userDefinedPlurals, ...plurals])];\n dfn.dataset.plurals = uniquePlurals.join(\"|\");\n registerDefinition(dfn, uniquePlurals);\n }\n });\n}\n\nfunction getPluralizer() {\n /** @type {Set<string>} */\n const links = new Set();\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const reflessAnchors = document.querySelectorAll(\"a:not([href])\");\n reflessAnchors.forEach(el => {\n const normText = normalize(el.textContent).toLowerCase();\n links.add(normText);\n if (el.dataset.lt) {\n links.add(el.dataset.lt);\n }\n });\n\n /** @type {Set<string>} */\n const dfnTexts = new Set();\n /** @type {NodeListOf<HTMLElement>} */\n const dfns = document.querySelectorAll(\"dfn:not([data-lt-noDefault])\");\n dfns.forEach(dfn => {\n const normText = normalize(dfn.textContent).toLowerCase();\n dfnTexts.add(normText);\n if (dfn.dataset.lt) {\n dfn.dataset.lt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n if (dfn.dataset.localLt) {\n dfn.dataset.localLt.split(\"|\").forEach(lt => dfnTexts.add(lt));\n }\n });\n\n // returns pluralized/singularized term if `text` needs pluralization/singularization, \"\" otherwise\n return function pluralizeDfn(/** @type {string} */ text) {\n const normText = normalize(text).toLowerCase();\n const plural = pluralize.isSingular(normText)\n ? pluralize.plural(normText)\n : pluralize.singular(normText);\n return links.has(plural) && !dfnTexts.has(plural) ? plural : \"\";\n };\n}\n","/* --- EXAMPLES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nspan.example-title {\n text-transform: none;\n}\n\n:is(aside,div).example,\ndiv.illegal-example {\n padding: 0.5em;\n margin: 1em 0;\n position: relative;\n clear: both;\n}\n\ndiv.illegal-example {\n color: red;\n}\n\ndiv.illegal-example p {\n color: black;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n`;\n","// @ts-check\n// Module core/examples\n// Manages examples, including marking them up, numbering, inserting the title,\n// and reindenting.\n// Examples are any pre element with class \"example\" or \"illegal-example\".\n// When an example is found, it is reported using the \"example\" event. This can\n// be used by a containing shell to extract all examples.\n\nimport { addId, getIntlData } from \"./utils.js\";\nimport css from \"../styles/examples.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/examples\";\n\nconst localizationStrings = {\n en: {\n example: \"Example\",\n },\n nl: {\n example: \"Voorbeeld\",\n },\n es: {\n example: \"Ejemplo\",\n },\n ko: {\n example: \"ģ˜ˆģ‹œ\",\n },\n ja: {\n example: \"例\",\n },\n de: {\n example: \"Beispiel\",\n },\n zh: {\n example: \"例\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {number} number\n * @property {boolean} illegal\n * @property {string} [title]\n * @property {string} [content]\n *\n * @param {HTMLElement} elem\n * @param {number} num\n * @param {Report} report\n */\nfunction makeTitle(elem, num, report) {\n report.title = elem.title;\n if (report.title) elem.removeAttribute(\"title\");\n const number = num > 0 ? ` ${num}` : \"\";\n const title = report.title\n ? html`<span class=\"example-title\">: ${report.title}</span>`\n : \"\";\n return html`<div class=\"marker\">\n <a class=\"self-link\">${l10n.example}<bdi>${number}</bdi></a\n >${title}\n </div>`;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const examples = document.querySelectorAll(\n \"pre.example, pre.illegal-example, aside.example\"\n );\n if (!examples.length) return;\n\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n let number = 0;\n examples.forEach(example => {\n const illegal = example.classList.contains(\"illegal-example\");\n /** @type {Report} */\n const report = {\n number,\n illegal,\n };\n const { title } = example;\n if (example.localName === \"aside\") {\n ++number;\n const div = makeTitle(example, number, report);\n example.prepend(div);\n const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\n } else {\n const inAside = !!example.closest(\"aside\");\n if (!inAside) ++number;\n\n report.content = example.innerHTML;\n\n // wrap\n example.classList.remove(\"example\", \"illegal-example\");\n // relocate the id to the div\n const id = example.id ? example.id : null;\n if (id) example.removeAttribute(\"id\");\n const exampleTitle = makeTitle(example, inAside ? 0 : number, report);\n const div = html`<div class=\"example\" id=\"${id}\">\n ${exampleTitle} ${example.cloneNode(true)}\n </div>`;\n addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\n }\n });\n}\n","/* --- ISSUES/NOTES --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.issue-label {\n text-transform: initial;\n}\n\n.warning > p:first-child {\n margin-top: 0;\n}\n.warning {\n padding: 0.5em;\n border-left-width: 0.5em;\n border-left-style: solid;\n}\nspan.warning {\n padding: 0.1em 0.5em 0.15em;\n}\n\n.issue.closed span.issue-number {\n text-decoration: line-through;\n}\n\n.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\n}\n\n.warning {\n border-color: #f11;\n border-color: var(--warning-border, #f11);\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\n background: var(--warning-bg, #fbe9e9);\n color: black;\n color: var(--text, black);\n}\n\n.warning-title:before {\n content: \"āš \"; /*U+26A0 WARNING SIGN*/\n font-size: 1.3em;\n float: left;\n padding-right: 0.3em;\n margin-top: -0.3em;\n}\n\nli.task-list-item {\n list-style: none;\n}\n\ninput.task-list-item-checkbox {\n margin: 0 0.35em 0.25em -1.6em;\n vertical-align: middle;\n}\n\n.issue a.respec-gh-label {\n padding: 5px;\n margin: 0 2px 0 2px;\n font-size: 10px;\n text-transform: none;\n text-decoration: none;\n font-weight: bold;\n border-radius: 4px;\n position: relative;\n bottom: 2px;\n border: none;\n display: inline-block;\n}\n`;\n","// @ts-check\n// Module core/issues-notes\n// Manages issues and notes, including marking them up, numbering, inserting the title,\n// and injecting the style sheet.\n// These are elements with classes \"issue\" or \"note\".\n// When an issue or note is found, it is reported using the \"issue\" or \"note\" event. This can\n// be used by a containing shell to extract all of these.\n// Issues are automatically numbered by default, but you can assign them specific numbers (or,\n// despite the name, any arbitrary identifier) using the data-number attribute. Note that as\n// soon as you use one data-number on any issue all the other issues stop being automatically\n// numbered to avoid involuntary clashes.\n// If the configuration has issueBase set to a non-empty string, and issues are\n// manually numbered, a link to the issue is created using issueBase and the issue number\nimport {\n addId,\n getIntlData,\n parents,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport css from \"../styles/issues-notes.css.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/issues-notes\";\n\nconst localizationStrings = {\n en: {\n editors_note: \"Editor's note\",\n feature_at_risk: \"(Feature at Risk) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue summary\",\n no_issues_in_spec: \"There are no issues listed in this specification.\",\n note: \"Note\",\n warning: \"Warning\",\n },\n ja: {\n note: \"ę³Ø\",\n editors_note: \"ē·Ø者ę³Ø\",\n feature_at_risk: \"(å¤‰ę›“ć®åÆčƒ½ę€§ć®ć‚ć‚‹ę©Ÿčƒ½) Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue 恮要ē“„\",\n no_issues_in_spec: \"ć“ć®ä»•ę§˜ć«ćÆęœŖč§£ę±ŗ恮 issues ćÆå«ć¾ć‚Œć¦ć„ć¾ć›ć‚“ļ¼Ž\",\n warning: \"č­¦å‘Š\",\n },\n nl: {\n editors_note: \"Redactionele noot\",\n issue_summary: \"Lijst met issues\",\n no_issues_in_spec: \"Er zijn geen problemen vermeld in deze specificatie.\",\n note: \"Noot\",\n warning: \"Waarschuwing\",\n },\n es: {\n editors_note: \"Nota de editor\",\n issue: \"CuestiĆ³n\",\n issue_summary: \"Resumen de la cuestiĆ³n\",\n note: \"Nota\",\n no_issues_in_spec: \"No hay problemas enumerados en esta especificaciĆ³n.\",\n warning: \"Aviso\",\n },\n de: {\n editors_note: \"Redaktioneller Hinweis\",\n issue: \"Frage\",\n issue_summary: \"Offene Fragen\",\n no_issues_in_spec: \"Diese Spezifikation enthƤlt keine offenen Fragen.\",\n note: \"Hinweis\",\n warning: \"Warnung\",\n },\n zh: {\n editors_note: \"ē¼–者ę³Ø\",\n feature_at_risk: \"ļ¼ˆęœ‰åÆčƒ½å˜åŠØēš„ē‰¹ę€§ļ¼‰Issue\",\n issue: \"Issue\",\n issue_summary: \"Issue ꀻē»“\",\n no_issues_in_spec: \"ęœ¬č§„čŒƒäø­ęœŖ列å‡ŗ任何 issue怂\",\n note: \"ę³Ø\",\n warning: \"č­¦å‘Š\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} Report\n * @property {string} type\n * @property {boolean} inline\n * @property {number} number\n * @property {string} title\n\n * @typedef {object} GitHubLabel\n * @property {string} color\n * @property {string} name\n *\n * @typedef {object} GitHubIssue\n * @property {string} title\n * @property {string} state\n * @property {string} bodyHTML\n * @property {GitHubLabel[]} labels\n\n * @param {HTMLElement[]} ins\n * @param {Map<string, GitHubIssue>} ghIssues\n * @param {*} conf\n */\nfunction handleIssues(ins, ghIssues, conf) {\n const getIssueNumber = createIssueNumberGetter();\n const issueList = document.createElement(\"ul\");\n ins.forEach(inno => {\n const { type, displayType, isFeatureAtRisk } = getIssueType(inno);\n const isIssue = type === \"issue\";\n const isInline = inno.localName === \"span\";\n const { number: dataNum } = inno.dataset;\n const report = {\n type,\n inline: isInline,\n title: inno.title,\n number: getIssueNumber(inno),\n };\n // wrap\n if (!isInline) {\n const cssClass = isFeatureAtRisk ? `${type} atrisk` : type;\n const ariaRole = type === \"note\" ? \"note\" : null;\n const div = html`<div class=\"${cssClass}\" role=\"${ariaRole}\"></div>`;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`<div role=\"heading\" class=\"${className}\">${title}</div>`;\n addId(titleParent, \"h\", type);\n let text = displayType;\n if (inno.id) {\n div.id = inno.id;\n inno.removeAttribute(\"id\");\n } else {\n addId(\n div,\n \"issue-container\",\n report.number ? `number-${report.number}` : \"\"\n );\n }\n /** @type {GitHubIssue} */\n let ghIssue;\n if (isIssue) {\n if (report.number !== undefined) {\n text += ` ${report.number}`;\n }\n if (inno.dataset.hasOwnProperty(\"number\")) {\n const link = linkToIssueTracker(dataNum, conf, { isFeatureAtRisk });\n if (link) {\n title.before(link);\n link.append(title);\n }\n title.classList.add(\"issue-number\");\n ghIssue = ghIssues.get(dataNum);\n if (!ghIssue) {\n const msg = `Failed to fetch issue number ${dataNum}.`;\n showWarning(msg, name);\n }\n if (ghIssue && !report.title) {\n report.title = ghIssue.title;\n }\n }\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\n title.textContent = text;\n if (report.title) {\n inno.removeAttribute(\"title\");\n const { repoURL = \"\" } = conf.github || {};\n const labels = ghIssue ? ghIssue.labels : [];\n if (ghIssue && ghIssue.state === \"CLOSED\") {\n div.classList.add(\"closed\");\n }\n titleParent.append(createLabelsGroup(labels, report.title, repoURL));\n }\n /** @type {HTMLElement | DocumentFragment} */\n let body = inno;\n inno.replaceWith(div);\n body.classList.remove(type);\n body.removeAttribute(\"data-number\");\n if (ghIssue && !body.innerHTML.trim()) {\n body = document\n .createRange()\n .createContextualFragment(ghIssue.bodyHTML);\n }\n div.append(titleParent, body);\n const level = parents(titleParent, \"section\").length + 2;\n titleParent.setAttribute(\"aria-level\", level);\n }\n });\n makeIssueSectionSummary(issueList);\n}\n\nfunction createIssueNumberGetter() {\n if (document.querySelector(\".issue[data-number]\")) {\n return element => {\n if (element.dataset.number) {\n return Number(element.dataset.number);\n }\n };\n }\n\n let issueNumber = 0;\n return element => {\n if (element.classList.contains(\"issue\") && element.localName !== \"span\") {\n return ++issueNumber;\n }\n };\n}\n\n/**\n * @typedef {object} IssueType\n * @property {string} type\n * @property {string} displayType\n * @property {boolean} isFeatureAtRisk\n *\n * @param {HTMLElement} inno\n * @return {IssueType}\n */\nfunction getIssueType(inno) {\n const isIssue = inno.classList.contains(\"issue\");\n const isWarning = inno.classList.contains(\"warning\");\n const isEdNote = inno.classList.contains(\"ednote\");\n const isFeatureAtRisk = inno.classList.contains(\"atrisk\");\n const type = isIssue\n ? \"issue\"\n : isWarning\n ? \"warning\"\n : isEdNote\n ? \"ednote\"\n : \"note\";\n const displayType = isIssue\n ? isFeatureAtRisk\n ? l10n.feature_at_risk\n : l10n.issue\n : isWarning\n ? l10n.warning\n : isEdNote\n ? l10n.editors_note\n : l10n.note;\n return { type, displayType, isFeatureAtRisk };\n}\n\n/**\n * @param {string} dataNum\n * @param {*} conf\n */\nfunction linkToIssueTracker(dataNum, conf, { isFeatureAtRisk = false } = {}) {\n // Set issueBase to cause issue to be linked to the external issue tracker\n if (!isFeatureAtRisk && conf.issueBase) {\n return html`<a href=\"${conf.issueBase + dataNum}\" />`;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html`<a href=\"${conf.atRiskBase + dataNum}\" />`;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue}${\n report.number ? ` ${report.number}` : \"\"\n }`;\n const title = report.title\n ? html`<span style=\"text-transform: none\">: ${report.title}</span>`\n : \"\";\n return html`<li><a href=\"${`#${id}`}\">${issueNumberText}</a>${title}</li>`;\n}\n\n/**\n *\n * @param {HTMLUListElement} issueList\n */\nfunction makeIssueSectionSummary(issueList) {\n const issueSummaryElement = document.getElementById(\"issue-summary\");\n if (!issueSummaryElement) return;\n const heading = issueSummaryElement.querySelector(\"h2, h3, h4, h5, h6\");\n\n issueList.hasChildNodes()\n ? issueSummaryElement.append(issueList)\n : issueSummaryElement.append(html`<p>${l10n.no_issues_in_spec}</p>`);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `<h1>${l10n.issue_summary}</h1>`\n );\n }\n}\n\n/**\n * @param {GitHubLabel[]} labels\n * @param {string} title\n * @param {string} repoURL\n */\nfunction createLabelsGroup(labels, title, repoURL) {\n const labelsGroup = labels.map(label => createLabel(label, repoURL));\n if (labelsGroup.length) {\n labelsGroup.unshift(document.createTextNode(\" \"));\n }\n return html`<span class=\"issue-label\">: ${title}${labelsGroup}</span>`;\n}\n\n/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#000\" : \"#fff\";\n}\n\n/**\n * @param {GitHubLabel} label\n * @param {string} repoURL\n */\nfunction createLabel(label, repoURL) {\n const { color: bgColor, name } = label;\n const issuesURL = new URL(\"./issues/\", repoURL);\n issuesURL.searchParams.set(\"q\", `is:issue is:open label:\"${label.name}\"`);\n const color = textColorFromBgColor(bgColor);\n const style = `background-color: #${bgColor}; color: ${color}`;\n const ariaLabel = `GitHub label: ${name}`;\n return html` <a\n class=\"respec-gh-label\"\n style=\"${style}\"\n href=\"${issuesURL.href}\"\n aria-label=\"${ariaLabel}\"\n >${name}</a\n >`;\n}\n\n/**\n * @returns {Promise<Map<string, GitHubIssue>>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const specIssues = document.querySelectorAll(\".issue[data-number]\");\n const issueNumbers = [...specIssues]\n .map(elem => Number.parseInt(elem.dataset.number, 10))\n .filter(issueNumber => issueNumber);\n\n if (!issueNumbers.length) {\n return new Map();\n }\n\n const url = new URL(\"issues\", `${github.apiBase}/${github.fullName}/`);\n url.searchParams.set(\"issues\", issueNumbers.join(\",\"));\n\n const response = await fetch(url.href);\n if (!response.ok) {\n const msg = `Error fetching issues from GitHub. (HTTP Status ${response.status}).`;\n showError(msg, name);\n return new Map();\n }\n\n /** @type {{ [issueNumber: string]: GitHubIssue }} */\n const issues = await response.json();\n return new Map(Object.entries(issues));\n}\n\nexport async function run(conf) {\n const query = \".issue, .note, .warning, .ednote\";\n /** @type {NodeListOf<HTMLElement>} */\n const allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\n if (!issuesAndNotes.length) {\n return; // nothing to do.\n }\n const ghIssues = await fetchAndStoreGithubIssues(conf.github);\n const { head: headElem } = document;\n headElem.insertBefore(\n html`<style>\n ${css}\n </style>`,\n headElem.querySelector(\"link\")\n );\n handleIssues(issuesAndNotes, ghIssues, conf);\n const ednotes = document.querySelectorAll(\".ednote\");\n ednotes.forEach(ednote => {\n ednote.classList.remove(\"ednote\");\n ednote.classList.add(\"note\");\n });\n}\n","// @ts-check\n// Module core/best-practices\n// Handles the marking up of best practices, and can generate a summary of all of them.\n// The summary is generated if there is a section in the document with ID bp-summary.\n// Best practices are marked up with span.practicelab.\nimport { addId, getIntlData, makeSafeCopy, showWarning } from \"./utils.js\";\nimport { lang as defaultLang } from \"../core/l10n.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/best-practices\";\n\nconst localizationStrings = {\n en: {\n best_practice: \"Best Practice \",\n },\n ja: {\n best_practice: \"꜀č‰Æå®Ÿę–½ä¾‹ \",\n },\n de: {\n best_practice: \"Musterbeispiel \",\n },\n zh: {\n best_practice: \"ęœ€ä½³å®žč·µ \",\n },\n};\nconst l10n = getIntlData(localizationStrings);\nconst lang = defaultLang in localizationStrings ? defaultLang : \"en\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const bps = document.querySelectorAll(\".practicelab\");\n const bpSummary = document.getElementById(\"bp-summary\");\n const summaryItems = bpSummary ? document.createElement(\"ul\") : null;\n [...bps].forEach((bp, num) => {\n const id = addId(bp, \"bp\");\n const localizedBpName = html`<a class=\"marker self-link\" href=\"${`#${id}`}\"\n ><bdi lang=\"${lang}\">${l10n.best_practice}${num + 1}</bdi></a\n >`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`<li>${localizedBpName}: ${makeSafeCopy(bp)}</li>`;\n summaryItems.appendChild(li);\n }\n\n const container = bp.closest(\"div\");\n if (!container) {\n // This is just an inline best practice...\n bp.classList.add(\"advisement\");\n return;\n }\n\n // Make the advisement box\n container.classList.add(\"advisement\");\n const title = html`${localizedBpName.cloneNode(true)}: ${bp}`;\n container.prepend(...title.childNodes);\n });\n if (bps.length) {\n if (bpSummary) {\n bpSummary.appendChild(html`<h1>Best Practices Summary</h1>`);\n bpSummary.appendChild(summaryItems);\n }\n } else if (bpSummary) {\n const msg = `Using best practices summary (#bp-summary) but no best practices found.`;\n showWarning(msg, name);\n bpSummary.remove();\n }\n}\n","// @ts-check\n// Module core/figure\n// Handles figures in the document.\n// Adds width and height to images, if they are missing.\n// Generates a Table of Figures wherever there is a #tof element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/figures\";\n\nconst localizationStrings = {\n en: {\n list_of_figures: \"List of Figures\",\n fig: \"Figure \",\n },\n ja: {\n fig: \"図 \",\n list_of_figures: \"å›³ć®ćƒŖć‚¹ćƒˆ\",\n },\n ko: {\n fig: \"ź·øė¦¼ \",\n list_of_figures: \"ź·øė¦¼ ėŖ©ė”\",\n },\n nl: {\n fig: \"Figuur \",\n list_of_figures: \"Lijst met figuren\",\n },\n es: {\n fig: \"Figura \",\n list_of_figures: \"Lista de Figuras\",\n },\n zh: {\n fig: \"图 \",\n list_of_figures: \"规范äø­åŒ…含ēš„图\",\n },\n de: {\n fig: \"Abbildung\",\n list_of_figures: \"Abbildungsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n const tof = collectFigures();\n\n // Create a Table of Figures if a section with id 'tof' exists.\n const tofElement = document.getElementById(\"tof\");\n if (tof.length && tofElement) {\n decorateTableOfFigures(tofElement);\n tofElement.append(\n html`<h1>${l10n.list_of_figures}</h1>`,\n html`<ul class=\"tof\">\n ${tof}\n </ul>`\n );\n }\n}\n\n/**\n * process all figures\n */\nfunction collectFigures() {\n /** @type {HTMLElement[]} */\n const tof = [];\n document.querySelectorAll(\"figure\").forEach((fig, i) => {\n const caption = fig.querySelector(\"figcaption\");\n\n if (caption) {\n decorateFigure(fig, caption, i);\n tof.push(getTableOfFiguresListItem(fig.id, caption));\n } else {\n const msg = \"Found a `<figure>` without a `<figcaption>`.\";\n showWarning(msg, name, { elements: [fig] });\n }\n });\n return tof;\n}\n\n/**\n * @param {HTMLElement} figure\n * @param {HTMLElement} caption\n * @param {number} i\n */\nfunction decorateFigure(figure, caption, i) {\n const title = caption.textContent;\n addId(figure, \"fig\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"fig-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} figureId\n * @param {HTMLElement} caption\n * @return {HTMLElement}\n */\nfunction getTableOfFiguresListItem(figureId, caption) {\n const tofCaption = caption.cloneNode(true);\n tofCaption.querySelectorAll(\"a\").forEach(anchor => {\n renameElement(anchor, \"span\").removeAttribute(\"href\");\n });\n return html`<li class=\"tofline\">\n <a class=\"tocxref\" href=\"${`#${figureId}`}\">${tofCaption.childNodes}</a>\n </li>`;\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} tofElement\n */\nfunction decorateTableOfFigures(tofElement) {\n if (\n tofElement.classList.contains(\"appendix\") ||\n tofElement.classList.contains(\"introductory\") ||\n tofElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(tofElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n tofElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n tofElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\n// Module core/tables\n// Handles tables in the document.\n// Generates a List of Tables wherever there is a #list-of-tables element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/tables\";\n\nconst localizationStrings = {\n en: {\n list_of_tables: \"List of Tables\",\n table: \"Table \",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n const listOfTables = collectTables();\n const listOfTablesElement = document.querySelector(\"section#list-of-tables\");\n if (listOfTables.length && listOfTablesElement) {\n decorateListOfTables(listOfTablesElement);\n listOfTablesElement.append(\n html`<h1>${l10n.list_of_tables}</h1>`,\n html`<ul class=\"list-of-tables\">\n ${listOfTables}\n </ul>`\n );\n }\n}\n\n/**\n * process all tables\n */\nfunction collectTables() {\n /** @type {HTMLLIElement[]} */\n const listOfTables = [];\n /** @type {NodeListOf<HTMLTableElement>} */\n const tables = document.querySelectorAll(\"table.numbered\");\n [...tables]\n // there is a separate linter rule to catch numbered tables without captions\n .filter(table => !!table.querySelector(\"caption\"))\n .forEach((table, i) => {\n const caption = table.querySelector(\"caption\");\n decorateTable(table, caption, i);\n listOfTables.push(getListOfTablesListItem(table.id, caption));\n });\n return listOfTables;\n}\n\n/**\n * @param {HTMLTableElement} table\n * @param {HTMLTableCaptionElement} caption\n * @param {number} i\n */\nfunction decorateTable(table, caption, i) {\n const title = caption.textContent;\n addId(table, \"table\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"table-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${table.id}\"\n >${l10n.table}<bdi class=\"tableno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} tableId\n * @param {HTMLTableCaptionElement} caption\n * @return {HTMLLIElement}\n */\nfunction getListOfTablesListItem(tableId, caption) {\n const listOfTablesCaption = caption.cloneNode(true);\n for (const anchor of listOfTablesCaption.querySelectorAll(\"a\")) {\n renameElement(anchor, \"span\", { copyAttributes: false });\n }\n return html`<li>\n <a class=\"tocxref\" href=\"${`#${tableId}`}\"\n >${listOfTablesCaption.childNodes}</a\n >\n </li>`;\n}\n\n/**\n * if it has a parent section, don't touch it\n * if it has a class of appendix or introductory, don't touch it\n * if all the preceding section siblings are introductory, make it introductory\n * if there is a preceding section sibling which is an appendix, make it appendix\n * @param {Element} listOfTablesElement\n */\nfunction decorateListOfTables(listOfTablesElement) {\n if (\n listOfTablesElement.matches(\".appendix, .introductory\") ||\n listOfTablesElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(listOfTablesElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n listOfTablesElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n listOfTablesElement.classList.add(\"appendix\");\n }\n}\n","// @ts-check\nimport { definitionMap, registerDefinition } from \"./dfn-map.js\";\nimport { showError, wrapInner } from \"./utils.js\";\n\nconst topLevelEntities = new Set([\n \"callback interface\",\n \"callback\",\n \"dictionary\",\n \"enum\",\n \"interface mixin\",\n \"interface\",\n \"typedef\",\n]);\n\n/**\n * This function looks for a <dfn> element whose title is 'name' and\n * that is \"for\" 'parent', which is the empty string when 'name'\n * refers to a top-level entity. For top-level entities, <dfn>\n * elements that inherit a non-empty [dfn-for] attribute are also\n * counted as matching.\n *\n * When a matching <dfn> is found, it's given <code> formatting,\n * marked as an IDL definition, and returned. If no <dfn> is found,\n * the function returns 'undefined'.\n * @param {*} defn\n * @param {string} name\n */\nexport function findDfn(defn, name, { parent = \"\" } = {}) {\n switch (defn.type) {\n case \"constructor\":\n case \"operation\":\n return findOperationDfn(defn, parent, name);\n default:\n return findNormalDfn(defn, parent, name);\n }\n}\n\n/**\n * @param {{ type: string, arguments: any[] }} idlAst\n * @param {string} parent\n * @param {string} name\n */\nfunction getAlternativeNames(idlAst, parent, name) {\n const { type } = idlAst;\n const asQualifiedName = `${parent}.${name}`;\n switch (type) {\n case \"constructor\":\n case \"operation\": {\n // Allow linking to \"method()\", method(arg) and \"method\" name.\n const asMethodName = `${name}()`;\n const asFullyQualifiedName = `${asQualifiedName}()`;\n const asMethodWithArgs = generateMethodNamesWithArgs(\n name,\n idlAst.arguments\n );\n return {\n local: [asQualifiedName, asFullyQualifiedName, name],\n exportable: [asMethodName, ...asMethodWithArgs],\n };\n }\n case \"attribute\":\n return {\n local: [asQualifiedName],\n exportable: [name],\n };\n }\n}\n\n/**\n * Generates all possible permutations of a method name based\n * on what arguments they method accepts.\n\n * Required arguments are always present, and optional ones\n * are stacked one by one.\n *\n * For examples: foo(req1, req2), foo(req1, req2, opt1) and so on.\n *\n * @param {String} operationName\n * @param {*} argsAst\n */\nfunction generateMethodNamesWithArgs(operationName, argsAst) {\n const operationNames = [];\n if (argsAst.length === 0) {\n return operationNames;\n }\n const required = []; // required arguments\n const optional = []; // optional arguments, including variadic ones\n for (const { name, optional: isOptional, variadic } of argsAst) {\n if (isOptional || variadic) {\n optional.push(name);\n } else {\n required.push(name);\n }\n }\n const requiredArgs = required.join(\", \");\n const requiredOperation = `${operationName}(${requiredArgs})`;\n operationNames.push(requiredOperation);\n const optionalOps = optional.map((_, index) => {\n const args = [...required, ...optional.slice(0, index + 1)].join(\", \");\n const result = `${operationName}(${args})`;\n return result;\n });\n operationNames.push(...optionalOps);\n return operationNames;\n}\n\n/**\n * @param {*} defn\n * @param {string} parent\n * @param {string} name\n */\nfunction findOperationDfn(defn, parent, name) {\n // Overloads all have unique names\n if (name.includes(\"!overload\")) {\n return findNormalDfn(defn, parent, name);\n }\n const asMethodName = `${name}()`;\n return findNormalDfn(defn, parent, asMethodName, name);\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {Record<\"local\" | \"exportable\", string[]>} names\n */\nfunction addAlternativeNames(dfn, names) {\n const { local, exportable } = names;\n const lt = dfn.dataset.lt ? new Set(dfn.dataset.lt.split(\"|\")) : new Set();\n for (const item of exportable) {\n lt.add(item);\n }\n // Fix any ill-placed ones - local ones don't belong here\n local.filter(item => lt.has(item)).forEach(item => lt.delete(item));\n dfn.dataset.lt = [...lt].join(\"|\");\n dfn.dataset.localLt = local.join(\"|\");\n registerDefinition(dfn, [...local, ...exportable]);\n}\n\n/**\n * @param {*} defn\n * @param {string} parent\n * @param {...string} names\n */\nfunction findNormalDfn(defn, parent, ...names) {\n const { type } = defn;\n for (const name of names) {\n let resolvedName =\n type === \"enum-value\" && name === \"\" ? \"the-empty-string\" : name;\n let dfns = getDfns(resolvedName, parent, name, type);\n // If we haven't found any definitions with explicit [for]\n // and [title], look for a dotted definition, \"parent.name\".\n if (dfns.length === 0 && parent !== \"\") {\n resolvedName = `${parent}.${resolvedName}`;\n const alternativeDfns = definitionMap.get(resolvedName);\n if (alternativeDfns && alternativeDfns.size === 1) {\n dfns = [...alternativeDfns];\n registerDefinition(dfns[0], [resolvedName]);\n }\n } else {\n resolvedName = name;\n }\n if (dfns.length > 1) {\n const msg = `WebIDL identifier \\`${name}\\` ${\n parent ? `for \\`${parent}\\`` : \"\"\n } is defined multiple times`;\n const title = \"Duplicate definition.\";\n showError(msg, name, { title, elements: dfns });\n }\n if (dfns.length) {\n return dfns[0];\n }\n }\n}\n\n/**\n * @param {HTMLElement} dfnElem\n * @param {*} idlAst\n * @param {string} parent\n * @param {string} name\n */\nexport function decorateDfn(dfnElem, idlAst, parent, name) {\n if (!dfnElem.id) {\n const lCaseParent = parent.toLowerCase();\n const middle = lCaseParent ? `${lCaseParent}-` : \"\";\n let last = name.toLowerCase().replace(/[()]/g, \"\").replace(/\\s/g, \"-\");\n if (last === \"\") {\n last = \"the-empty-string\";\n dfnElem.setAttribute(\"aria-label\", \"the empty string\");\n }\n dfnElem.id = `dom-${middle}${last}`;\n }\n dfnElem.dataset.idl = idlAst.type;\n dfnElem.dataset.title = dfnElem.textContent;\n dfnElem.dataset.dfnFor = parent;\n // Derive the data-type for dictionary members, interface attributes,\n // and methods\n switch (idlAst.type) {\n case \"operation\":\n case \"attribute\":\n case \"field\":\n dfnElem.dataset.type = getDataType(idlAst);\n break;\n }\n\n // Mark the definition as code.\n if (\n !dfnElem.querySelector(\"code\") &&\n !dfnElem.closest(\"code\") &&\n dfnElem.children\n ) {\n wrapInner(dfnElem, dfnElem.ownerDocument.createElement(\"code\"));\n }\n\n // Add data-lt and data-local-lt values and register them\n switch (idlAst.type) {\n case \"attribute\":\n case \"constructor\":\n case \"operation\":\n addAlternativeNames(dfnElem, getAlternativeNames(idlAst, parent, name));\n break;\n }\n\n return dfnElem;\n}\n\n/**\n * @param {string} name\n * @param {string} parent data-dfn-for\n * @param {string} originalName\n * @param {string} type\n */\nfunction getDfns(name, parent, originalName, type) {\n const foundDfns = definitionMap.get(name);\n if (!foundDfns || foundDfns.size === 0) {\n return [];\n }\n const dfnForArray = [...foundDfns];\n // Definitions that have a name and [data-dfn-for] that exactly match the\n // IDL entity:\n const dfns = dfnForArray.filter(dfn => {\n // This is explicitly marked as a concept, so we can't use it\n if (dfn.dataset.dfnType === \"dfn\") return false;\n\n /** @type {HTMLElement} */\n const closestDfnFor = dfn.closest(`[data-dfn-for]`);\n return closestDfnFor && closestDfnFor.dataset.dfnFor === parent;\n });\n\n if (dfns.length === 0 && parent === \"\" && dfnForArray.length === 1) {\n // Make sure the name exactly matches\n return dfnForArray[0].textContent === originalName ? dfnForArray : [];\n } else if (topLevelEntities.has(type) && dfnForArray.length) {\n const dfn = dfnForArray.find(\n dfn => dfn.textContent.trim() === originalName\n );\n if (dfn) return [dfn];\n }\n return dfns;\n}\n\n/**\n * @return {string}\n */\nfunction getDataType(idlStruct = {}) {\n const { idlType, generic, union } = idlStruct;\n if (idlType === undefined) return \"\";\n if (typeof idlType === \"string\") return idlType;\n if (generic) return generic;\n // join on \"|\" handles for \"unsigned short\" etc.\n if (union) return idlType.map(getDataType).join(\"|\");\n return getDataType(idlType);\n}\n","// @ts-check\n/**\n * Module core/webidl-clipboard\n *\n * This module adds a button to each IDL pre making it possible to copy\n * well-formatted IDL to the clipboard.\n *\n */\nexport const name = \"core/webidl-clipboard\";\n\nfunction createButton() {\n const copyButton = document.createElement(\"button\");\n copyButton.innerHTML =\n '<svg height=\"16\" viewBox=\"0 0 14 16\" width=\"14\"><path fill-rule=\"evenodd\" d=\"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z\"/></svg>';\n copyButton.title = \"Copy IDL to clipboard\";\n copyButton.classList.add(\"respec-button-copy-paste\", \"removeOnSave\");\n return copyButton;\n}\n\nconst copyButton = createButton();\n\n/**\n * Adds a HTML button that copies WebIDL to the clipboard.\n *\n * @param {HTMLSpanElement} idlHeader\n */\nexport function addCopyIDLButton(idlHeader) {\n // There may be multiple <span>s of IDL, so we take everything\n // apart from the idl header.\n const pre = idlHeader.closest(\"pre.idl\");\n const idl = pre.cloneNode(true);\n idl.querySelector(\".idlHeader\").remove();\n const { textContent: idlText } = idl;\n const button = copyButton.cloneNode(true);\n button.addEventListener(\"click\", () => {\n navigator.clipboard.writeText(idlText);\n });\n idlHeader.append(button);\n}\n","/* --- WEB IDL --- */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\npre.idl {\n padding: 1em;\n position: relative;\n}\n\npre.idl > code {\n color: black;\n color: var(--text, black);\n}\n\n@media print {\n pre.idl {\n white-space: pre-wrap;\n }\n}\n\n.idlHeader {\n display: block;\n width: 150px;\n background: #8ccbf2;\n background: var(--def-border, #8ccbf2);\n color: #fff;\n /* TODO: need a better color here */\n color: var(--defrow-border, #fff);\n font-family: sans-serif;\n font-weight: bold;\n margin: -1em 0 1em -1em;\n height: 28px;\n line-height: 28px;\n}\n\n.idlHeader a.self-link {\n margin-left: 0.3cm;\n text-decoration: none;\n border-bottom: none;\n color: inherit;\n}\n\n.idlID {\n font-weight: bold;\n color: #005a9c;\n}\n\n.idlType {\n color: #005a9c;\n}\n\n.idlName {\n color: #ff4500;\n}\n\n.idlName a {\n color: #ff4500;\n border-bottom: 1px dotted #ff4500;\n text-decoration: none;\n}\n\na.idlEnumItem {\n color: #000;\n border-bottom: 1px dotted #ccc;\n text-decoration: none;\n}\n\n.idlSuperclass {\n font-style: italic;\n color: #005a9c;\n}\n\n/*.idlParam*/\n\n.idlParamName,\n.idlDefaultValue {\n font-style: italic;\n}\n\n.extAttr {\n color: #666;\n}\n\n/*.idlSectionComment*/\n\n.idlSectionComment {\n color: gray;\n}\n\n.idlIncludes a {\n font-weight: bold;\n}\n\n.respec-button-copy-paste:focus {\n text-decoration: none;\n border-color: #51a7e8;\n outline: none;\n box-shadow: 0 0 5px rgba(81, 167, 232, 0.5);\n}\n\n.respec-button-copy-paste:is(:focus:hover,.selected:focus) {\n border-color: #51a7e8;\n}\n\n.respec-button-copy-paste:is(:hover,:active,.zeroclipboard-is-hover,.zeroclipboard-is-active) {\n text-decoration: none;\n background-color: #ddd;\n background-image: linear-gradient(#eee, #ddd);\n border-color: #ccc;\n}\n\n.respec-button-copy-paste:is(:active,.selected,.zeroclipboard-is-active) {\n background-color: #dcdcdc;\n background-image: none;\n border-color: #b5b5b5;\n box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);\n}\n\n.respec-button-copy-paste.selected:hover {\n background-color: #cfcfcf;\n}\n\n.respec-button-copy-paste:is(:disabled,:disabled:hover,.disabled,.disabled:hover) {\n color: rgba(102, 102, 102, 0.5);\n cursor: default;\n background-color: rgba(229, 229, 229, 0.5);\n background-image: none;\n border-color: rgba(197, 197, 197, 0.5);\n box-shadow: none;\n}\n\n@media print {\n .respec-button-copy-paste {\n visibility: hidden;\n }\n}\n`;\n","// Module core/webidl\n// Highlights and links WebIDL marked up inside <pre class=\"idl\">.\n\n// TODO:\n// - It could be useful to report parsed IDL items as events\n// - don't use generated content in the CSS!\nimport {\n addHashId,\n docLink,\n showError,\n showWarning,\n wrapInner,\n xmlEscape,\n} from \"./utils.js\";\nimport { decorateDfn, findDfn } from \"./dfn-finder.js\";\nimport { html, webidl2 } from \"./import-maps.js\";\nimport { addCopyIDLButton } from \"./webidl-clipboard.js\";\nimport css from \"../styles/webidl.css.js\";\nimport { registerDefinition } from \"./dfn-map.js\";\n\nexport const name = \"core/webidl\";\nconst pluginName = name;\n\nconst operationNames = {};\nconst idlPartials = {};\n\nconst templates = {\n wrap(items) {\n return items\n .flat()\n .filter(x => x !== \"\")\n .map(x => (typeof x === \"string\" ? new Text(x) : x));\n },\n trivia(t) {\n if (!t.trim()) {\n return t;\n }\n return html`<span class=\"idlSectionComment\">${t}</span>`;\n },\n generic(keyword) {\n // Shepherd classifies \"interfaces\" as starting with capital letters,\n // like Promise, FrozenArray, etc.\n return /^[A-Z]/.test(keyword)\n ? html`<a data-xref-type=\"interface\" data-cite=\"WEBIDL\">${keyword}</a>`\n : // Other keywords like sequence, maplike, etc...\n html`<a data-xref-type=\"dfn\" data-cite=\"WEBIDL\">${keyword}</a>`;\n },\n reference(wrapped, unescaped, context) {\n if (context.type === \"extended-attribute\") {\n return wrapped;\n }\n let type = \"_IDL_\";\n let cite = null;\n let lt;\n switch (unescaped) {\n case \"object\":\n type = \"interface\";\n cite = \"WEBIDL\";\n break;\n }\n return html`<a\n data-link-type=\"${type === \"_IDL_\" ? \"idl\" : type}\"\n data-xref-type=\"${type}\"\n data-cite=\"${cite}\"\n data-lt=\"${lt}\"\n >${wrapped}</a\n >`;\n },\n name(escaped, { data, parent }) {\n if (data.idlType && data.idlType.type === \"argument-type\") {\n return html`<span class=\"idlParamName\">${escaped}</span>`;\n }\n const idlLink = defineIdlName(escaped, data, parent);\n if (data.type !== \"enum-value\") {\n const className = parent ? \"idlName\" : \"idlID\";\n idlLink.classList.add(className);\n }\n return idlLink;\n },\n nameless(escaped, { data, parent }) {\n switch (data.type) {\n case \"operation\":\n case \"constructor\":\n return defineIdlName(escaped, data, parent);\n default:\n return escaped;\n }\n },\n type(contents) {\n return html`<span class=\"idlType\">${contents}</span>`;\n },\n inheritance(contents) {\n return html`<span class=\"idlSuperclass\">${contents}</span>`;\n },\n definition(contents, { data, parent }) {\n const className = getIdlDefinitionClassName(data);\n switch (data.type) {\n case \"includes\":\n case \"enum-value\":\n return html`<span class=\"${className}\">${contents}</span>`;\n }\n const parentName = parent ? parent.name : \"\";\n const { name, idlId } = getNameAndId(data, parentName);\n return html`<span\n class=\"${className}\"\n id=\"${idlId}\"\n data-idl\n data-title=\"${name}\"\n >${contents}</span\n >`;\n },\n extendedAttribute(contents) {\n const result = html`<span class=\"extAttr\">${contents}</span>`;\n return result;\n },\n extendedAttributeReference(name) {\n return html`<a data-xref-type=\"extended-attribute\">${name}</a>`;\n },\n};\n\n/**\n * Returns a link to existing <dfn> or creates one if doesnā€™t exists.\n */\nfunction defineIdlName(escaped, data, parent) {\n const parentName = parent ? parent.name : \"\";\n const { name } = getNameAndId(data, parentName);\n const dfn = findDfn(data, name, {\n parent: parentName,\n });\n const linkType = getDfnType(data.type);\n if (dfn) {\n if (!data.partial) {\n if (!dfn.matches(\"[data-noexport]\")) dfn.dataset.export = \"\";\n dfn.dataset.dfnType = linkType;\n }\n decorateDfn(dfn, data, parentName, name);\n const href = `#${dfn.id}`;\n return html`<a\n data-link-for=\"${parentName}\"\n data-link-type=\"${linkType}\"\n href=\"${href}\"\n class=\"internalDFN\"\n ><code>${escaped}</code></a\n >`;\n }\n\n const isDefaultJSON =\n data.type === \"operation\" &&\n data.name === \"toJSON\" &&\n data.extAttrs.some(({ name }) => name === \"Default\");\n if (isDefaultJSON) {\n return html`<a data-link-type=\"dfn\" data-lt=\"default toJSON steps\"\n >${escaped}</a\n >`;\n }\n if (!data.partial) {\n const dfn = html`<dfn data-export data-dfn-type=\"${linkType}\"\n >${escaped}</dfn\n >`;\n registerDefinition(dfn, [name]);\n decorateDfn(dfn, data, parentName, name);\n return dfn;\n }\n\n const unlinkedAnchor = html`<a\n data-idl=\"${data.partial ? \"partial\" : null}\"\n data-link-type=\"${linkType}\"\n data-title=\"${data.name}\"\n data-xref-type=\"${linkType}\"\n >${escaped}</a\n >`;\n\n const showWarnings =\n name && data.type !== \"typedef\" && !(data.partial && !dfn);\n if (showWarnings) {\n const styledName = data.type === \"operation\" ? `${name}()` : name;\n const ofParent = parentName ? ` \\`${parentName}\\`'s` : \"\";\n const msg = `Missing \\`<dfn>\\` for${ofParent} \\`${styledName}\\` ${data.type}.`;\n const hint = docLink`See ${\"using `data-dfn-for`|#data-dfn-for\"} in ReSpec's documentation.`;\n showWarning(msg, pluginName, { elements: [unlinkedAnchor], hint });\n }\n return unlinkedAnchor;\n}\n\n/**\n * Map to Shepherd types, for export.\n * @see https://tabatkins.github.io/bikeshed/#dfn-types\n */\nfunction getDfnType(idlType) {\n switch (idlType) {\n case \"operation\":\n return \"method\";\n case \"field\":\n return \"dict-member\";\n case \"callback interface\":\n case \"interface mixin\":\n return \"interface\";\n default:\n return idlType;\n }\n}\n\nfunction getIdlDefinitionClassName(defn) {\n switch (defn.type) {\n case \"callback interface\":\n return \"idlInterface\";\n case \"operation\":\n return \"idlMethod\";\n case \"field\":\n return \"idlMember\";\n case \"enum-value\":\n return \"idlEnumItem\";\n case \"callback function\":\n return \"idlCallback\";\n }\n return `idl${defn.type[0].toUpperCase()}${defn.type.slice(1)}`;\n}\n\nconst nameResolverMap = new WeakMap();\nfunction getNameAndId(defn, parent = \"\") {\n if (nameResolverMap.has(defn)) {\n return nameResolverMap.get(defn);\n }\n const result = resolveNameAndId(defn, parent);\n nameResolverMap.set(defn, result);\n return result;\n}\n\nfunction resolveNameAndId(defn, parent) {\n let name = getDefnName(defn);\n // For getters, setters, etc. \"anonymous-getter\",\n const prefix = defn.special && defn.name === \"\" ? \"anonymous-\" : \"\";\n let idlId = getIdlId(prefix + name, parent);\n switch (defn.type) {\n // Top-level entities with linkable members.\n case \"callback interface\":\n case \"dictionary\":\n case \"interface\":\n case \"interface mixin\": {\n idlId += resolvePartial(defn);\n break;\n }\n case \"constructor\":\n case \"operation\": {\n const overload = resolveOverload(name, parent);\n if (overload) {\n name += overload;\n idlId += overload;\n } else if (defn.arguments.length) {\n idlId += defn.arguments\n .map(arg => `-${arg.name.toLowerCase()}`)\n .join(\"\");\n }\n break;\n }\n }\n return { name, idlId };\n}\n\nfunction resolvePartial(defn) {\n if (!defn.partial) {\n return \"\";\n }\n if (!idlPartials[defn.name]) {\n idlPartials[defn.name] = 0;\n }\n idlPartials[defn.name] += 1;\n return `-partial-${idlPartials[defn.name]}`;\n}\n\nfunction resolveOverload(name, parentName) {\n const qualifiedName = `${parentName}.${name}`;\n const fullyQualifiedName = `${qualifiedName}()`;\n let overload;\n if (!operationNames[fullyQualifiedName]) {\n operationNames[fullyQualifiedName] = 0;\n }\n if (!operationNames[qualifiedName]) {\n operationNames[qualifiedName] = 0;\n } else {\n overload = `!overload-${operationNames[qualifiedName]}`;\n }\n operationNames[fullyQualifiedName] += 1;\n operationNames[qualifiedName] += 1;\n return overload || \"\";\n}\n\nfunction getIdlId(name, parentName) {\n if (!parentName) {\n return `idl-def-${name.toLowerCase()}`;\n }\n return `idl-def-${parentName.toLowerCase()}-${name.toLowerCase()}`;\n}\n\nfunction getDefnName(defn) {\n switch (defn.type) {\n case \"enum-value\":\n return defn.value;\n case \"operation\":\n return defn.name || defn.special;\n default:\n return defn.name || defn.type;\n }\n}\n\n// IDL types that never need a data-dfn-for\nconst topLevelIdlTypes = [\n \"interface\",\n \"interface mixin\",\n \"dictionary\",\n \"namespace\",\n \"enum\",\n \"typedef\",\n \"callback\",\n];\n\n/**\n * @param {Element} idlElement\n * @param {number} index\n */\nfunction renderWebIDL(idlElement, index) {\n let parse;\n try {\n parse = webidl2.parse(idlElement.textContent, {\n sourceName: String(index),\n });\n } catch (e) {\n const msg = `Failed to parse WebIDL: ${e.bareMessage}.`;\n showError(msg, pluginName, {\n title: e.bareMessage,\n details: `<pre>${e.context}</pre>`,\n elements: [idlElement],\n });\n // Skip this <pre> and move on to the next one.\n return [];\n }\n // we add \"idl\" as the canonical match, so both \"webidl\" and \"idl\" work\n idlElement.classList.add(\"def\", \"idl\");\n const highlights = webidl2.write(parse, { templates });\n html.bind(idlElement)`${highlights}`;\n wrapInner(idlElement, document.createElement(\"code\"));\n idlElement.querySelectorAll(\"[data-idl]\").forEach(elem => {\n if (elem.dataset.dfnFor) {\n return;\n }\n const title = elem.dataset.title;\n // Select the nearest ancestor element that can contain members.\n const idlType = elem.dataset.dfnType;\n\n const parent = elem.parentElement.closest(\"[data-idl][data-title]\");\n if (parent && !topLevelIdlTypes.includes(idlType)) {\n elem.dataset.dfnFor = parent.dataset.title;\n }\n if (elem.localName === \"dfn\") {\n registerDefinition(elem, [title]);\n }\n });\n // cross reference\n const closestCite = idlElement.closest(\"[data-cite], body\");\n const { dataset } = closestCite;\n if (!dataset.cite) dataset.cite = \"WEBIDL\";\n // includes webidl in some form\n if (!/\\bwebidl\\b/i.test(dataset.cite)) {\n const cites = dataset.cite.trim().split(/\\s+/);\n dataset.cite = [\"WEBIDL\", ...cites].join(\" \");\n }\n addIDLHeader(idlElement);\n return parse;\n}\n/**\n * Adds a \"WebIDL\" decorative header/permalink to a block of WebIDL.\n * @param {HTMLPreElement} pre\n */\nexport function addIDLHeader(pre) {\n addHashId(pre, \"webidl\");\n const header = html`<span class=\"idlHeader\"\n ><a class=\"self-link\" href=\"${`#${pre.id}`}\">WebIDL</a></span\n >`;\n pre.prepend(header);\n addCopyIDLButton(header);\n}\n\nexport async function run() {\n const idls = document.querySelectorAll(\"pre.idl, pre.webidl\");\n if (!idls.length) {\n return;\n }\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.querySelector(\"head link, head > *:last-child\").before(style);\n\n const astArray = [...idls].map(renderWebIDL);\n\n const validations = webidl2.validate(astArray);\n for (const validation of validations) {\n let details = `<pre>${xmlEscape(validation.context)}</pre>`;\n if (validation.autofix) {\n validation.autofix();\n const idlToFix = webidl2.write(astArray[validation.sourceName]);\n const escaped = xmlEscape(idlToFix);\n details += `Try fixing as:\n <pre>${escaped}</pre>`;\n }\n const msg = `WebIDL validation error: ${validation.bareMessage}`;\n showError(msg, pluginName, {\n details,\n elements: [idls[validation.sourceName]],\n title: validation.bareMessage,\n });\n }\n document.normalize();\n}\n","// @ts-check\n/**\n * Module core/data-cite\n *\n * Allows citing other specifications using anchor elements. Simply add\n * \"data-cite\" and key of the specification.\n *\n * This module links elements that have `data-cite` attributes by converting\n * `data-cite` to `href` attributes. `data-cite` attributes are added to markup\n * directly by the author as well as via other modules like core/xref.\n *\n * @module core/data-cite\n */\n\nimport { biblio, resolveRef, updateFromNetwork } from \"./biblio.js\";\nimport {\n refTypeFromContext,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\nexport const name = \"core/data-cite\";\n\n/**\n * An arbitrary constant value used as an alias to the current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n * @type {string}\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * Gets the link properties for the given citation details.\n * @param {CiteDetails} citeDetails - The citation details.\n * @returns {Promise<LinkProps|null>} The link properties or null if not found.\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\n\n // This is just referring to this document\n if (key === THIS_SPEC) {\n href = document.location.href;\n } else {\n // Let's go look it up in spec ref...\n const entry = await resolveRef(key);\n if (!entry) {\n return null;\n }\n href = entry.href;\n title = entry.title;\n }\n\n if (canonicalHref) {\n // Xref gave us a canonical link, so let's use that.\n href = canonicalHref;\n } else {\n if (path) {\n // See: https://github.com/speced/respec/issues/1856#issuecomment-429579475\n const relPath = path.startsWith(\"/\") ? `.${path}` : path;\n href = new URL(relPath, href).href;\n }\n if (frag) {\n href = new URL(frag, href).href;\n }\n }\n\n return { href, title };\n}\n\n/**\n * Links the given element with the provided link properties and citation details.\n * @param {HTMLElement} elem - The element to link.\n * @param {LinkProps} linkProps - The link properties.\n * @param {CiteDetails} citeDetails - The citation details.\n */\nfunction linkElem(elem, linkProps, citeDetails) {\n const { href, title } = linkProps;\n const wrapInCiteEl = !citeDetails.path && !citeDetails.frag;\n\n switch (elem.localName) {\n case \"a\": {\n const el = /** @type {HTMLAnchorElement} */ (elem);\n if (el.textContent === \"\" && el.dataset.lt !== \"the-empty-string\") {\n el.textContent = title;\n }\n el.href = href;\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n el.replaceWith(cite);\n cite.append(el);\n }\n break;\n }\n case \"dfn\": {\n const anchor = document.createElement(\"a\");\n anchor.href = href;\n anchor.dataset.cite = citeDetails.key;\n anchor.dataset.citePath = citeDetails.path;\n anchor.dataset.citeFrag = citeDetails.frag;\n if (!elem.textContent) {\n anchor.textContent = title;\n elem.append(anchor);\n } else {\n wrapInner(elem, anchor);\n }\n if (wrapInCiteEl) {\n const cite = document.createElement(\"cite\");\n cite.append(anchor);\n elem.append(cite);\n }\n if (\"export\" in elem.dataset) {\n const msg = \"Exporting a linked external definition is not allowed.\";\n const hint = \"Please remove the `data-export` attribute.\";\n showError(msg, name, { hint, elements: [elem] });\n delete elem.dataset.export;\n }\n elem.classList.add(\"externalDFN\");\n elem.dataset.noExport = \"\";\n break;\n }\n }\n}\n\n/**\n * @param {string} component\n * @return {(key: string) => string}\n */\nfunction makeComponentFinder(component) {\n return key => {\n const position = key.search(component);\n return position !== -1 ? key.substring(position) : \"\";\n };\n}\n\nconst findFrag = makeComponentFinder(\"#\");\nconst findPath = makeComponentFinder(\"/\");\n\n/**\n * Converts the given raw key to citation details.\n * @param {HTMLElement} elem - The element containing the citation details.\n * @returns {CiteDetails} The citation details.\n */\nexport function toCiteDetails(elem) {\n const { dataset } = elem;\n const { cite: rawKey, citeFrag, citePath, citeHref } = dataset;\n\n // The key is a fragment, resolve using the shortName as key\n if (rawKey.startsWith(\"#\") && !citeFrag) {\n // Closes data-cite not starting with \"#\"\n /** @type {HTMLElement} */\n const closest = elem.parentElement.closest(\n `[data-cite]:not([data-cite^=\"#\"])`\n );\n const { key: parentKey, isNormative: closestIsNormative } = closest\n ? toCiteDetails(closest)\n : { key: THIS_SPEC, isNormative: false };\n dataset.cite = closestIsNormative ? parentKey : `?${parentKey}`;\n dataset.citeFrag = rawKey.replace(\"#\", \"\"); // the key is acting as a fragment\n return toCiteDetails(elem);\n }\n\n const frag = citeFrag ? `#${citeFrag}` : findFrag(rawKey);\n const path = citePath || findPath(rawKey).split(\"#\")[0]; // path is always before \"#\"\n const { type } = refTypeFromContext(rawKey, elem);\n const isNormative = type === \"normative\";\n // key is before \"/\" and \"#\" but after \"!\" or \"?\" (e.g., ?key/path#frag)\n const hasPrecedingMark = /^[?|!]/.test(rawKey);\n const key = rawKey.split(/[/|#]/)[0].substring(Number(hasPrecedingMark));\n const details = { key, isNormative, frag, path, href: citeHref };\n return details;\n}\n\n/**\n * Runs the data-cite processing on elements with the data-cite attribute.\n */\nexport async function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n\n await updateBiblio([...elems]);\n\n for (const elem of elems) {\n const originalKey = elem.dataset.cite;\n const citeDetails = toCiteDetails(elem);\n const linkProps = await getLinkProps(citeDetails);\n if (linkProps) {\n linkElem(elem, linkProps, citeDetails);\n } else {\n const msg = `Couldn't find a match for \"${originalKey}\"`;\n if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\n showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetches and updates `biblio` with entries corresponding to the given elements.\n * @param {HTMLElement[]} elems - The elements requiring biblio entries.\n */\nasync function updateBiblio(elems) {\n const promisesForBibEntries = elems.map(toCiteDetails).map(async entry => {\n const result = await resolveRef(entry.key);\n return { entry, result };\n });\n const bibEntries = await Promise.all(promisesForBibEntries);\n\n const missingBibEntries = bibEntries\n .filter(({ result }) => result === null)\n .map(({ entry: { key } }) => key);\n\n const newEntries = await updateFromNetwork(missingBibEntries);\n if (newEntries) {\n Object.assign(biblio, newEntries);\n }\n}\n\n/**\n * Cleans up the data-cite attributes from the document.\n * @param {Document} doc - The document to cleanup.\n */\nfunction cleanup(doc) {\n const attrToRemove = [\"data-cite\", \"data-cite-frag\", \"data-cite-path\"];\n const elems = doc.querySelectorAll(\"a[data-cite], dfn[data-cite]\");\n elems.forEach(elem =>\n attrToRemove.forEach(attr => elem.removeAttribute(attr))\n );\n}\n","// @ts-check\n// Module core/link-to-dfn\n// Gives definitions in definitionMap IDs and links <a> tags\n// to the matching definitions.\nimport {\n CaseInsensitiveMap,\n addId,\n getIntlData,\n getLinkTargets,\n showError,\n showWarning,\n wrapInner,\n} from \"./utils.js\";\nimport { THIS_SPEC, toCiteDetails } from \"./data-cite.js\";\nimport { definitionMap } from \"./dfn-map.js\";\n\nexport const name = \"core/link-to-dfn\";\n\n/** @type {HTMLElement[]} */\nexport const possibleExternalLinks = [];\n\nconst localizationStrings = {\n en: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Duplicate definition(s) of '${title}'`;\n },\n duplicateTitle: \"This is defined more than once in the document.\",\n },\n ja: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ć®é‡č¤‡å®šē¾©`;\n },\n duplicateTitle: \"恓恮ꖇę›øå†…ć§č¤‡ę•°å›žå®šē¾©ć•ć‚Œć¦ć„ć¾ć™ļ¼Ž\",\n },\n de: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `Mehrfache Definition von '${title}'`;\n },\n duplicateTitle:\n \"Das Dokument enthƤlt mehrere Definitionen dieses Eintrags.\",\n },\n zh: {\n /**\n * @param {string} title\n */\n duplicateMsg(title) {\n return `'${title}' ēš„重复定义`;\n },\n duplicateTitle: \"åœØę–‡ę”£äø­ęœ‰é‡å¤ēš„å®šä¹‰ć€‚\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n const titleToDfns = mapTitleToDfns();\n /** @type {HTMLAnchorElement[]} */\n const badLinks = [];\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const localAnchors = document.querySelectorAll(\n \"a[data-cite=''], a:not([href]):not([data-cite]):not(.logo):not(.externalDFN)\"\n );\n for (const anchor of localAnchors) {\n if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\n const dfn = findMatchingDfn(anchor, titleToDfns);\n if (dfn) {\n const foundLocalMatch = processAnchor(anchor, dfn, titleToDfns);\n if (!foundLocalMatch) {\n possibleExternalLinks.push(anchor);\n }\n } else {\n if (anchor.dataset.cite === \"\") {\n badLinks.push(anchor);\n } else {\n possibleExternalLinks.push(anchor);\n }\n }\n }\n\n showLinkingError(badLinks);\n\n // This needs to run before core/xref adds its data-cite and updates\n // conf.normativeReferences and conf.informativeReferences.\n updateReferences(conf);\n\n if (!conf.xref) {\n showLinkingError(possibleExternalLinks);\n }\n}\n\nfunction mapTitleToDfns() {\n /** @type {CaseInsensitiveMap<Map<string, Map<string, HTMLElement>>>} */\n const titleToDfns = new CaseInsensitiveMap();\n for (const key of definitionMap.keys()) {\n const { result, duplicates } = collectDfns(key);\n titleToDfns.set(key, result);\n if (duplicates.length > 0) {\n showError(l10n.duplicateMsg(key), name, {\n title: l10n.duplicateTitle,\n elements: duplicates,\n });\n }\n }\n return titleToDfns;\n}\n\n/**\n * @param {string} title\n */\nfunction collectDfns(title) {\n /** @type {Map<string, Map<string, HTMLElement>>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\n // check for potential duplicate definition\n if (result.has(dfnFor) && result.get(dfnFor).has(dfnType)) {\n const oldDfn = result.get(dfnFor).get(dfnType);\n // We want <dfn> definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as <span>s instead of <dfn>.\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching <dfn> for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction findMatchingDfn(anchor, titleToDfns) {\n const linkTargets = getLinkTargets(anchor);\n const target = linkTargets.find(\n target =>\n titleToDfns.has(target.title) &&\n titleToDfns.get(target.title).has(target.for)\n );\n if (!target) return;\n\n const dfnsByType = titleToDfns.get(target.title).get(target.for);\n const { linkType } = anchor.dataset;\n if (linkType) {\n for (const type of linkType.split(\"|\")) {\n if (dfnsByType.get(type)) {\n return dfnsByType.get(type);\n }\n }\n return dfnsByType.get(\"dfn\");\n } else {\n // Assumption: if it's for something, it's more likely IDL.\n const type = target.for ? \"idl\" : \"dfn\";\n return dfnsByType.get(type) || dfnsByType.get(\"idl\");\n }\n}\n\n/**\n * @param {HTMLAnchorElement} anchor\n * @param {HTMLElement} dfn\n * @param {ReturnType<typeof mapTitleToDfns>} titleToDfns\n */\nfunction processAnchor(anchor, dfn, titleToDfns) {\n let noLocalMatch = false;\n const { linkFor } = anchor.dataset;\n const { dfnFor } = dfn.dataset;\n if (dfn.dataset.cite) {\n anchor.dataset.cite = dfn.dataset.cite;\n } else if (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\n noLocalMatch = true;\n } else if (dfn.classList.contains(\"externalDFN\")) {\n // data-lt[0] serves as unique id for the dfn which this element references\n const lt = dfn.dataset.lt ? dfn.dataset.lt.split(\"|\") : [];\n anchor.dataset.lt = lt[0] || dfn.textContent;\n noLocalMatch = true;\n } else if (anchor.dataset.idl !== \"partial\") {\n anchor.href = `#${dfn.id}`;\n anchor.classList.add(\"internalDFN\");\n } else {\n noLocalMatch = true;\n }\n if (!anchor.hasAttribute(\"data-link-type\")) {\n anchor.dataset.linkType = \"idl\" in dfn.dataset ? \"idl\" : \"dfn\";\n }\n if (isCode(dfn)) {\n wrapAsCode(anchor, dfn);\n }\n return !noLocalMatch;\n}\n\n/**\n * Check if a definition is a code\n * @param {HTMLElement} dfn a definition\n */\nfunction isCode(dfn) {\n if (dfn.closest(\"code,pre\")) {\n return true;\n }\n // Note that childNodes.length === 1 excludes\n // definitions that have either other text, or other\n // whitespace, inside the <dfn>.\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf<HTMLElement>} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by <code>.\n * @param {HTMLAnchorElement} anchor a link\n * @param {HTMLElement} dfn a definition\n */\nfunction wrapAsCode(anchor, dfn) {\n // only add code to IDL when the definition matches\n const term = anchor.textContent.trim();\n const isIDL = dfn.dataset.hasOwnProperty(\"idl\");\n const needsCode = shouldWrapByCode(anchor) && shouldWrapByCode(dfn, term);\n if (!isIDL || needsCode) {\n wrapInner(anchor, document.createElement(\"code\"));\n }\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {string} term\n */\nfunction shouldWrapByCode(elem, term = \"\") {\n switch (elem.localName) {\n case \"a\":\n if (!elem.querySelector(\"code\")) {\n return true;\n }\n break;\n default: {\n const { dataset } = elem;\n if (elem.textContent.trim() === term) {\n return true;\n } else if (dataset.title === term) {\n return true;\n } else if (dataset.lt || dataset.localLt) {\n const terms = [];\n if (dataset.lt) {\n terms.push(...dataset.lt.split(\"|\"));\n }\n if (dataset.localLt) {\n terms.push(...dataset.localLt.split(\"|\"));\n }\n return terms.includes(term);\n }\n }\n }\n return false;\n}\n\nfunction showLinkingError(elems) {\n elems.forEach(elem => {\n const msg = `Found linkless \\`<a>\\` element with text \"${elem.textContent}\" but no matching \\`<dfn>\\``;\n const title = \"Linking error: not matching `<dfn>`\";\n showWarning(msg, name, { title, elements: [elem] });\n });\n}\n\n/**\n * Update references due to `data-cite` attributes.\n *\n * Also, make sure self-citing doesn't cause current document getting added to\n * bibliographic references section.\n * @param {Conf} conf\n */\nfunction updateReferences(conf) {\n const { shortName = \"\" } = conf;\n // Match shortName in a data-cite (with optional leading ?!), while skipping shortName as prefix.\n // https://regex101.com/r/rsZyIJ/5\n const regex = new RegExp(String.raw`^([?!])?${shortName}\\b([^-])`, \"i\");\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])\"\n );\n for (const elem of elems) {\n elem.dataset.cite = elem.dataset.cite.replace(regex, `$1${THIS_SPEC}$2`);\n const { key, isNormative } = toCiteDetails(elem);\n if (key === THIS_SPEC) continue;\n\n if (!isNormative && !conf.normativeReferences.has(key)) {\n conf.informativeReferences.add(key);\n } else {\n conf.normativeReferences.add(key);\n conf.informativeReferences.delete(key);\n }\n }\n}\n","// @ts-check\nimport { API_URL } from \"./xref.js\";\nimport { idb } from \"./import-maps.js\";\n\n/**\n * @typedef {import('core/xref').RequestEntry} RequestEntry\n * @typedef {import('core/xref').Response} Response\n * @typedef {import('core/xref').SearchResultEntry} SearchResultEntry\n * @typedef {import('core/xref').XrefDatabase} XrefDatabase\n */\n\nconst STORE_NAME = \"xrefs\";\nconst VERSION_CHECK_WAIT = 5 * 60 * 1000; // 5 min\n\nasync function getIdbCache() {\n /** @type {XrefDatabase} */\n const db = await idb.openDB(\"xref\", 2, {\n upgrade(db) {\n [...db.objectStoreNames].forEach(s => db.deleteObjectStore(s));\n const store = db.createObjectStore(STORE_NAME, { keyPath: \"query.id\" });\n store.createIndex(\"byTerm\", \"query.term\", { unique: false });\n },\n });\n return db;\n}\n\n/** @param {RequestEntry[]} queries */\nexport async function resolveXrefCache(queries) {\n /** @type {Map<string, SearchResultEntry[]>} */\n const cachedData = new Map();\n\n const bustCache = await shouldBustCache();\n if (bustCache) {\n await clearXrefData();\n return cachedData;\n }\n\n const requiredKeySet = new Set(queries.map(query => query.id));\n try {\n const cache = await getIdbCache();\n let cursor = await cache.transaction(STORE_NAME).store.openCursor();\n while (cursor) {\n if (requiredKeySet.has(cursor.key)) {\n cachedData.set(cursor.key, cursor.value.result);\n }\n cursor = await cursor.continue();\n }\n } catch (err) {\n console.error(err);\n }\n return cachedData;\n}\n\n/**\n * Get last updated timestamp from server and bust cache based on that. This\n * way, we prevent dirty/erroneous/stale data being kept on a client (which is\n * possible if we use a `MAX_AGE` based caching strategy).\n */\nasync function shouldBustCache() {\n const key = \"XREF:LAST_VERSION_CHECK\";\n const lastChecked = parseInt(localStorage.getItem(key), 10);\n const now = Date.now();\n\n if (!lastChecked) {\n localStorage.setItem(key, now.toString());\n return false;\n }\n if (now - lastChecked < VERSION_CHECK_WAIT) {\n // avoid checking network for any data update if old cache \"fresh\"\n return false;\n }\n\n const url = new URL(\"meta/version\", API_URL).href;\n const res = await fetch(url);\n if (!res.ok) return false;\n const lastUpdated = await res.text();\n localStorage.setItem(key, now.toString());\n return parseInt(lastUpdated, 10) > lastChecked;\n}\n\n/**\n * @param {RequestEntry[]} queries\n * @param {Map<string, SearchResultEntry[]>} results\n */\nexport async function cacheXrefData(queries, results) {\n try {\n const cache = await getIdbCache();\n const tx = cache.transaction(STORE_NAME, \"readwrite\");\n for (const query of queries) {\n const result = results.get(query.id);\n tx.objectStore(STORE_NAME).add({ query, result });\n }\n await tx.done;\n } catch (e) {\n console.error(e);\n }\n}\n\nexport async function clearXrefData() {\n try {\n await getIdbCache().then(db => db.clear(STORE_NAME));\n } catch (e) {\n console.error(e);\n }\n}\n","// @ts-check\n/**\n * @module core/xref\n *\n * Automatically adds external references.\n *\n * Searches for the terms which do not have a local definition at xref API and\n * for each query, adds `data-cite` attributes to respective elements.\n * `core/data-cite` later converts these data-cite attributes to actual links.\n * https://github.com/speced/respec/issues/1662\n */\n/**\n * @typedef {import('core/xref').RequestEntry} RequestEntry\n * @typedef {import('core/xref').Response} Response\n * @typedef {import('core/xref').SearchResultEntry} SearchResultEntry\n * @typedef {Map<string, { elems: HTMLElement[], results: SearchResultEntry[], query: RequestEntry }>} ErrorCollection\n * @typedef {{ ambiguous: ErrorCollection, notFound: ErrorCollection }} Errors\n */\nimport { cacheXrefData, resolveXrefCache } from \"./xref-db.js\";\nimport {\n createResourceHint,\n docLink,\n joinAnd,\n joinOr,\n nonNormativeSelector,\n norm as normalize,\n showError,\n} from \"./utils.js\";\nimport { possibleExternalLinks } from \"./link-to-dfn.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/xref\";\n\nconst profiles = {\n \"web-platform\": [\"HTML\", \"INFRA\", \"URL\", \"WEBIDL\", \"DOM\", \"FETCH\"],\n};\n\nexport const API_URL = \"https://respec.org/xref/\";\n\n/** @type {{ term: string; spec: string; element: HTMLElement }[]} */\nexport const informativeRefsInNormative = [];\n\nif (\n !document.querySelector(\"link[rel='preconnect'][href='https://respec.org']\")\n) {\n const link = createResourceHint({\n hint: \"preconnect\",\n href: \"https://respec.org\",\n });\n document.head.appendChild(link);\n}\n\n/**\n * @param {Object} conf respecConfig\n */\nexport async function run(conf) {\n if (!conf.xref) {\n return;\n }\n\n const xref = normalizeConfig(conf.xref);\n if (xref.specs) {\n const bodyCite = document.body.dataset.cite\n ? document.body.dataset.cite.split(/\\s+/)\n : [];\n document.body.dataset.cite = bodyCite.concat(xref.specs).join(\" \");\n }\n\n const elems = possibleExternalLinks.concat(findExplicitExternalLinks());\n if (!elems.length) return;\n\n /** @type {RequestEntry[]} */\n const queryKeys = [];\n for (const elem of elems) {\n const entry = getRequestEntry(elem);\n entry.id = await objectHash(entry);\n queryKeys.push(entry);\n }\n\n const data = await getData(queryKeys, xref.url);\n addDataCiteToTerms(elems, queryKeys, data, conf);\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Find additional references that need to be looked up externally.\n * Examples: a[data-cite=\"spec\"], dfn[data-cite=\"spec\"], dfn.externalDFN\n */\nfunction findExplicitExternalLinks() {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n \":is(a,dfn)[data-cite]:not([data-cite=''],[data-cite*='#'])\"\n );\n /** @type {NodeListOf<HTMLElement>} */\n const externalDFNs = document.querySelectorAll(\"dfn.externalDFN\");\n return [...links]\n .filter(el => {\n // ignore empties\n if (el.textContent.trim() === \"\") return false;\n /** @type {HTMLElement} */\n const closest = el.closest(\"[data-cite]\");\n return !closest || closest.dataset.cite !== \"\";\n })\n .concat(...externalDFNs);\n}\n\n/**\n * converts conf.xref to object with url and spec properties\n */\nfunction normalizeConfig(xref) {\n const defaults = {\n url: new URL(\"search/\", API_URL).href,\n specs: null,\n };\n\n const config = Object.assign({}, defaults);\n\n const type = Array.isArray(xref) ? \"array\" : typeof xref;\n switch (type) {\n case \"boolean\":\n // using defaults already, as above\n break;\n case \"string\":\n if (xref.toLowerCase() in profiles) {\n Object.assign(config, { specs: profiles[xref.toLowerCase()] });\n } else {\n invalidProfileError(xref);\n }\n break;\n case \"array\":\n Object.assign(config, { specs: xref });\n break;\n case \"object\":\n Object.assign(config, xref);\n if (xref.profile) {\n const profile = xref.profile.toLowerCase();\n if (profile in profiles) {\n const specs = (xref.specs ?? []).concat(profiles[profile]);\n Object.assign(config, { specs });\n } else {\n invalidProfileError(xref.profile);\n }\n }\n break;\n default: {\n const msg = `Invalid value for \\`xref\\` configuration option. Received: \"${xref}\".`;\n showError(msg, name);\n }\n }\n return config;\n\n function invalidProfileError(profile) {\n const supportedProfiles = joinOr(Object.keys(profiles), s => `\"${s}\"`);\n const msg =\n `Invalid profile \"${profile}\" in \\`respecConfig.xref\\`. ` +\n `Please use one of the supported profiles: ${supportedProfiles}.`;\n showError(msg, name);\n }\n}\n\n/**\n * get xref API request entry (term and context) for given xref element\n * @param {HTMLElement} elem\n */\nfunction getRequestEntry(elem) {\n const isIDL = \"xrefType\" in elem.dataset;\n\n let term = getTermFromElement(elem);\n if (!isIDL) term = term.toLowerCase();\n\n const specs = getSpecContext(elem);\n const types = getTypeContext(elem, isIDL);\n const forContext = getForContext(elem, isIDL);\n\n return {\n // Add an empty `id` to ensure the shape of object returned stays same when\n // actual `id` is added later (minor perf optimization, also makes\n // TypeScript happy).\n id: \"\",\n term,\n types,\n ...(specs.length && { specs }),\n ...(typeof forContext === \"string\" && { for: forContext }),\n };\n}\n\n/** @param {HTMLElement} elem */\nexport function getTermFromElement(elem) {\n const { lt: linkingText } = elem.dataset;\n let term = linkingText ? linkingText.split(\"|\", 1)[0] : elem.textContent;\n term = normalize(term);\n return term === \"the-empty-string\" ? \"\" : term;\n}\n\n/**\n * Get spec context as a fallback chain, where each level (sub-array) represents\n * decreasing priority.\n * @param {HTMLElement} elem\n */\nfunction getSpecContext(elem) {\n /** @type {string[][]} */\n const specs = [];\n\n /** @type {HTMLElement} */\n let dataciteElem = elem.closest(\"[data-cite]\");\n\n // Traverse up towards the root element, adding levels of lower priority specs\n while (dataciteElem) {\n const cite = dataciteElem.dataset.cite.toLowerCase().replace(/[!?]/g, \"\");\n const cites = cite.split(/\\s+/).filter(s => s);\n if (cites.length) {\n specs.push(cites);\n }\n if (dataciteElem === elem) break;\n dataciteElem = dataciteElem.parentElement.closest(\"[data-cite]\");\n }\n\n // If element itself contains data-cite, we don't take inline context into\n // account. The inline bibref context has lowest priority, if available.\n if (dataciteElem !== elem) {\n const closestSection = elem.closest(\"section\");\n /** @type {Iterable<HTMLElement>} */\n const bibrefs = closestSection\n ? closestSection.querySelectorAll(\"a.bibref\")\n : [];\n const inlineRefs = [...bibrefs].map(el => el.textContent.toLowerCase());\n if (inlineRefs.length) {\n specs.push(inlineRefs);\n }\n }\n\n const uniqueSpecContext = dedupeSpecContext(specs);\n return uniqueSpecContext;\n}\n\n/**\n * If we already have a spec in a higher priority level (closer to element) of\n * fallback chain, skip it from low priority levels, to prevent duplication.\n * @param {string[][]} specs\n * */\nfunction dedupeSpecContext(specs) {\n /** @type {string[][]} */\n const unique = [];\n for (const level of specs) {\n const higherPriority = unique[unique.length - 1] || [];\n const uniqueSpecs = [...new Set(level)].filter(\n spec => !higherPriority.includes(spec)\n );\n unique.push(uniqueSpecs.sort());\n }\n return unique;\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {boolean} isIDL\n */\nfunction getForContext(elem, isIDL) {\n if (elem.dataset.xrefFor) {\n return normalize(elem.dataset.xrefFor);\n }\n\n if (isIDL) {\n /** @type {HTMLElement} */\n const dataXrefForElem = elem.closest(\"[data-xref-for]\");\n if (dataXrefForElem) {\n return normalize(dataXrefForElem.dataset.xrefFor);\n }\n }\n\n return null;\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {boolean} isIDL\n */\nfunction getTypeContext(elem, isIDL) {\n if (isIDL) {\n if (elem.dataset.xrefType) {\n return elem.dataset.xrefType.split(\"|\");\n }\n return [\"_IDL_\"];\n }\n\n return [\"_CONCEPT_\"];\n}\n\n/**\n * @param {RequestEntry[]} queryKeys\n * @param {string} apiUrl\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nasync function getData(queryKeys, apiUrl) {\n const uniqueIds = new Set();\n const uniqueQueryKeys = queryKeys.filter(key => {\n return uniqueIds.has(key.id) ? false : uniqueIds.add(key.id) && true;\n });\n\n const resultsFromCache = await resolveXrefCache(uniqueQueryKeys);\n\n const termsToLook = uniqueQueryKeys.filter(\n key => !resultsFromCache.get(key.id)\n );\n const fetchedResults = await fetchFromNetwork(termsToLook, apiUrl);\n if (fetchedResults.size) {\n // add data to cache\n await cacheXrefData(uniqueQueryKeys, fetchedResults);\n }\n\n return new Map([...resultsFromCache, ...fetchedResults]);\n}\n\n/**\n * @param {RequestEntry[]} queries\n * @param {string} url\n * @returns {Promise<Map<string, SearchResultEntry[]>>}\n */\nasync function fetchFromNetwork(queries, url) {\n if (!queries.length) return new Map();\n\n const options = {\n method: \"POST\",\n body: JSON.stringify({ queries }),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n };\n const response = await fetch(url, options);\n const json = await response.json();\n return new Map(json.results.map(({ id, result }) => [id, result]));\n}\n\n/**\n * Figures out from the tree structure if the reference is\n * normative (true) or informative (false).\n * @param {HTMLElement} elem\n */\nfunction isNormative(elem) {\n const closestNormative = elem.closest(\".normative\");\n const closestInform = elem.closest(nonNormativeSelector);\n if (!closestInform || elem === closestNormative) {\n return true;\n }\n return (\n closestNormative &&\n closestInform &&\n closestInform.contains(closestNormative)\n );\n}\n\n/**\n * adds data-cite attributes to elems for each term for which results are found.\n * adds citations to references section.\n * collects and shows linking errors if any.\n * @param {HTMLElement[]} elems\n * @param {RequestEntry[]} queryKeys\n * @param {Map<string, SearchResultEntry[]>} data\n * @param {any} conf\n */\nfunction addDataCiteToTerms(elems, queryKeys, data, conf) {\n /** @type {Errors} */\n const errors = { ambiguous: new Map(), notFound: new Map() };\n\n for (let i = 0, l = elems.length; i < l; i++) {\n if (elems[i].closest(\"[data-no-xref]\")) continue;\n\n const elem = elems[i];\n const query = queryKeys[i];\n\n const { id } = query;\n const results = data.get(id);\n if (results.length === 1) {\n addDataCite(elem, query, results[0], conf);\n } else {\n const collector = errors[results.length === 0 ? \"notFound\" : \"ambiguous\"];\n if (!collector.has(id)) {\n collector.set(id, { elems: [], results, query });\n }\n collector.get(id).elems.push(elem);\n }\n }\n\n showErrors(errors);\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {RequestEntry} query\n * @param {SearchResultEntry} result\n * @param {any} conf\n */\nfunction addDataCite(elem, query, result, conf) {\n const { term, specs = [] } = query;\n const { uri, shortname, spec, normative, type, for: forContext } = result;\n // if authored spec context had `result.spec`, use it instead of shortname\n const cite = specs.flat().includes(spec) ? spec : shortname;\n // we use this \"partial\" URL to resolve parts of urls...\n // but sometimes we get lucky and we get an absolute URL from xref\n // which we can then use in other places (e.g., data-cite.js)\n const url = new URL(uri, \"https://partial\");\n let { pathname: citePath } = url;\n // final resolution will be against the URL of the spec, which may end with\n // a filename. That filename must be preserved if there's no specific path.\n if (citePath === \"/\") citePath = \"\";\n const citeFrag = url.hash.slice(1);\n const dataset = { cite, citePath, citeFrag, linkType: type };\n if (forContext) dataset.linkFor = forContext[0];\n if (url.origin && url.origin !== \"https://partial\") {\n dataset.citeHref = url.href;\n }\n Object.assign(elem.dataset, dataset);\n\n addToReferences(elem, cite, normative, term, conf);\n}\n\n/**\n * add specs for citation (references section)\n * @param {HTMLElement} elem\n * @param {string} cite\n * @param {boolean} normative\n * @param {string} term\n * @param {any} conf\n */\nfunction addToReferences(elem, cite, normative, term, conf) {\n const isNormRef = isNormative(elem);\n if (!isNormRef) {\n // Only add it if not already normative...\n if (!conf.normativeReferences.has(cite)) {\n conf.informativeReferences.add(cite);\n }\n return;\n }\n if (normative) {\n // If it was originally informative, we move the existing\n // key to be normative.\n const existingKey = conf.informativeReferences.has(cite)\n ? conf.informativeReferences.getCanonicalKey(cite)\n : cite;\n conf.normativeReferences.add(existingKey);\n conf.informativeReferences.delete(existingKey);\n return;\n }\n\n // This is used by the informative-dfn linter\n informativeRefsInNormative.push({ term, spec: cite, element: elem });\n}\n\n/** @param {Errors} errors */\nfunction showErrors({ ambiguous, notFound }) {\n const getPrefilledFormURL = (term, query, specs = []) => {\n const url = new URL(API_URL);\n url.searchParams.set(\"term\", term);\n if (query.for) url.searchParams.set(\"for\", query.for);\n url.searchParams.set(\"types\", query.types.join(\",\"));\n if (specs.length) url.searchParams.set(\"specs\", specs.join(\",\"));\n return url.href;\n };\n\n const howToFix = (howToCiteURL, originalTerm) => {\n return docLink`[See search matches for \"${originalTerm}\"](${howToCiteURL}) or ${\"[Learn about this error|#error-term-not-found]\"}.`;\n };\n\n for (const { query, elems } of notFound.values()) {\n const specs = query.specs ? [...new Set(query.specs.flat())].sort() : [];\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query);\n const specsString = joinAnd(specs, s => `**[${s}]**`);\n const hint = howToFix(formUrl, originalTerm);\n const forParent = query.for ? `, for **\"${query.for}\"**, ` : \"\";\n const msg = `Couldn't find \"**${originalTerm}**\"${forParent} in this document or other cited documents: ${specsString}.`;\n const title = \"No matching definition found.\";\n showError(msg, name, { title, elements: elems, hint });\n }\n\n for (const { query, elems, results } of ambiguous.values()) {\n const specs = [...new Set(results.map(entry => entry.shortname))].sort();\n const specsString = joinAnd(specs, s => `**[${s}]**`);\n const originalTerm = getTermFromElement(elems[0]);\n const formUrl = getPrefilledFormURL(originalTerm, query, specs);\n const forParent = query.for ? `, for **\"${query.for}\"**, ` : \"\";\n const moreInfo = howToFix(formUrl, originalTerm);\n const hint =\n docLink`To fix, use the ${\"[data-cite]\"} attribute to pick the one you mean from the appropriate specification.` +\n String.raw` ${moreInfo}`;\n const msg = `The term \"**${originalTerm}**\"${forParent} is ambiguous because it's defined in ${specsString}.`;\n const title = \"Definition is ambiguous.\";\n showError(msg, name, { title, elements: elems, hint });\n }\n}\n\nfunction objectHash(obj) {\n const str = JSON.stringify(obj, Object.keys(obj).sort());\n const buffer = new TextEncoder().encode(str);\n return crypto.subtle.digest(\"SHA-1\", buffer).then(bufferToHexString);\n}\n\n/** @param {ArrayBuffer} buffer */\nfunction bufferToHexString(buffer) {\n const byteArray = new Uint8Array(buffer);\n return [...byteArray].map(v => v.toString(16).padStart(2, \"0\")).join(\"\");\n}\n\nfunction cleanup(doc) {\n const elems = doc.querySelectorAll(\n \"a[data-xref-for], a[data-xref-type], a[data-link-for]\"\n );\n const attrToRemove = [\"data-xref-for\", \"data-xref-type\", \"data-link-for\"];\n elems.forEach(el => {\n attrToRemove.forEach(attr => el.removeAttribute(attr));\n });\n}\n","/*\n@module \"core/dfn-index\"\nExtends and overrides some styles from `base.css`.\n*/\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nul.index {\n columns: 30ch;\n column-gap: 1.5em;\n}\n\nul.index li {\n list-style: inherit;\n}\n\nul.index li span {\n color: inherit;\n cursor: pointer;\n white-space: normal;\n}\n\n#index-defined-here ul.index li {\n font-size: 0.9rem;\n}\n\nul.index code {\n color: inherit;\n}\n\n#index-defined-here .print-only {\n display: none;\n}\n\n@media print {\n #index-defined-here .print-only {\n display: initial;\n }\n}\n`;\n","// @ts-check\n/**\n * If a `<section id=\"index\">` exists, it is filled by a list of terms defined\n * (locally) by current document and a list of terms referenced (external) by\n * current document.\n */\n\nimport { addId, getIntlData, norm, xmlEscape } from \"./utils.js\";\nimport css from \"../styles/dfn-index.css.js\";\nimport { getTermFromElement } from \"./xref.js\";\nimport { html } from \"./import-maps.js\";\nimport { renderInlineCitation } from \"./render-biblio.js\";\nimport { sub } from \"./pubsubhub.js\";\nimport { toCiteDetails } from \"./data-cite.js\";\n\nexport const name = \"core/dfn-index\";\n\nconst localizationStrings = {\n en: {\n heading: \"Index\",\n headingExternal: \"Terms defined by reference\",\n headlingLocal: \"Terms defined by this specification\",\n dfnOf: \"definition of\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Terms of these _types_ are wrapped in `<code>`.\nconst CODE_TYPES = new Set([\n \"attribute\",\n \"callback\",\n \"dict-member\",\n \"dictionary\",\n \"element-attr\",\n \"element\",\n \"enum-value\",\n \"enum\",\n \"exception\",\n \"extended-attribute\",\n \"interface\",\n \"method\",\n \"typedef\",\n]);\n\n/**\n * @typedef {{ term: string, type: string, linkFor: string, elem: HTMLAnchorElement }} Entry\n */\n\nexport function run() {\n const index = document.querySelector(\"section#index\");\n if (!index) {\n // See below...\n sub(\"toc\", () => {}, { once: true });\n return;\n }\n\n const styleEl = document.createElement(\"style\");\n styleEl.textContent = css;\n document.head.appendChild(styleEl);\n\n index.classList.add(\"appendix\");\n if (!index.querySelector(\"h2, h1\")) {\n index.prepend(html`<h1>${l10n.heading}</h1>`);\n }\n\n const localTermIndex = html`<section id=\"index-defined-here\">\n <h3>${l10n.headlingLocal}</h3>\n ${createLocalTermIndex()}\n </section>`;\n index.append(localTermIndex);\n\n const externalTermIndex = html`<section id=\"index-defined-elsewhere\">\n <h3>${l10n.headingExternal}</h3>\n ${createExternalTermIndex()}\n </section>`;\n index.append(externalTermIndex);\n for (const el of externalTermIndex.querySelectorAll(\".index-term\")) {\n addId(el, \"index-term\");\n }\n\n // XXX: This event is used to overcome an edge case with core/structure,\n // related to a circular dependency in plugin run order. We want\n // core/structure to run after dfn-index so the #index can be listed in the\n // TOC, but we also want section numbers in dfn-index. So, we \"split\"\n // core/dfn-index in two parts, one that runs before core/structure (using\n // plugin order in profile) and the other (following) after section numbers\n // are generated in core/structure (this event).\n sub(\"toc\", appendSectionNumbers, { once: true });\n\n sub(\"beforesave\", cleanup);\n}\n\nfunction createLocalTermIndex() {\n const dataSortedByTerm = collectLocalTerms();\n return html`<ul class=\"index\">\n ${dataSortedByTerm.map(([term, dfns]) => renderLocalTerm(term, dfns))}\n </ul>`;\n}\n\nfunction collectLocalTerms() {\n /** @type {Map<string, HTMLElement[]>} */\n const data = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"dfn:not([data-cite])\");\n for (const elem of elems) {\n if (!elem.id) continue;\n const text = norm(elem.textContent);\n const elemsByTerm = data.get(text) || data.set(text, []).get(text);\n elemsByTerm.push(elem);\n }\n\n const dataSortedByTerm = [...data].sort(([a], [b]) =>\n a.slice(a.search(/\\w/)).localeCompare(b.slice(b.search(/\\w/)))\n );\n\n return dataSortedByTerm;\n}\n\n/**\n * @param {string} term\n * @param {HTMLElement[]} dfns\n * @returns {HTMLLIElement}\n */\nfunction renderLocalTerm(term, dfns) {\n const renderItem = (dfn, text, suffix) => {\n const href = `#${dfn.id}`;\n return html`<li data-id=${dfn.id}>\n <a class=\"index-term\" href=\"${href}\">${{ html: text }}</a> ${suffix\n ? { html: suffix }\n : \"\"}\n </li>`;\n };\n\n if (dfns.length === 1) {\n const dfn = dfns[0];\n const type = getLocalTermType(dfn);\n const text = getLocalTermText(dfn, type, term);\n const suffix = getLocalTermSuffix(dfn, type, term);\n return renderItem(dfn, text, suffix);\n }\n return html`<li>\n ${term}\n <ul>\n ${dfns.map(dfn => {\n const type = getLocalTermType(dfn);\n const text = getLocalTermSuffix(dfn, type, term) || l10n.dfnOf;\n return renderItem(dfn, text);\n })}\n </ul>\n </li>`;\n}\n\n/** @param {HTMLElement} dfn */\nfunction getLocalTermType(dfn) {\n const ds = dfn.dataset;\n const type = ds.dfnType || ds.idl || ds.linkType || \"\";\n switch (type) {\n case \"\":\n case \"dfn\":\n return \"\";\n default:\n return type;\n }\n}\n\n/** @param {HTMLElement} dfn */\nfunction getLocalTermParentContext(dfn) {\n /** @type {HTMLElement} */\n const dfnFor = dfn.closest(\"[data-dfn-for]:not([data-dfn-for=''])\");\n return dfnFor ? dfnFor.dataset.dfnFor : \"\";\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} type\n * @param {string} term\n */\nfunction getLocalTermText(dfn, type, term) {\n let text = term;\n if (type === \"enum-value\") {\n text = `\"${text}\"`;\n }\n if (CODE_TYPES.has(type) || dfn.dataset.idl || dfn.closest(\"code\")) {\n text = `<code>${text}</code>`;\n }\n return text;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {string} type\n * @param {string} [term=\"\"]\n */\nfunction getLocalTermSuffix(dfn, type, term = \"\") {\n if (term.startsWith(\"[[\")) {\n const parent = getLocalTermParentContext(dfn);\n return `internal slot for <code>${parent}</code>`;\n }\n\n switch (type) {\n case \"dict-member\":\n case \"method\":\n case \"attribute\":\n case \"enum-value\": {\n const typeText =\n type === \"dict-member\" ? \"member\" : type.replace(\"-\", \" \");\n const parent = getLocalTermParentContext(dfn);\n return `${typeText} for <code>${parent}</code>`;\n }\n case \"interface\":\n case \"dictionary\":\n case \"enum\": {\n return type;\n }\n case \"constructor\": {\n const parent = getLocalTermParentContext(dfn);\n return `for <code>${parent}</code>`;\n }\n default:\n return \"\";\n }\n}\n\nfunction appendSectionNumbers() {\n const getSectionNumber = id => {\n const dfn = document.getElementById(id);\n const sectionNumberEl = dfn\n .closest(\"section:not(.notoc)\")\n .querySelector(\".secno\");\n const secNum = `Ā§${sectionNumberEl.textContent.trim()}`;\n return html`<span class=\"print-only\">${secNum}</span>`;\n };\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"#index-defined-here li[data-id]\");\n elems.forEach(el => el.append(getSectionNumber(el.dataset.id)));\n}\n\nfunction createExternalTermIndex() {\n const data = collectExternalTerms();\n const dataSortedBySpec = [...data.entries()].sort(([specA], [specB]) =>\n specA.localeCompare(specB)\n );\n return html`<ul class=\"index\">\n ${dataSortedBySpec.map(([spec, entries]) => {\n return html`<li data-spec=\"${spec}\">\n ${renderInlineCitation(spec)} defines the following:\n <ul>\n ${entries\n .sort((a, b) => a.term.localeCompare(b.term))\n .map(renderExternalTermEntry)}\n </ul>\n </li>`;\n })}\n </ul>`;\n}\n\nfunction collectExternalTerms() {\n /** @type {Set<string>} */\n const uniqueReferences = new Set();\n /** @type {Map<string, Entry[]>} spec => entry[] */\n const data = new Map();\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elements = document.querySelectorAll(`a[data-cite]`);\n for (const elem of elements) {\n if (!elem.dataset.cite) {\n continue;\n }\n const { cite, citeFrag, xrefType, linkType } = elem.dataset;\n if (!(xrefType || linkType || cite.includes(\"#\") || citeFrag)) {\n // Not a reference to a definition\n continue;\n }\n const uniqueID = elem.href;\n if (uniqueReferences.has(uniqueID)) {\n continue;\n }\n\n const { linkType: type, linkFor } = elem.dataset;\n const term = getTermFromElement(elem);\n if (!term) {\n continue; // <a data-cite=\"SPEC\"></a>\n }\n const spec = toCiteDetails(elem).key.toUpperCase();\n\n const entriesBySpec = data.get(spec) || data.set(spec, []).get(spec);\n entriesBySpec.push({ term, type, linkFor, elem });\n uniqueReferences.add(uniqueID);\n }\n\n return data;\n}\n\n/**\n * @param {Entry} entry\n * @returns {HTMLLIElement}\n */\nfunction renderExternalTermEntry(entry) {\n const { elem } = entry;\n const text = getTermText(entry);\n const el = html`<li>\n <span class=\"index-term\" data-href=\"${elem.href}\">${{ html: text }}</span>\n </li>`;\n return el;\n}\n\n// Terms of these _types_ are suffixed with their type info.\nconst TYPED_TYPES = new Map([\n [\"attribute\", \"attribute\"],\n [\"element-attr\", \"attribute\"],\n [\"element\", \"element\"],\n [\"enum\", \"enum\"],\n [\"exception\", \"exception\"],\n [\"extended-attribute\", \"extended attribute\"],\n [\"interface\", \"interface\"],\n]);\n\n// These _terms_ have type suffix \"type\".\nconst TYPE_TERMS = new Set([\n // Following are primitive types as per WebIDL spec:\n \"boolean\",\n \"byte\",\n \"octet\",\n \"short\",\n \"unsigned short\",\n \"long\",\n \"unsigned long\",\n \"long long\",\n \"unsigned long long\",\n \"float\",\n \"unrestricted float\",\n \"double\",\n \"unrestricted double\",\n // Following are not primitive types, but aren't interfaces either.\n \"undefined\",\n \"any\",\n \"object\",\n \"symbol\",\n]);\n\n/** @param {Entry} entry */\nfunction getTermText(entry) {\n const { term, type, linkFor } = entry;\n let text = xmlEscape(term);\n\n if (CODE_TYPES.has(type)) {\n if (type === \"extended-attribute\") {\n text = `[${text}]`;\n }\n text = `<code>${text}</code>`;\n }\n\n const typeSuffix = TYPE_TERMS.has(term) ? \"type\" : TYPED_TYPES.get(type);\n if (typeSuffix) {\n text += ` ${typeSuffix}`;\n }\n\n if (linkFor) {\n let linkForText = linkFor;\n if (!/\\s/.test(linkFor)) {\n // If linkFor is a single word, highlight it.\n linkForText = `<code>${linkForText}</code>`;\n }\n if (type === \"element-attr\") {\n linkForText += \" element\";\n }\n text += ` (for ${linkForText})`;\n }\n\n return text;\n}\n\n/** @param {Document} doc */\nfunction cleanup(doc) {\n doc\n .querySelectorAll(\"#index-defined-elsewhere li[data-spec]\")\n .forEach(el => el.removeAttribute(\"data-spec\"));\n\n doc\n .querySelectorAll(\"#index-defined-here li[data-id]\")\n .forEach(el => el.removeAttribute(\"data-id\"));\n}\n","// @ts-check\n// Module core/contrib\n// Fetches names of contributors from github and uses them to fill\n// in the content of elements with key identifiers:\n// #gh-contributors: people whose PR have been merged.\n// Spec editors get filtered out automatically.\nimport { docLink, fetchAndCache, joinAnd, showError } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nexport const name = \"core/contrib\";\n\nexport async function run(conf) {\n const ghContributors = document.getElementById(\"gh-contributors\");\n if (!ghContributors) {\n return;\n }\n\n if (!conf.github) {\n const msg = docLink`Requested list of contributors from GitHub, but ${\"[github]\"} configuration option is not set.`;\n showError(msg, name);\n return;\n }\n\n const editors = conf.editors.map(editor => editor.name);\n const apiURL = `${conf.github.apiBase}/${conf.github.fullName}/`;\n await showContributors(editors, apiURL);\n}\n\n/**\n * Show list of contributors in #gh-contributors\n * @param {string[]} editors\n * @param {string} apiURL\n */\nasync function showContributors(editors, apiURL) {\n const elem = document.getElementById(\"gh-contributors\");\n if (!elem) return;\n\n elem.textContent = \"Fetching list of contributors...\";\n const contributors = await getContributors();\n if (contributors !== null) {\n toHTML(contributors, elem);\n } else {\n elem.textContent = \"Failed to fetch contributors.\";\n }\n\n async function getContributors() {\n const { href: url } = new URL(\"contributors\", apiURL);\n try {\n const res = await fetchAndCache(url);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n /** @type {Contributor[]} */\n const contributors = await res.json();\n return contributors.filter(\n user =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\n );\n } catch (error) {\n const msg = \"Error loading contributors from GitHub.\";\n showError(msg, name, { cause: error });\n return null;\n }\n }\n}\n\n/**\n * @typedef {{ name?: string, login: string }} Contributor\n * @param {Contributor[]} contributors\n * @param {HTMLElement} element\n */\nfunction toHTML(contributors, element) {\n const sortedContributors = contributors.sort((a, b) => {\n const nameA = a.name || a.login;\n const nameB = b.name || b.login;\n return nameA.toLowerCase().localeCompare(nameB.toLowerCase());\n });\n\n if (element.tagName === \"UL\") {\n html(element)`${sortedContributors.map(\n ({ name, login }) =>\n `<li><a href=\"https://github.com/${login}\">${name || login}</a></li>`\n )}`;\n return;\n }\n\n const names = sortedContributors.map(user => user.name || user.login);\n element.textContent = joinAnd(names);\n}\n","// @ts-check\n// Module core/fix-headers\n// Make sure that all h1-h6 headers (that are first direct children of sections) are actually\n// numbered at the right depth level. This makes it possible to just use any of them (conventionally\n// h2) with the knowledge that the proper depth level will be used\nimport { renameElement } from \"./utils.js\";\n\nexport const name = \"core/fix-headers\";\n\nexport function run() {\n [...document.querySelectorAll(\"section:not(.introductory)\")]\n .map(sec => sec.querySelector(\"h1, h2, h3, h4, h5, h6\"))\n .filter(h => h)\n .forEach(heading => {\n const depth = Math.min(getParents(heading, \"section\").length + 1, 6);\n renameElement(heading, `h${depth}`);\n });\n}\n\nfunction getParents(el, selector) {\n const parents = [];\n while (el != el.ownerDocument.body) {\n if (el.matches(selector)) parents.push(el);\n el = el.parentElement;\n }\n return parents;\n}\n","// @ts-check\n/**\n * Module: core/webidl-index\n * constructs a summary of WebIDL in the document by\n * cloning all the generated WebIDL nodes and\n * appending them to pre element.\n *\n * Usage\n * Add a <section id=\"idl-index\"> to the document.\n * It also supports title elements to generate a header.\n * Or if a header element is an immediate child, then\n * that is preferred.\n */\nexport const name = \"core/webidl-index\";\nimport { nonNormativeSelector, wrapInner } from \"./utils.js\";\nimport { addIDLHeader } from \"./webidl.js\";\n\nexport function run() {\n /** @type {HTMLElement | null} */\n const idlIndexSec = document.querySelector(\"section#idl-index\");\n if (!idlIndexSec) {\n return;\n }\n // Query for decedents headings, e.g., \"h2:first-child, etc..\"\n const query = [2, 3, 4, 5, 6].map(level => `h${level}:first-child`).join(\",\");\n if (!idlIndexSec.querySelector(query)) {\n const header = document.createElement(\"h2\");\n if (idlIndexSec.title) {\n header.textContent = idlIndexSec.title;\n idlIndexSec.removeAttribute(\"title\");\n } else {\n header.textContent = \"IDL Index\";\n }\n idlIndexSec.prepend(header);\n }\n\n // filter out the IDL marked with class=\"exclude\" and the IDL in non-normative sections\n const idlIndex = Array.from(\n document.querySelectorAll(\"pre.idl:not(.exclude) > code\")\n ).filter(idl => !idl.closest(nonNormativeSelector));\n\n if (idlIndex.length === 0) {\n const text = \"This specification doesn't normatively declare any Web IDL.\";\n idlIndexSec.append(text);\n return;\n }\n\n const pre = document.createElement(\"pre\");\n pre.classList.add(\"idl\", \"def\");\n pre.id = \"actual-idl-index\";\n idlIndex\n .map(elem => {\n const fragment = document.createDocumentFragment();\n for (const child of elem.children) {\n fragment.appendChild(child.cloneNode(true));\n }\n return fragment;\n })\n .forEach(elem => {\n if (pre.lastChild) {\n pre.append(\"\\n\\n\");\n }\n pre.appendChild(elem);\n });\n // Remove duplicate IDs\n pre.querySelectorAll(\"*[id]\").forEach(elem => elem.removeAttribute(\"id\"));\n\n // Add our own IDL header\n idlIndexSec.appendChild(pre);\n wrapInner(pre, document.createElement(\"code\"));\n addIDLHeader(pre);\n}\n","// @ts-check\n// Module core/structure\n// Handles producing the ToC and numbering sections across the document.\n\n// CONFIGURATION:\n// - noTOC: if set to true, no TOC is generated and sections are not numbered\n// - lang: can change the generated text (supported: en, fr)\n// - maxTocLevel: only generate a TOC so many levels deep\n\nimport {\n addId,\n getIntlData,\n parents,\n renameElement,\n showError,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nimport { pub } from \"./pubsubhub.js\";\n\nconst lowerHeaderTags = [\"h2\", \"h3\", \"h4\", \"h5\", \"h6\"];\n\nexport const name = \"core/structure\";\n\nconst localizationStrings = {\n en: {\n toc: \"Table of Contents\",\n },\n zh: {\n toc: \"内容大ēŗ²\",\n },\n ko: {\n toc: \"ėŖ©ģ°Ø\",\n },\n ja: {\n toc: \"ē›®ę¬”\",\n },\n nl: {\n toc: \"Inhoudsopgave\",\n },\n es: {\n toc: \"Tabla de Contenidos\",\n },\n de: {\n toc: \"Inhaltsverzeichnis\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @typedef {object} SectionInfo\n * @property {string} secno\n * @property {string} title\n *\n * Scans sections and generate ordered list element + ID-to-anchor-content dictionary.\n * @param {Section[]} sections the target element to find child sections\n * @param {number} maxTocLevel\n */\nfunction scanSections(sections, maxTocLevel, { prefix = \"\" } = {}) {\n let appendixMode = false;\n let lastNonAppendix = 0;\n let index = 1;\n if (prefix.length && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (sections.length === 0) {\n return null;\n }\n /** @type {HTMLElement} */\n const ol = html`<ol class=\"toc\"></ol>`;\n for (const section of sections) {\n if (section.isAppendix && !prefix && !appendixMode) {\n lastNonAppendix = index;\n appendixMode = true;\n }\n let secno = section.isIntro\n ? \"\"\n : appendixMode\n ? appendixNumber(index - lastNonAppendix + 1)\n : prefix + index;\n const level = secno.split(\".\").length;\n if (level === 1) {\n secno += \".\";\n // if this is a top level item, insert\n // an OddPage comment so html2ps will correctly\n // paginate the output\n section.header.before(document.createComment(\"OddPage\"));\n }\n\n if (!section.isIntro) {\n index += 1;\n section.header.prepend(html`<bdi class=\"secno\">${secno} </bdi>`);\n }\n\n if (level <= maxTocLevel) {\n const id = section.header.id || section.element.id;\n const item = createTocListItem(section.header, id);\n const sub = scanSections(section.subsections, maxTocLevel, {\n prefix: secno,\n });\n if (sub) {\n item.append(sub);\n }\n ol.append(item);\n }\n }\n return ol;\n}\n\n/**\n * Convert a number to spreadsheet like column name.\n * For example, 1=A, 26=Z, 27=AA, 28=AB and so on..\n * @param {number} num\n */\nfunction appendixNumber(num) {\n let s = \"\";\n while (num > 0) {\n num -= 1;\n s = String.fromCharCode(65 + (num % 26)) + s;\n num = Math.floor(num / 26);\n }\n return s;\n}\n\n/**\n * @typedef {object} Section\n * @property {Element} element\n * @property {Element} header\n * @property {string} title\n * @property {boolean} isIntro\n * @property {boolean} isAppendix\n * @property {Section[]} subsections\n *\n * @param {Element} parent\n */\nfunction getSectionTree(parent) {\n /** @type {NodeListOf<HTMLElement>} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n /** @type {Section[]} */\n const sections = [];\n\n for (const section of sectionElements) {\n const noToc = section.classList.contains(\"notoc\");\n if (!section.children.length || noToc) {\n continue;\n }\n const header = section.children[0];\n if (!lowerHeaderTags.includes(header.localName)) {\n continue;\n }\n const title = header.textContent;\n addId(section, null, title);\n sections.push({\n element: section,\n header,\n title,\n isIntro: Boolean(section.closest(\".introductory\")),\n isAppendix: section.classList.contains(\"appendix\"),\n subsections: getSectionTree(section),\n });\n }\n return sections;\n}\n\n/**\n * @param {Element} header\n * @param {string} id\n */\nfunction createTocListItem(header, id) {\n const anchor = html`<a href=\"${`#${id}`}\" class=\"tocxref\" />`;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`<li class=\"tocline\">${anchor}</li>`;\n}\n\n/**\n * Replaces any child <a> and <dfn> with <span>.\n * @param {HTMLElement} h\n */\nfunction filterHeader(h) {\n h.querySelectorAll(\"a\").forEach(anchor => {\n const span = renameElement(anchor, \"span\");\n span.className = \"formerLink\";\n span.removeAttribute(\"href\");\n });\n h.querySelectorAll(\"dfn\").forEach(dfn => {\n const span = renameElement(dfn, \"span\");\n span.removeAttribute(\"id\");\n });\n}\n\nexport function run(conf) {\n if (\"maxTocLevel\" in conf === false) {\n conf.maxTocLevel = Infinity;\n }\n\n renameSectionHeaders();\n\n // makeTOC\n if (!conf.noTOC) {\n skipFromToC();\n const sectionTree = getSectionTree(document.body);\n const result = scanSections(sectionTree, conf.maxTocLevel);\n if (result) {\n createTableOfContents(result);\n }\n }\n\n // See core/dfn-index\n pub(\"toc\");\n}\n\nfunction renameSectionHeaders() {\n const headers = getNonintroductorySectionHeaders();\n if (!headers.length) {\n return;\n }\n headers.forEach(header => {\n const depth = Math.min(parents(header, \"section\").length + 1, 6);\n const h = `h${depth}`;\n if (header.localName !== h) {\n renameElement(header, h);\n }\n });\n}\n\nfunction getNonintroductorySectionHeaders() {\n return [\n ...document.querySelectorAll(\n \"section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child\"\n ),\n ].filter(elem => !elem.closest(\"section.introductory\"));\n}\n\n/**\n * Skip descendent sections from appearing in ToC using data-max-toc.\n */\nfunction skipFromToC() {\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\"section[data-max-toc]\");\n for (const section of sections) {\n const maxToc = parseInt(section.dataset.maxToc, 10);\n if (maxToc < 0 || maxToc > 6 || Number.isNaN(maxToc)) {\n const msg = \"`data-max-toc` must have a value between 0-6 (inclusive).\";\n showError(msg, name, { elements: [section] });\n continue;\n }\n\n // `data-max-toc=0` is equivalent to adding a \".notoc\" to current section.\n if (maxToc === 0) {\n section.classList.add(\"notoc\");\n continue;\n }\n\n // When `data-max-toc=2`, we skip all \":scope > section > section\" from ToC\n // i.e., at Ā§1, we will keep Ā§1.1 but not Ā§1.1.1\n // Similarly, `data-max-toc=1` will keep Ā§1, but not Ā§1.1\n const sectionToSkipFromToC = section.querySelectorAll(\n `:scope > ${Array.from({ length: maxToc }, () => \"section\").join(\" > \")}`\n );\n for (const el of sectionToSkipFromToC) {\n el.classList.add(\"notoc\");\n }\n }\n}\n\n/**\n * @param {HTMLElement} ol\n */\nfunction createTableOfContents(ol) {\n if (!ol) {\n return;\n }\n const nav = html`<nav id=\"toc\"></nav>`;\n const h2 = html`<h2 class=\"introductory\">${l10n.toc}</h2>`;\n addId(h2);\n nav.append(h2, ol);\n const ref =\n document.getElementById(\"toc\") ||\n document.getElementById(\"sotd\") ||\n document.getElementById(\"abstract\");\n if (ref) {\n if (ref.id === \"toc\") {\n ref.replaceWith(nav);\n } else {\n ref.after(nav);\n }\n }\n\n const link = html`<p role=\"navigation\" id=\"back-to-top\">\n <a href=\"#title\"><abbr title=\"Back to Top\">↑</abbr></a>\n </p>`;\n document.body.append(link);\n}\n","// @ts-check\n// Module core/informative\n// Mark specific sections as informative, based on CSS\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/informative\";\n\nconst localizationStrings = {\n en: {\n informative: \"This section is non-normative.\",\n },\n nl: {\n informative: \"Dit onderdeel is niet normatief.\",\n },\n ko: {\n informative: \"ģ“ ė¶€ė¶„ģ€ ė¹„ź·œė²”ģ ģž…ė‹ˆė‹¤.\",\n },\n ja: {\n informative: \"恓恮ēƀćÆä»•ę§˜ć«ćÆå«ć¾ć‚Œć¾ć›ć‚“ļ¼Ž\",\n },\n de: {\n informative: \"Dieser Abschnitt ist nicht normativ.\",\n },\n zh: {\n informative: \"ęœ¬ē« čŠ‚äøåŒ…å«č§„čŒƒę€§å†…å®¹ć€‚\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n Array.from(document.querySelectorAll(\"section.informative\"))\n .map(informative => informative.querySelector(\"h2, h3, h4, h5, h6\"))\n .filter(heading => heading)\n .forEach(heading => {\n heading.after(html`<p><em>${l10n.informative}</em></p>`);\n });\n}\n","// @ts-check\n// Module core/id-headers\n// All headings are expected to have an ID, unless their immediate container has one.\n// This is currently in core though it comes from a W3C rule. It may move in the future.\n\nexport const name = \"core/id-headers\";\nimport { addId, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6`\n );\n for (const h of headings) {\n // prefer for ID: heading.id > parentElement.id > newly generated heading.id\n let id = h.id;\n if (!id) {\n addId(h);\n id = h.parentElement.id || h.id;\n }\n if (!conf.addSectionLinks) continue;\n const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","/* container for stats */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n\n.caniuse-stats {\n display: flex;\n column-gap: 2em;\n}\n\n.caniuse-group {\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: flex-end;\n flex-basis: auto;\n}\n\n.caniuse-browsers {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n flex-wrap: wrap;\n margin-top: .2em;\n column-gap: .4em;\n border-bottom: 1px solid #ccc;\n row-gap: .4em;\n padding-bottom: .4cm;\n}\n\n.caniuse-type {\n align-self: center;\n border-top: none;\n text-transform: capitalize;\n font-size: .8em;\n margin-top: -.8em;\n font-weight: bold;\n}\n\n.caniuse-type span {\n background-color: var(--bg, white);\n padding: 0 0.4em;\n}\n\n/* a browser version */\n.caniuse-cell {\n align-items: center;\n border-radius: 1cm;\n color: #fff;\n display: flex;\n font-size: 90%;\n min-width: 1.5cm;\n padding: .3rem;\n justify-content: space-evenly;\n --supported: #2a8436dd;\n --no-support: #c44230dd;\n --no-support-alt: #b43b2bdd;\n --partial: #807301dd;\n --partial-alt: #746c00dd;\n --unknown: #757575;\n\n background: repeating-linear-gradient(\n var(--caniuse-angle, 45deg),\n var(--caniuse-bg) 0,\n var(--caniuse-bg-alt) 1px,\n var(--caniuse-bg-alt) 0.4em,\n var(--caniuse-bg) calc(0.25em + 1px),\n var(--caniuse-bg) 0.75em\n );\n}\n\nimg.caniuse-browser {\n filter: drop-shadow(0px 0px .1cm #666666);\n background: transparent;\n}\n\n.caniuse-cell span.browser-version {\n margin-left: 0.4em;\n text-shadow: 0 0 0.1em #fff;\n font-weight: 100;\n font-size: .9em;\n}\n\n.caniuse-stats a[href] {\n white-space: nowrap;\n align-self: flex-end;\n}\n\n/* supports */\n.caniuse-cell.y {\n background: var(--supported);\n}\n\n/* no support, disabled by default */\n.caniuse-cell:is(.n,.d) {\n --caniuse-angle: 45deg;\n --caniuse-bg: var(--no-support);\n --caniuse-bg-alt: var(--no-support-alt);\n}\n\n.caniuse-cell.u {\n background: var(--unknown);\n}\n\n.caniuse-cell.d {\n --caniuse-angle: 180deg;\n}\n\n/* not supported by default / partial support etc\nsee https://github.com/Fyrd/caniuse/blob/master/CONTRIBUTING.md for stats */\n.caniuse-cell:is(.a,.x,.p) {\n --caniuse-angle: 90deg;\n --caniuse-bg: var(--partial);\n --caniuse-bg-alt: var(--partial-alt);\n}\n\n/* handle case when printing */\n@media print {\n .caniuse-cell.y::before {\n content: \"āœ”ļø\";\n padding: 0.5em;\n }\n\n .caniuse-cell.n::before {\n content: \"āŒ\";\n padding: 0.5em;\n }\n\n .caniuse-cell:is(.a,.d,.p,.x,.u)::before {\n content: \"āš ļø\";\n padding: 0.5em;\n }\n}\n`;\n","// @ts-check\n/**\n * Module: \"core/caniuse\"\n * Adds a caniuse support table for a \"feature\" #1238\n * Usage options: https://github.com/speced/respec/wiki/caniuse\n */\nimport { codedJoinAnd, docLink, showError, showWarning } from \"./utils.js\";\nimport { pub, sub } from \"./pubsubhub.js\";\nimport css from \"../styles/caniuse.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/caniuse\";\n\nconst API_URL = \"https://respec.org/caniuse/\";\n\nexport const BROWSERS = new Map([\n [\"and_chr\", { name: \"Android Chrome\", path: \"chrome\", type: \"mobile\" }],\n [\"and_ff\", { name: \"Android Firefox\", path: \"firefox\", type: \"mobile\" }],\n [\"and_uc\", { name: \"Android UC\", path: \"uc\", type: \"mobile\" }],\n [\"chrome\", { name: \"Chrome\", type: \"desktop\" }],\n [\"edge\", { name: \"Edge\", type: \"desktop\" }],\n [\"firefox\", { name: \"Firefox\", type: \"desktop\" }],\n [\"ios_saf\", { name: \"iOS Safari\", path: \"safari-ios\", type: \"mobile\" }],\n [\"op_mob\", { name: \"Opera Mobile\", path: \"opera\", type: \"mobile\" }],\n [\"opera\", { name: \"Opera\", type: \"desktop\" }],\n [\"safari\", { name: \"Safari\", type: \"desktop\" }],\n [\n \"samsung\",\n { name: \"Samsung Internet\", path: \"samsung-internet\", type: \"mobile\" },\n ],\n]);\n\nconst statToText = new Map([\n [\"a\", \"almost supported (aka Partial support)\"],\n [\"d\", \"disabled by default\"],\n [\"n\", \"no support, or disabled by default\"],\n [\"p\", \"no support, but has Polyfill\"],\n [\"u\", \"unknown support\"],\n [\"x\", \"requires prefix to work\"],\n [\"y\", \"supported by default\"],\n]);\n\nexport function prepare(conf) {\n if (!conf.caniuse) {\n return; // nothing to do.\n }\n normalizeCaniuseConf(conf);\n validateBrowsers(conf);\n const options = conf.caniuse;\n if (!options.feature) {\n return; // no feature to show\n }\n\n document.head.appendChild(\n html`<style\n id=\"caniuse-stylesheet\"\n class=\"${options.removeOnSave ? \"removeOnSave\" : \"\"}\"\n >\n ${css}\n </style>`\n );\n}\n/**\n * @param {string} browser\n * @returns\n */\nfunction getLogoSrc(browser) {\n const path = BROWSERS.get(browser).path ?? browser;\n return `https://www.w3.org/assets/logos/browser-logos/${path}/${path}.svg`;\n}\n\nexport async function run(conf) {\n const options = conf.caniuse;\n if (!options?.feature) return;\n\n const featureURL = new URL(options.feature, \"https://caniuse.com/\").href;\n const headDlElem = document.querySelector(\".head dl\");\n const contentPromise = fetchStats(conf.caniuse)\n .then(json => processJson(json, options))\n .catch(err => handleError(err, options, featureURL));\n const definitionPair = html`<dt class=\"caniuse-title\">Browser support:</dt>\n <dd class=\"caniuse-stats\">\n ${{\n any: contentPromise,\n placeholder: \"Fetching data from caniuse.com...\",\n }}\n </dd>`;\n headDlElem.append(...definitionPair.childNodes);\n await contentPromise;\n pub(\"amend-user-config\", { caniuse: options.feature });\n if (options.removeOnSave) {\n // Will remove the browser support cells.\n headDlElem\n .querySelectorAll(\".caniuse-browser\")\n .forEach(elem => elem.classList.add(\"removeOnSave\"));\n sub(\"beforesave\", outputDoc => {\n html.bind(outputDoc.querySelector(\".caniuse-stats\"))`\n <a href=\"${featureURL}\">caniuse.com</a>`;\n });\n }\n}\n\nfunction handleError(err, options, featureURL) {\n const msg = `Failed to retrieve feature \"${options.feature}\".`;\n const hint = docLink`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${\"[caniuse]\"}.`;\n showError(msg, name, { hint, cause: err });\n return html`<a href=\"${featureURL}\">caniuse.com</a>`;\n}\n\n/**\n * returns normalized `conf.caniuse` configuration\n * @param {Object} conf configuration settings\n */\nfunction normalizeCaniuseConf(conf) {\n const defaultBrowsers = new Set(BROWSERS.keys());\n defaultBrowsers.delete(\"op_mob\");\n defaultBrowsers.delete(\"opera\");\n const DEFAULTS = { removeOnSave: true, browsers: [...defaultBrowsers] };\n if (typeof conf.caniuse === \"string\") {\n conf.caniuse = { feature: conf.caniuse, ...DEFAULTS };\n return;\n }\n conf.caniuse = { ...DEFAULTS, ...conf.caniuse };\n}\n\nfunction validateBrowsers({ caniuse }) {\n const { browsers } = caniuse;\n const invalidBrowsers = browsers.filter(browser => !BROWSERS.has(browser));\n if (invalidBrowsers.length) {\n const names = codedJoinAnd(invalidBrowsers, { quotes: true });\n const msg = docLink`Invalid browser(s): (${names}) in the \\`browser\\` property of ${\"[caniuse]\"}.`;\n showWarning(msg, name);\n }\n}\n\nasync function processJson(json, { feature }) {\n /** @type {Array} */\n const results = json.result;\n const groups = new Map([\n [\"desktop\", []],\n [\"mobile\", []],\n ]);\n const toBrowserCell = browserCellRenderer(feature);\n results.reduce(toBrowserCell, groups);\n const out = [...groups]\n .filter(([, arr]) => arr.length)\n .map(\n ([key, arr]) =>\n html`<div class=\"caniuse-group\">\n <div class=\"caniuse-browsers\">${arr}</div>\n <div class=\"caniuse-type\"><span>${key}</div>\n </div>`\n );\n out.push(\n html`<a class=\"caniuse-cell\" href=\"https://caniuse.com/${feature}\"\n >More info</a\n >`\n );\n return out;\n}\n\nfunction browserCellRenderer(feature) {\n return (groups, { browser: browserId, version, caniuse }) => {\n const { name, type } = BROWSERS.get(browserId);\n const versionLong = version ? ` version ${version}` : \"\";\n const browserName = `${name}${versionLong}`;\n const supportLevel = statToText.get(caniuse);\n const ariaLabel = `${feature} is ${supportLevel} since ${browserName} on ${type}.`;\n const cssClass = `caniuse-cell ${caniuse}`;\n const title = capitalize(`${supportLevel} since ${browserName}.`);\n const textVersion = version ? version : \"ā€”\";\n const src = getLogoSrc(browserId);\n const result = html`\n <div class=\"${cssClass}\" title=\"${title}\" aria-label=\"${ariaLabel}\">\n <img\n class=\"caniuse-browser\"\n width=\"20\"\n height=\"20\"\n src=\"${src}\"\n alt=\"${name} logo\"\n /><span class=\"browser-version\">${textVersion}</span>\n </div>\n `;\n groups.get(type).push(result);\n return groups;\n };\n}\n\n/**\n * @typedef {Record<string, [string, string[]][]>} ApiResponse\n * @throws {Error} on failure\n */\nasync function fetchStats(options) {\n const { feature, browsers, apiURL } = options;\n const url = new URL(apiURL || `./${feature}`, API_URL);\n browsers.forEach(browser => url.searchParams.append(\"browsers\", browser));\n const response = await fetch(url);\n if (!response.ok) {\n const { status, statusText } = response;\n throw new Error(`Failed to get caniuse data: (${status}) ${statusText}`);\n }\n return response.json();\n}\n\nfunction capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.mdn {\n font-size: 0.75em;\n position: absolute;\n right: 0.3em;\n min-width: 0;\n margin-top: 3rem;\n}\n\n.mdn details {\n width: 100%;\n margin: 1px 0;\n position: relative;\n z-index: 10;\n box-sizing: border-box;\n padding: 0.4em;\n padding-top: 0;\n}\n\n.mdn details[open] {\n min-width: 25ch;\n max-width: 32ch;\n background: #fff;\n background: var(--indextable-hover-bg, #fff);\n color: black;\n color: var(--indextable-hover-text, black);\n box-shadow:\n 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow:\n 0 1em 3em -0.4em var(--tocsidebar-shadow, rgba(0, 0, 0, 0.3)),\n 0 0 1px 1px var(--tocsidebar-shadow, rgba(0, 0, 0, 0.05));\n border-radius: 2px;\n z-index: 11;\n margin-bottom: 0.4em;\n}\n\n.mdn summary {\n text-align: right;\n cursor: default;\n margin-right: -0.4em;\n}\n\n.mdn summary span {\n font-family: zillaslab, Palatino, \"Palatino Linotype\", serif;\n color: #fff;\n color: var(--bg, #fff);\n background-color: #000;\n background-color: var(--text, #000);\n display: inline-block;\n padding: 3px;\n}\n\n.mdn a {\n display: inline-block;\n word-break: break-all;\n}\n\n.mdn p {\n margin: 0;\n}\n\n.mdn .engines-all {\n color: #058b00;\n}\n.mdn .engines-some {\n color: #b00;\n}\n\n.mdn table {\n width: 100%;\n font-size: 0.9em;\n}\n\n.mdn td {\n border: none;\n}\n\n.mdn td:nth-child(2) {\n text-align: right;\n}\n\n.mdn .nosupportdata {\n font-style: italic;\n margin: 0;\n}\n\n.mdn tr::before {\n content: \"\";\n display: table-cell;\n width: 1.5em;\n height: 1.5em;\n background: no-repeat center center / contain;\n font-size: 0.75em;\n}\n\n.mdn .no,\n.mdn .unknown {\n color: #cccccc;\n filter: grayscale(100%);\n}\n\n.mdn .no::before,\n.mdn .unknown::before {\n opacity: 0.5;\n}\n\n.mdn .chrome::before,\n.mdn .chrome_android::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/chrome/chrome.svg);\n}\n\n.mdn .edge::before,\n.mdn .edge_mobile::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/edge/edge.svg);\n}\n\n.mdn .firefox::before,\n.mdn .firefox_android::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/firefox/firefox.svg);\n}\n\n.mdn .opera::before,\n.mdn .opera_android::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/opera/opera.svg);\n}\n\n.mdn .safari::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/safari/safari.svg);\n}\n\n.mdn .safari_ios::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/safari-ios/safari-ios.svg);\n}\n\n.mdn .samsunginternet_android::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/samsung-internet/samsung-internet.svg);\n}\n\n.mdn .webview_android::before {\n background-image: url(https://www.w3.org/assets/logos/browser-logos/android-webview/android-webview.png);\n}\n`;\n","// @ts-check\nimport { fetchAndCache, getIntlData, showError } from \"./utils.js\";\nimport css from \"../styles/mdn-annotation.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/mdn-annotation\";\n\nconst BASE_JSON_PATH = \"https://w3c.github.io/mdn-spec-links/\";\nconst MDN_URL_BASE = \"https://developer.mozilla.org/en-US/docs/Web/\";\nconst MDN_BROWSERS = {\n // The browser IDs here must match the ones in the imported JSON data.\n // See the list of browser IDs at:\n // https://github.com/mdn/browser-compat-data/blob/master/schemas/compat-data-schema.md#browser-identifiers.\n chrome: \"Chrome\",\n chrome_android: \"Chrome Android\",\n edge: \"Edge\",\n edge_mobile: \"Edge Mobile\",\n firefox: \"Firefox\",\n firefox_android: \"Firefox Android\",\n // nodejs: \"Node.js\", // no data for features in HTML\n opera: \"Opera\",\n opera_android: \"Opera Android\",\n // qq_android: \"QQ Browser\", // not enough data for features in HTML\n safari: \"Safari\",\n safari_ios: \"Safari iOS\",\n samsunginternet_android: \"Samsung Internet\",\n // uc_android: \"UC browser\", // not enough data for features in HTML\n // uc_chinese_android: \"Chinese UC Browser\", // not enough data for features in HTML\n webview_android: \"WebView Android\",\n};\n\nconst localizationStrings = {\n en: {\n inAllEngines: \"This feature is in all major engines.\",\n inSomeEngines: \"This feature has limited support.\",\n },\n zh: {\n inAllEngines: \"ꉀ꜉äø»č¦å¼•ę“Žå‡ę”Æꌁꭤē‰¹ę€§ć€‚\",\n inSomeEngines: \"ę­¤åŠŸčƒ½ę”Æꌁ꜉限怂\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n/**\n * @param {HTMLElement} node\n */\nfunction insertMDNBox(node) {\n const targetAncestor = node.closest(\"section\");\n if (!targetAncestor) return;\n const { previousElementSibling: targetSibling } = targetAncestor;\n if (targetSibling && targetSibling.classList.contains(\"mdn\")) {\n // If the target ancestor already has a mdnBox inserted, we just use it\n return targetSibling;\n }\n const mdnBox = html`<aside class=\"mdn\"></aside>`;\n targetAncestor.before(mdnBox);\n return mdnBox;\n}\n\n/**\n * @param {MdnEntry} mdnSpec\n * @returns {HTMLDetailsElement}\n */\nfunction attachMDNDetail(mdnSpec) {\n const { name, slug, summary, support, engines } = mdnSpec;\n const mdnSubPath = slug.slice(slug.indexOf(\"/\") + 1);\n const href = `${MDN_URL_BASE}${slug}`;\n const label = `Expand MDN details for ${name}`;\n const engineSupport = getEngineSupportIcons(engines);\n return html`<details>\n <summary aria-label=\"${label}\"><span>MDN</span>${engineSupport}</summary>\n <a title=\"${summary}\" href=\"${href}\">${mdnSubPath}</a>\n ${getEngineSupport(engines)}\n ${support\n ? buildBrowserSupportTable(support)\n : html`<p class=\"nosupportdata\">No support data.</p>`}\n </details>`;\n}\n\n/**\n * @param {MdnEntry['support']} support\n * @returns {HTMLTableElement}\n */\nfunction buildBrowserSupportTable(support) {\n /**\n * @param {string | keyof MDN_BROWSERS} browserId\n * @param {\"Yes\" | \"No\" | \"Unknown\"} yesNoUnknown\n * @param {string} version\n * @returns {HTMLTableRowElement}\n */\n function createRow(browserId, yesNoUnknown, version) {\n const displayStatus = yesNoUnknown === \"Unknown\" ? \"?\" : yesNoUnknown;\n const classList = `${browserId} ${yesNoUnknown.toLowerCase()}`;\n return html`<tr class=\"${classList}\">\n <td>${MDN_BROWSERS[browserId]}</td>\n <td>${version ? version : displayStatus}</td>\n </tr>`;\n }\n\n /**\n * @param {string | keyof MDN_BROWSERS} browserId\n * @param {VersionDetails} versionData\n */\n function createRowFromBrowserData(browserId, versionData) {\n if (versionData.version_removed) {\n return createRow(browserId, \"No\", \"\");\n }\n const versionAdded = versionData.version_added;\n if (typeof versionAdded === \"boolean\") {\n return createRow(browserId, versionAdded ? \"Yes\" : \"No\", \"\");\n } else if (!versionAdded) {\n return createRow(browserId, \"Unknown\", \"\");\n } else {\n return createRow(browserId, \"Yes\", `${versionAdded}+`);\n }\n }\n\n return html`<table>\n ${Object.keys(MDN_BROWSERS).map(browserId => {\n return support[browserId]\n ? createRowFromBrowserData(browserId, support[browserId])\n : createRow(browserId, \"Unknown\", \"\");\n })}\n </table>`;\n}\n\nexport async function run(conf) {\n const mdnKey = getMdnKey(conf);\n if (!mdnKey) return;\n\n const mdnSpecJson = await getMdnData(mdnKey, conf.mdn);\n if (!mdnSpecJson) return;\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.append(style);\n\n for (const elem of findElements(mdnSpecJson)) {\n const mdnSpecArray = mdnSpecJson[elem.id];\n const mdnBox = insertMDNBox(elem);\n if (!mdnBox) continue;\n for (const spec of mdnSpecArray) {\n mdnBox.append(attachMDNDetail(spec));\n }\n }\n}\n\n/** @returns {string} */\nfunction getMdnKey(conf) {\n const { shortName, mdn } = conf;\n if (!mdn) return;\n if (typeof mdn === \"string\") return mdn;\n return mdn.key || shortName;\n}\n\n/**\n * @param {string} key MDN key\n * @param {object} mdnConf\n * @param {string} [mdnConf.specMapUrl]\n * @param {string} [mdnConf.baseJsonPath]\n * @param {number} [mdnConf.maxAge]\n *\n * @typedef {{ version_added: string|boolean|null, version_removed?: string }} VersionDetails\n * @typedef {Record<string | keyof MDN_BROWSERS, VersionDetails>} MdnSupportEntry\n * @typedef {{ name: string, title: string, slug: string, summary: string, support: MdnSupportEntry, engines: string[] }} MdnEntry\n * @typedef {Record<string, MdnEntry[]>} MdnData\n * @returns {Promise<MdnData|undefined>}\n */\nasync function getMdnData(key, mdnConf) {\n const { baseJsonPath = BASE_JSON_PATH, maxAge = 60 * 60 * 24 * 1000 } =\n mdnConf;\n const url = new URL(`${key}.json`, baseJsonPath).href;\n const res = await fetchAndCache(url, maxAge);\n if (res.status === 404) {\n const msg = `Could not find MDN data associated with key \"${key}\".`;\n const hint = \"Please add a valid key to `respecConfig.mdn`\";\n showError(msg, name, { hint });\n return;\n }\n return await res.json();\n}\n\n/**\n * Find elements that can have an annotation box attached.\n * @param {MdnData} data\n */\nfunction findElements(data) {\n /** @type {NodeListOf<HTMLElement>} */\n const elemsWithId = document.body.querySelectorAll(\"[id]:not(script)\");\n return [...elemsWithId].filter(({ id }) => Array.isArray(data[id]));\n}\n\n/**\n * @param {MdnEntry['engines']} engines\n * @returns {HTMLSpanElement}\n */\nfunction getEngineSupportIcons(engines) {\n if (engines.length === 3) {\n return html`<span title=\"${l10n.inAllEngines}\">āœ…</span>`;\n }\n if (engines.length < 2) {\n return html`<span title=\"${l10n.inSomeEngines}\">šŸš«</span>`;\n }\n return html`<span> </span>`;\n}\n\n/**\n * @param {MdnEntry['engines']} engines\n * @returns {HTMLParagraphElement|undefined}\n */\nfunction getEngineSupport(engines) {\n if (engines.length === 3) {\n return html`<p class=\"engines-all\">${l10n.inAllEngines}</p>`;\n }\n if (engines.length < 2) {\n return html`<p class=\"engines-some\">${l10n.inSomeEngines}</p>`;\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, getIntlData, showWarning } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { rsDocToDataURL } from \"../core/exporter.js\";\nimport { ui } from \"../core/ui.js\";\n\nexport const name = \"ui/save-html\";\n\nconst localizationStrings = {\n en: {\n save_snapshot: \"Export\",\n },\n nl: {\n save_snapshot: \"Bewaar Snapshot\",\n },\n ja: {\n save_snapshot: \"äæå­˜ć™ć‚‹\",\n },\n de: {\n save_snapshot: \"Exportieren\",\n },\n zh: {\n save_snapshot: \"åƼå‡ŗ\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst downloadLinks = [\n {\n id: \"respec-save-as-html\",\n ext: \"html\",\n title: \"HTML\",\n type: \"text/html\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-xml\",\n ext: \"xhtml\",\n title: \"XML\",\n type: \"application/xml\",\n get href() {\n return rsDocToDataURL(this.type);\n },\n },\n {\n id: \"respec-save-as-epub\",\n ext: \"epub\",\n title: \"EPUB 3\",\n type: \"application/epub+zip\",\n get href() {\n // Create and download an EPUB 3.2 version of the content\n // Using the EPUB 3.2 conversion service set up at labs.w3.org/r2epub\n // For more details on that service, see https://github.com/iherman/respec2epub\n const epubURL = new URL(\"https://labs.w3.org/r2epub/\");\n epubURL.searchParams.append(\"respec\", \"true\");\n epubURL.searchParams.append(\"url\", document.location.href);\n return epubURL.href;\n },\n },\n];\n\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"šŸ’¾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\n}\n\n/**\n * @param {*} _\n * @param {string} mimeType\n */\nexport function exportDocument(_, mimeType) {\n const msg =\n \"Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.\";\n const hint = \"Use core/exporter `rsDocToDataURL()` instead.\";\n showWarning(msg, name, { hint });\n return rsDocToDataURL(mimeType);\n}\n","// @ts-check\n// Module ui/search-specref\n// Search Specref database\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/specref/\";\n\nconst localizationStrings = {\n en: {\n search_specref: \"Search Specref\",\n },\n nl: {\n search_specref: \"Doorzoek Specref\",\n },\n ja: {\n search_specref: \"ä»•ę§˜ę¤œē“¢\",\n },\n de: {\n search_specref: \"Spezifikationen durchsuchen\",\n },\n zh: {\n search_specref: \"ꐜē“¢ Specref\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst button = ui.addCommand(\n l10n.search_specref,\n show,\n \"Ctrl+Shift+Alt+space\",\n \"šŸ”Ž\"\n);\n\nfunction show() {\n const onLoad = e => e.target.classList.add(\"ready\");\n /** @type {HTMLElement} */\n const specrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=${onLoad}></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.search_specref, specrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/search-xref\n// Search xref database\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst URL = \"https://respec.org/xref/\";\n\nconst localizationStrings = {\n en: {\n title: \"Search definitions\",\n },\n ja: {\n title: \"定ē¾©ę¤œē“¢\",\n },\n de: {\n title: \"Definitionen durchsuchen\",\n },\n zh: {\n title: \"ꐜē“¢å®šä¹‰\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst button = ui.addCommand(l10n.title, show, \"Ctrl+Shift+Alt+x\", \"šŸ“š\");\n\nfunction show() {\n const onLoad = e => e.target.classList.add(\"ready\");\n const xrefSearchUI = html`\n <iframe class=\"respec-iframe\" src=\"${URL}\" onload=\"${onLoad}\"></iframe>\n <a href=\"${URL}\" target=\"_blank\">Open Search UI in a new tab</a>\n `;\n ui.freshModal(l10n.title, xrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/about-respec\n// A simple about dialog with pointer to the help\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { ui } from \"../core/ui.js\";\n\nconst localizationStrings = {\n en: {\n about_respec: \"About\",\n },\n zh: {\n about_respec: \"关äŗŽ\",\n },\n nl: {\n about_respec: \"Over\",\n },\n ja: {\n about_respec: \"ć“ć‚Œć«ć¤ć„ć¦\",\n },\n de: {\n about_respec: \"Ɯber\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// window.respecVersion is added at build time (see tools/builder.js)\nwindow.respecVersion = window.respecVersion || \"Developer Edition\";\nconst div = document.createElement(\"div\");\nconst render = html.bind(div);\nconst button = ui.addCommand(\n `${l10n.about_respec} ${window.respecVersion}`,\n show,\n \"Ctrl+Shift+Alt+A\",\n \"ā„¹ļø\"\n);\n\nfunction show() {\n const entries = [];\n if (\"getEntriesByType\" in performance) {\n performance\n .getEntriesByType(\"measure\")\n .sort((a, b) => b.duration - a.duration)\n .map(({ name, duration }) => {\n const humanDuration =\n duration > 1000\n ? `${Math.round(duration / 1000.0)} second(s)`\n : `${duration.toFixed(2)} milliseconds`;\n return { name, duration: humanDuration };\n })\n .map(perfEntryToTR)\n .forEach(entry => {\n entries.push(entry);\n });\n }\n render`\n <p>\n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n </p>\n <p>\n <a href='https://respec.org/docs'>Documentation</a>,\n <a href='https://github.com/speced/respec/issues'>Bugs</a>.\n </p>\n <table border=\"1\" width=\"100%\" hidden=\"${entries.length ? false : true}\">\n <caption>\n Loaded plugins\n </caption>\n <thead>\n <tr>\n <th>\n Plugin Name\n </th>\n <th>\n Processing time\n </th>\n </tr>\n </thead>\n <tbody>${entries}</tbody>\n </table>\n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/speced/respec/blob/develop/src/${name}.js`;\n return html`\n <tr>\n <td><a href=\"${moduleURL}\">${name}</a></td>\n <td>${duration}</td>\n </tr>\n `;\n}\n","// @ts-check\n/**\n * This Module adds a metatag description to the document, based on the\n * first paragraph of the abstract.\n */\nimport { html } from \"../core/import-maps.js\";\n\nexport const name = \"core/seo\";\n\nexport function run(conf) {\n if (conf.gitRevision) {\n // This allows to set a git revision of the source used to produce the\n // generated content. Typically, this would be set when generating the\n // static HTML via a build process.\n // 'revision' is the name recommended in https://wiki.whatwg.org/wiki/MetaExtensions\n const metaElem = html`<meta\n name=\"revision\"\n content=\"${conf.gitRevision}\"\n />`;\n document.head.appendChild(metaElem);\n }\n\n const firstParagraph = document.querySelector(\"#abstract p:first-of-type\");\n if (!firstParagraph) {\n return; // no abstract, so nothing to do\n }\n // Normalize whitespace: trim, remove new lines, tabs, etc.\n const content = firstParagraph.textContent.replace(/\\s+/, \" \").trim();\n const metaElem = document.createElement(\"meta\");\n metaElem.name = \"description\";\n metaElem.content = content;\n document.head.appendChild(metaElem);\n}\n","// @ts-check\n// Module w3c/seo\n// Manages SEO information for documents\n// e.g. set the canonical URL for the document if configured\nimport { W3CNotes, recTrackStatus, registryTrackStatus } from \"./headers.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { resolveRef } from \"../core/biblio.js\";\nimport { showWarning } from \"../core/utils.js\";\nexport const name = \"w3c/seo\";\n\nconst status2rdf = {\n NOTE: \"w3p:NOTE\",\n WD: \"w3p:WD\",\n LC: \"w3p:LastCall\",\n CR: \"w3p:CR\",\n CRD: \"w3p:CRD\",\n PR: \"w3p:PR\",\n REC: \"w3p:REC\",\n RSCND: \"w3p:RSCND\",\n};\n\nexport const requiresCanonicalLink = new Set([\n ...W3CNotes,\n ...recTrackStatus,\n ...registryTrackStatus,\n \"BG-FINAL\",\n \"CG-FINAL\",\n \"CRY\",\n \"DRY\",\n \"draft-finding\",\n \"finding\",\n]);\n\nexport async function run(conf) {\n // Don't include a canonical URL for documents that haven't been published.\n if (\n (!conf.canonicalURI && !requiresCanonicalLink.has(conf.specStatus)) ||\n !conf.shortName\n ) {\n return;\n }\n switch (conf.canonicalURI) {\n case \"edDraft\":\n if (conf.edDraftURI) {\n conf.canonicalURI = new URL(\n conf.edDraftURI,\n document.location.href\n ).href;\n } else {\n const msg = `Canonical URI set to edDraft, but no edDraftURI is set in configuration`;\n showWarning(msg, name);\n conf.canonicalURI = null;\n }\n break;\n case \"TR\":\n if (conf.latestVersion) {\n conf.canonicalURI = conf.latestVersion;\n } else {\n const msg = `Canonical URI set to TR, but no shortName is set in configuration`;\n showWarning(msg, name);\n conf.canonicalURI = null;\n }\n break;\n default:\n if (conf.latestVersion && !conf.canonicalURI) {\n conf.canonicalURI = conf.latestVersion;\n }\n }\n if (conf.canonicalURI) {\n const linkElem = html`<link rel=\"canonical\" href=\"${conf.canonicalURI}\" />`;\n document.head.appendChild(linkElem);\n }\n\n if (conf.doJsonLd) {\n await addJSONLDInfo(conf, document);\n }\n}\n\nasync function addJSONLDInfo(conf, doc) {\n const rdfStatus = status2rdf[conf.specStatus];\n // Content for JSON\n const type = [\"TechArticle\"];\n if (rdfStatus) type.push(rdfStatus);\n\n const jsonld = {\n \"@context\": [\n \"http://schema.org\",\n {\n \"@vocab\": \"http://schema.org/\",\n \"@language\": doc.documentElement.lang || \"en\",\n w3p: \"http://www.w3.org/2001/02pd/rec54#\",\n foaf: \"http://xmlns.com/foaf/0.1/\",\n datePublished: { \"@type\": \"http://www.w3.org/2001/XMLSchema#date\" },\n inLanguage: { \"@language\": null },\n isBasedOn: { \"@type\": \"@id\" },\n license: { \"@type\": \"@id\" },\n },\n ],\n id: conf.canonicalURI || conf.thisVersion,\n type,\n name: document.title,\n inLanguage: doc.documentElement.lang || \"en\",\n license: conf.licenseInfo?.url,\n datePublished: conf.dashDate,\n /** @type {{ name: string, url?: string } | { name: string, url?: string }[]} */\n copyrightHolder: {\n name: \"World Wide Web Consortium\",\n url: \"https://www.w3.org/\",\n },\n discussionUrl: conf.issueBase,\n alternativeHeadline: conf.subtitle,\n isBasedOn: conf.prevVersion,\n };\n\n // add any additional copyright holders\n if (conf.additionalCopyrightHolders) {\n const addl = Array.isArray(conf.additionalCopyrightHolders)\n ? conf.additionalCopyrightHolders\n : [conf.additionalCopyrightHolders];\n jsonld.copyrightHolder = [\n jsonld.copyrightHolder,\n ...addl.map(h => ({ name: h })),\n ];\n }\n\n // description from meta description\n const description = doc.head.querySelector(\"meta[name=description]\");\n if (description) {\n jsonld.description = description.content;\n }\n\n // Editors\n if (conf.editors) {\n jsonld.editor = conf.editors.map(addPerson);\n }\n if (conf.authors) {\n jsonld.contributor = conf.authors.map(addPerson);\n }\n\n // normative and informative references\n const citationIds = [\n ...conf.normativeReferences,\n ...conf.informativeReferences,\n ];\n const citationContents = await Promise.all(\n citationIds.map(ref => resolveRef(ref))\n );\n jsonld.citation = citationContents\n .filter(ref => typeof ref === \"object\")\n .map(addRef);\n\n const script = doc.createElement(\"script\");\n script.type = \"application/ld+json\";\n script.textContent = JSON.stringify(jsonld, null, 2);\n doc.head.appendChild(script);\n}\n\n/**\n * Turn editors and authors into a list of JSON-LD relationships\n */\nfunction addPerson({ name, url, mailto, company, companyURL }) {\n const ed = {\n type: \"Person\",\n name,\n url,\n \"foaf:mbox\": mailto,\n };\n if (company || companyURL) {\n ed.worksFor = {\n name: company,\n url: companyURL,\n };\n }\n return ed;\n}\n\n/**\n * Create a reference URL from the ref\n */\nfunction addRef(ref) {\n const { href: id, title: name, href: url } = ref;\n const jsonld = {\n id,\n type: \"TechArticle\",\n name,\n url,\n };\n if (ref.authors) {\n jsonld.creator = ref.authors.map(a => ({ name: a }));\n }\n if (ref.rawDate) {\n jsonld.publishedDate = ref.rawDate;\n }\n if (ref.isbn) {\n jsonld.identifier = ref.isbn;\n }\n if (ref.publisher) {\n jsonld.publisher = { name: ref.publisher };\n }\n return jsonld;\n}\n","/*\nOne Light for ReSpec, with better color contrast\nAdapted from Atom One Light by Daniel Gamage (https://github.com/highlightjs/highlight.js/blob/c0b6ddbaaf7/src/styles/atom-one-light.css>\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\n*/\n\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n.hljs {\n --base: #fafafa;\n --mono-1: #383a42;\n --mono-2: #686b77;\n --mono-3: #717277;\n --hue-1: #0b76c5;\n --hue-2: #336ae3;\n --hue-3: #a626a4;\n --hue-4: #42803c;\n --hue-5: #ca4706;\n --hue-5-2: #c91243;\n --hue-6: #986801;\n --hue-6-2: #9a6a01;\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n .hljs {\n --base: #282c34;\n --mono-1: #abb2bf;\n --mono-2: #818896;\n --mono-3: #5c6370;\n --hue-1: #56b6c2;\n --hue-2: #61aeee;\n --hue-3: #c678dd;\n --hue-4: #98c379;\n --hue-5: #e06c75;\n --hue-5-2: #be5046;\n --hue-6: #d19a66;\n --hue-6-2: #e6c07b;\n }\n}\n\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n color: var(--mono-1, #383a42);\n background: #fafafa;\n background: var(--base, #fafafa);\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n color: var(--mono-3, #717277);\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n color: var(--hue-3, #a626a4);\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n color: var(--hue-5, #ca4706);\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n color: var(--hue-1, #0b76c5);\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n color: var(--hue-4, #42803c);\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #9a6a01;\n color: var(--hue-6-2, #9a6a01);\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n color: #986801;\n color: var(--hue-6, #986801);\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #336ae3;\n color: var(--hue-2, #336ae3);\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.hljs-link {\n text-decoration: underline;\n}\n`;\n","/**\n * @param {string} path\n */\nexport async function fetchBase(path) {\n const response = await fetch(new URL(`../../${path}`, import.meta.url));\n return await response.text();\n}\n","// @ts-check\n/**\n * Module core/worker\n *\n * Exports a Web Worker for ReSpec, allowing for\n * multi-threaded processing of things.\n */\nexport const name = \"core/worker\";\n\n// Opportunistically preload syntax highlighter, which is used by the worker\nimport { createResourceHint } from \"./utils.js\";\nimport { expose } from \"./expose-modules.js\";\nimport { fetchBase } from \"./text-loader.js\";\n// Opportunistically preload syntax highlighter\n/** @type ResourceHintOption */\nconst hint = {\n hint: \"preload\",\n href: \"https://www.w3.org/Tools/respec/respec-highlight\",\n as: \"script\",\n};\nconst link = createResourceHint(hint);\ndocument.head.appendChild(link);\n\nasync function loadWorkerScript() {\n try {\n return (await import(\"text!../../worker/respec-worker.js\")).default;\n } catch {\n return fetchBase(\"worker/respec-worker.js\");\n }\n}\n\nasync function createWorker() {\n const workerScript = await loadWorkerScript();\n const workerURL = URL.createObjectURL(\n new Blob([workerScript], { type: \"application/javascript\" })\n );\n return new Worker(workerURL);\n}\n\nexport const workerPromise = createWorker();\n\nexpose(\n name,\n workerPromise.then(worker => ({ worker }))\n);\n","// @ts-check\n/**\n * Module core/highlight\n *\n * Performs syntax highlighting to all pre and code elements.\n */\nimport css from \"../styles/highlight.css.js\";\nimport { html } from \"./import-maps.js\";\nimport { msgIdGenerator } from \"./utils.js\";\nimport { workerPromise } from \"./worker.js\";\nexport const name = \"core/highlight\";\n\nconst nextMsgId = msgIdGenerator(\"highlight\");\n\nfunction getLanguageHint(classList) {\n return Array.from(classList)\n .filter(item => item !== \"highlight\" && item !== \"nolinks\")\n .map(item => item.toLowerCase());\n}\n\nasync function highlightElement(elem) {\n elem.setAttribute(\"aria-busy\", \"true\");\n const languages = getLanguageHint(elem.classList);\n let response;\n try {\n response = await sendHighlightRequest(elem.innerText, languages);\n } catch (err) {\n console.error(err);\n return;\n }\n const { language, value } = response;\n switch (elem.localName) {\n case \"pre\":\n elem.classList.remove(language);\n elem.innerHTML = `<code class=\"hljs${\n language ? ` ${language}` : \"\"\n }\">${value}</code>`;\n if (!elem.classList.length) elem.removeAttribute(\"class\");\n break;\n case \"code\":\n elem.innerHTML = value;\n elem.classList.add(\"hljs\");\n if (language) elem.classList.add(language);\n break;\n }\n elem.setAttribute(\"aria-busy\", \"false\");\n}\n\nasync function sendHighlightRequest(code, languages) {\n const msg = {\n action: \"highlight\",\n code,\n id: nextMsgId(),\n languages,\n };\n const worker = await workerPromise;\n worker.postMessage(msg);\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n reject(new Error(\"Timed out waiting for highlight.\"));\n }, 4000);\n worker.addEventListener(\"message\", function listener(ev) {\n const {\n data: { id, language, value },\n } = ev;\n if (id !== msg.id) return; // not for us!\n worker.removeEventListener(\"message\", listener);\n clearTimeout(timeoutId);\n resolve({ language, value });\n });\n });\n}\n\nexport async function run(conf) {\n // Nothing to highlight\n if (conf.noHighlightCSS) return;\n const highlightables = [\n ...document.querySelectorAll(`\n pre:not(.idl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.nohighlight),\n code.highlight\n `),\n ].filter(\n // Filter pre's that contain code\n elem => elem.localName !== \"pre\" || !elem.querySelector(\"code\")\n );\n // Nothing to highlight\n if (!highlightables.length) {\n return;\n }\n const promisesToHighlight = highlightables\n .filter(elem => elem.textContent.trim())\n .map(highlightElement);\n document.head.appendChild(\n html`<style>\n ${css}\n </style>`\n );\n await Promise.all(promisesToHighlight);\n}\n","// @ts-check\n/**\n * Module core/data-tests\n *\n * Allows specs to link to test files in a test suite, by adding `details` of where\n * particular tests for a testable assertion can be found.\n *\n * `data-tests` takes a space separated list of URLs, e.g. data-test=\"foo.html bar.html\".\n *\n * Docs: https://respec.org/doc/#data-tests\n */\nimport {\n codedJoinAnd,\n docLink,\n getIntlData,\n showError,\n showWarning,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\nconst localizationStrings = {\n en: {\n missing_test_suite_uri: docLink`Found tests in your spec, but missing ${\"[testSuiteURI]\"} in your ReSpec config.`,\n tests: \"tests\",\n test: \"test\",\n },\n ja: {\n missing_test_suite_uri: docLink`ć“ć®ä»•ę§˜å†…ć«ćƒ†ć‚¹ćƒˆć®é …ē›®ć‚’ę¤œå‡ŗć—ć¾ć—ćŸćŒļ¼ŒReSpec 恮čØ­å®šć« ${\"[testSuiteURI]\"} ćŒč¦‹ć¤ć‹ć‚Šć¾ć›ć‚“ļ¼Ž`,\n tests: \"ćƒ†ć‚¹ćƒˆ\",\n test: \"ćƒ†ć‚¹ćƒˆ\",\n },\n de: {\n missing_test_suite_uri: docLink`Die Spezifikation enthƤlt Tests, aber in der ReSpec-Konfiguration ist keine ${\"[testSuiteURI]\"} angegeben.`,\n tests: \"Tests\",\n test: \"Test\",\n },\n zh: {\n missing_test_suite_uri: docLink`ęœ¬č§„čŒƒäø­åŒ…å«ęµ‹čƕļ¼Œä½†åœØ ReSpec 配ē½®äø­ē¼ŗ少 ${\"[testSuiteURI]\"}怂`,\n tests: \"굋čƕ\",\n test: \"굋čƕ\",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport const name = \"core/data-tests\";\n\nfunction toListItem(href) {\n const emojiList = [];\n const [testFile] = new URL(href).pathname.split(\"/\").reverse();\n const testParts = testFile.split(\".\");\n let [testFileName] = testParts;\n\n const isSecureTest = testParts.find(part => part === \"https\");\n if (isSecureTest) {\n const requiresConnectionEmoji = document.createElement(\"span\");\n requiresConnectionEmoji.textContent = \"šŸ”’\";\n requiresConnectionEmoji.setAttribute(\n \"aria-label\",\n \"requires a secure connection\"\n );\n requiresConnectionEmoji.setAttribute(\"title\", \"Test requires HTTPS\");\n testFileName = testFileName.replace(\".https\", \"\");\n emojiList.push(requiresConnectionEmoji);\n }\n\n const isManualTest = testFileName\n .split(\".\")\n .join(\"-\")\n .split(\"-\")\n .find(part => part === \"manual\");\n if (isManualTest) {\n const manualPerformEmoji = document.createElement(\"span\");\n manualPerformEmoji.textContent = \"šŸ’Ŗ\";\n manualPerformEmoji.setAttribute(\n \"aria-label\",\n \"the test must be run manually\"\n );\n manualPerformEmoji.setAttribute(\"title\", \"Manual test\");\n testFileName = testFileName.replace(\"-manual\", \"\");\n emojiList.push(manualPerformEmoji);\n }\n\n const testList = html`\n <li>\n <a href=\"${href}\">${testFileName}</a>\n ${emojiList}\n </li>\n `;\n return testList;\n}\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n if (!testables.length) {\n return;\n }\n if (!conf.testSuiteURI) {\n showError(l10n.missing_test_suite_uri, name);\n return;\n }\n\n for (const elem of testables) {\n const tests = elem.dataset.tests.split(/,/gm).map(url => url.trim());\n const testURLs = toTestURLs(tests, conf.testSuiteURI, elem);\n handleDuplicates(testURLs, elem);\n const details = toHTML(testURLs);\n elem.append(details);\n }\n}\n\n/**\n * @param {string[]} tests\n * @param {string} testSuiteURI\n * @param {HTMLElement} elem\n */\nfunction toTestURLs(tests, testSuiteURI, elem) {\n return tests\n .map(test => {\n try {\n return new URL(test, testSuiteURI).href;\n } catch {\n const msg = docLink`Invalid URL in ${\"[data-tests]\"} attribute: ${test}.`;\n showWarning(msg, name, { elements: [elem] });\n }\n })\n .filter(href => href);\n}\n\n/**\n * @param {string[]} testURLs\n * @param {HTMLElement} elem\n */\nfunction handleDuplicates(testURLs, elem) {\n const duplicates = testURLs.filter(\n (link, i, self) => self.indexOf(link) !== i\n );\n if (duplicates.length) {\n const msg = docLink`Duplicate tests found in the ${\"[data-tests]\"} attribute.`;\n const tests = codedJoinAnd(duplicates, { quotes: true });\n const hint = docLink`To fix, remove duplicates from ${\"[data-tests]\"}: ${tests}.`;\n showWarning(msg, name, { hint, elements: [elem] });\n }\n}\n\n/**\n * @param {string[]} testURLs\n */\nfunction toHTML(testURLs) {\n const uniqueList = [...new Set(testURLs)];\n const details = html`\n <details class=\"respec-tests-details removeOnSave\">\n <summary>tests: ${uniqueList.length}</summary>\n <ul>\n ${uniqueList.map(toListItem)}\n </ul>\n </details>\n `;\n return details;\n}\n","// @ts-check\nimport { showWarning } from \"./utils.js\";\nexport const name = \"core/list-sorter\";\n\nfunction makeSorter(direction) {\n const order = direction === \"ascending\" ? 1 : -1;\n return ({ textContent: a }, { textContent: b }) => {\n return order * a.trim().localeCompare(b.trim());\n };\n}\n/**\n * Shallow sort list items in OL, and UL elements.\n *\n * @param {HTMLUListElement} elem\n * @returns {DocumentFragment}\n */\nexport function sortListItems(elem, dir) {\n const elements = [...elem.querySelectorAll(\":scope > li\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n frag.appendChild(elem);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\n/**\n * Shallow sort a definition list based on its definition terms (dt) elements.\n *\n * @param {HTMLDListElement} dl\n * @returns {DocumentFragment}\n */\nexport function sortDefinitionTerms(dl, dir) {\n const elements = [...dl.querySelectorAll(\":scope > dt\")];\n const sortedElements = elements.sort(makeSorter(dir)).reduce((frag, elem) => {\n const { nodeType, nodeName } = elem;\n const children = document.createDocumentFragment();\n let { nextSibling: next } = elem;\n while (next) {\n if (!next.nextSibling) {\n break;\n }\n children.appendChild(next.cloneNode(true));\n const { nodeType: nextType, nodeName: nextName } = next.nextSibling;\n const isSameType = nextType === nodeType && nextName === nodeName;\n if (isSameType) {\n break;\n }\n next = next.nextSibling;\n }\n children.prepend(elem.cloneNode(true));\n frag.appendChild(children);\n return frag;\n }, document.createDocumentFragment());\n return sortedElements;\n}\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const sortables = document.querySelectorAll(\"[data-sort]\");\n for (const elem of sortables) {\n let sortedElems;\n const dir = elem.dataset.sort || \"ascending\";\n switch (elem.localName) {\n case \"dl\": {\n const definition = /** @type {HTMLDListElement} */ (elem);\n sortedElems = sortDefinitionTerms(definition, dir);\n break;\n }\n case \"ol\":\n case \"ul\": {\n const list = /** @type {HTMLUListElement} */ (elem);\n sortedElems = sortListItems(list, dir);\n break;\n }\n default: {\n const msg = `ReSpec can't sort ${elem.localName} elements.`;\n showWarning(msg, name, { elements: [elem] });\n }\n }\n if (sortedElems) {\n const range = document.createRange();\n range.selectNodeContents(elem);\n range.deleteContents();\n elem.appendChild(sortedElems);\n }\n }\n}\n","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\nvar.respec-hl {\n color: var(--color, #000);\n background-color: var(--bg-color);\n box-shadow: 0 0 0px 2px var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n var.respec-hl {\n filter: saturate(0.9) brightness(0.9)\n }\n}\n\n/* highlight colors\n https://github.com/w3c/tr-design/issues/152\n*/\nvar.respec-hl-c1 {\n --bg-color: #f4d200;\n}\n\nvar.respec-hl-c2 {\n --bg-color: #ff87a2;\n}\n\nvar.respec-hl-c3 {\n --bg-color: #96e885;\n}\n\nvar.respec-hl-c4 {\n --bg-color: #3eeed2;\n}\n\nvar.respec-hl-c5 {\n --bg-color: #eacfb6;\n}\n\nvar.respec-hl-c6 {\n --bg-color: #82ddff;\n}\n\nvar.respec-hl-c7 {\n --bg-color: #ffbcf2;\n}\n\n@media print {\n var.respec-hl {\n background: none;\n color: #000;\n box-shadow: unset;\n }\n}\n`;\n","// @ts-check\n/**\n * Module core/highlight-vars\n * Highlights occurrences of a <var> within the algorithm or the encompassing section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from <var> if clicked anywhere else.\n * All is done while keeping in mind that exported html stays clean\n * on export.\n */\nimport css from \"../styles/var.css.js\";\nimport { norm } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/highlight-vars\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n const styleElement = document.createElement(\"style\");\n styleElement.textContent = css;\n styleElement.classList.add(\"removeOnSave\");\n document.head.appendChild(styleElement);\n\n document\n .querySelectorAll(\"var\")\n .forEach(varElem => varElem.addEventListener(\"click\", highlightListener));\n\n // remove highlights, cleanup empty class/style attributes\n sub(\"beforesave\", outputDoc => {\n outputDoc.querySelectorAll(\"var.respec-hl\").forEach(removeHighlight);\n });\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","const css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\nvar {\n position: relative;\n cursor: pointer;\n}\n\nvar[data-type]::before,\nvar[data-type]::after {\n position: absolute;\n left: 50%;\n top: -6px;\n opacity: 0;\n transition: opacity 0.4s;\n pointer-events: none;\n}\n\n/* the triangle or arrow or caret or whatever */\nvar[data-type]::before {\n content: \"\";\n transform: translateX(-50%);\n border-width: 4px 6px 0 6px;\n border-style: solid;\n border-color: transparent;\n border-top-color: #222;\n}\n\n/* actual text */\nvar[data-type]::after {\n content: attr(data-type);\n transform: translateX(-50%) translateY(-100%);\n background: #222;\n text-align: center;\n /* additional styling */\n font-family: \"Dank Mono\", \"Fira Code\", monospace;\n font-style: normal;\n padding: 6px;\n border-radius: 3px;\n color: #daca88;\n text-indent: 0;\n font-weight: normal;\n}\n\nvar[data-type]:hover::after,\nvar[data-type]:hover::before {\n opacity: 1;\n}\n`;\n","// @ts-check\n/**\n * Module core/data-type\n * Propagates data type of a <var> to subsequent instances within a section.\n * Also adds the CSS for the data type tooltip.\n * Set `conf.highlightVars = true` to enable.\n */\nimport css from \"../styles/datatype.css.js\";\n\nexport const name = \"core/data-type\";\n\nexport function run(conf) {\n if (!conf.highlightVars) {\n return;\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n\n let section = null;\n const varMap = new Map();\n /** @type {NodeListOf<HTMLElement>} */\n const variables = document.querySelectorAll(\"section var\");\n for (const varElem of variables) {\n const currentSection = varElem.closest(\"section\");\n if (section !== currentSection) {\n section = currentSection;\n varMap.clear();\n }\n if (varElem.dataset.type) {\n varMap.set(varElem.textContent.trim(), varElem.dataset.type);\n continue;\n }\n const type = varMap.get(varElem.textContent.trim());\n if (type) varElem.dataset.type = type;\n }\n}\n","/* For assertions in lists containing algorithms */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\n:root {\n --assertion-border: #aaa;\n --assertion-bg: #eee;\n --assertion-text: black;\n}\n\n.assert {\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n border-color: #aaa;\n border-color: var(--assertion-border);\n background: #eee;\n background: var(--assertion-bg);\n color: black;\n color: var(--assertion-text);\n}\n\n/* There's no way to adapt this to \"manual\" theme toggle yet. */\n@media (prefers-color-scheme: dark) {\n :root {\n --assertion-border: #444;\n --assertion-bg: var(--borderedblock-bg);\n --assertion-text: var(--text);\n }\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n}\n","// @ts-check\n// expands empty anchors based on their context\nimport { makeSafeCopy, norm, renameElement, showError } from \"./utils.js\";\n\nexport const name = \"core/anchor-expander\";\n\nexport function run() {\n /** @type {NodeListOf<HTMLElement>} */\n const anchorElements = document.querySelectorAll(\n \"a[href^='#']:not(.self-link):not([href$='the-empty-string'])\"\n );\n const anchors = [...anchorElements].filter(a => a.textContent.trim() === \"\");\n for (const a of anchors) {\n const id = a.getAttribute(\"href\").slice(1);\n const matchingElement = document.getElementById(id);\n if (!matchingElement) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Couldn't expand inline reference. The id \"${id}\" is not in the document.`;\n const title = `No matching id in document: ${id}.`;\n showError(msg, name, { title, elements: [a] });\n continue;\n }\n switch (matchingElement.localName) {\n case \"h6\":\n case \"h5\":\n case \"h4\":\n case \"h3\":\n case \"h2\": {\n processHeading(matchingElement, a);\n break;\n }\n case \"section\": {\n // find first heading in the section\n processSection(matchingElement, id, a);\n break;\n }\n case \"figure\": {\n processFigure(matchingElement, id, a);\n break;\n }\n case \"table\": {\n processTable(matchingElement, id, a);\n break;\n }\n case \"aside\":\n case \"div\": {\n processBox(matchingElement, id, a);\n break;\n }\n default: {\n a.textContent = a.getAttribute(\"href\");\n const msg = \"ReSpec doesn't support expanding this kind of reference.\";\n const title = `Can't expand \"#${id}\".`;\n showError(msg, name, { title, elements: [a] });\n }\n }\n localize(matchingElement, a);\n a.normalize();\n }\n}\n\nfunction processBox(matchingElement, id, a) {\n const selfLink = matchingElement.querySelector(\".marker .self-link\");\n if (!selfLink) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching element \"${id}\", but it has no title or marker.`;\n const title = \"Missing title.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n const copy = makeSafeCopy(selfLink);\n a.append(...copy.childNodes);\n a.classList.add(\"box-ref\");\n}\n\nfunction processFigure(matchingElement, id, a) {\n const figcaption = matchingElement.querySelector(\"figcaption\");\n if (!figcaption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching figure \"${id}\", but figure is lacking a \\`<figcaption>\\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"fig-ref\");\n const figTitle = figcaption.querySelector(\".fig-title\");\n if (!a.hasAttribute(\"title\") && figTitle) {\n a.title = norm(figTitle.textContent);\n }\n}\n\nfunction processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.textContent);\n }\n}\n\nfunction processSection(matchingElement, id, a) {\n const heading = matchingElement.querySelector(\"h6, h5, h4, h3, h2\");\n if (!heading) {\n a.textContent = a.getAttribute(\"href\");\n const msg =\n \"Found matching section, but the section was lacking a heading element.\";\n const title = `No matching id in document: \"${id}\".`;\n showError(msg, name, { title, elements: [a] });\n return;\n }\n processHeading(heading, a);\n localize(heading, a);\n}\n\nfunction processHeading(heading, a) {\n const hadSelfLink = heading.querySelector(\".self-link\");\n const children = [...makeSafeCopy(heading).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"self-link\")\n );\n a.append(...children);\n if (hadSelfLink) a.prepend(\"Ā§\\u00A0\");\n a.classList.add(\"sec-ref\");\n // Trim stray whitespace of the last text node (see bug #3265).\n if (a.lastChild.nodeType === Node.TEXT_NODE) {\n a.lastChild.textContent = a.lastChild.textContent.trimEnd();\n }\n // Replace all inner anchors for span elements (see bug #3136)\n a.querySelectorAll(\"a\").forEach(a => {\n const span = renameElement(a, \"span\");\n // Remove the old attributes\n for (const attr of [...span.attributes]) {\n span.removeAttributeNode(attr);\n }\n });\n}\n\nfunction localize(matchingElement, newElement) {\n for (const attrName of [\"dir\", \"lang\"]) {\n // Already set on element, don't override.\n if (newElement.hasAttribute(attrName)) continue;\n\n // Closest in tree setting the attribute\n const matchingClosest = matchingElement.closest(`[${attrName}]`);\n if (!matchingClosest) continue;\n\n // Closest to reference setting the attribute\n const newClosest = newElement.closest(`[${attrName}]`);\n\n // It's the same, so already inherited from closest (probably HTML element or body).\n if (\n newClosest &&\n newClosest.getAttribute(attrName) ===\n matchingClosest.getAttribute(attrName)\n )\n continue;\n // Otherwise, set it.\n newElement.setAttribute(attrName, matchingClosest.getAttribute(attrName));\n }\n}\n","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/speced/respec/pull/2888 when\n * https://github.com/w3c/css-validator/pull/111 is fixed.\n */\nconst css = String.raw;\n\n// Prettier ignore only to keep code indented from level 0.\n// prettier-ignore\nexport default css`\ndfn {\n cursor: pointer;\n}\n\n.dfn-panel {\n position: absolute;\n z-index: 35;\n min-width: 300px;\n max-width: 500px;\n padding: 0.5em 0.75em;\n margin-top: 0.6em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\n background: #fff;\n background: var(--indextable-hover-bg, #fff);\n color: black;\n color: var(--text, black);\n box-shadow: 0 1em 3em -0.4em rgba(0, 0, 0, 0.3),\n 0 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: 0 1em 3em -0.4em var(--tocsidebar-shadow, rgba(0, 0, 0, 0.3)),\n 0 0 1px 1px var(--tocsidebar-shadow, rgba(0, 0, 0, 0.05));\n border-radius: 2px;\n}\n/* Triangle/caret */\n.dfn-panel:not(.docked) > .caret {\n position: absolute;\n top: -9px;\n}\n.dfn-panel:not(.docked) > .caret::before,\n.dfn-panel:not(.docked) > .caret::after {\n content: \"\";\n position: absolute;\n border: 10px solid transparent;\n border-top: 0;\n border-bottom: 10px solid #fff;\n border-bottom-color: var(--indextable-hover-bg, #fff);\n top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n /* TODO: need slightly darker shade */\n border-bottom-color: var(--indextable-hover-bg, #a2a9b1);\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n color: var(--text, #000);\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #333;\n color: var(--text, #333);\n}\n\n.dfn-panel > div {\n display: flex;\n}\n\n.dfn-panel a.self-link {\n font-weight: bold;\n margin-right: auto;\n}\n\n.dfn-panel .marker {\n padding: 0.1em;\n margin-left: 0.5em;\n border-radius: 0.2em;\n text-align: center;\n white-space: nowrap;\n font-size: 90%;\n color: #040b1c;\n}\n\n.dfn-panel .marker.dfn-exported {\n background: #d1edfd;\n box-shadow: 0 0 0 0.125em #1ca5f940;\n}\n.dfn-panel .marker.idl-block {\n background: #8ccbf2;\n box-shadow: 0 0 0 0.125em #0670b161;\n}\n\n.dfn-panel a:not(:hover) {\n text-decoration: none !important;\n border-bottom: none !important;\n}\n\n.dfn-panel a[href]:hover {\n border-bottom-width: 1px;\n}\n\n.dfn-panel ul {\n padding: 0;\n}\n\n.dfn-panel li {\n margin-left: 1em;\n}\n\n.dfn-panel.docked {\n position: fixed;\n left: 0.5em;\n top: unset;\n bottom: 2em;\n margin: 0 auto;\n /* 0.75em from padding (x2), 0.5em from left position, 0.2em border (x2) */\n max-width: calc(100vw - 0.75em * 2 - 0.5em - 0.2em * 2);\n max-height: 30vh;\n overflow: auto;\n}\n`;\n","// @ts-check\n// Constructs \"dfn panels\" which show all the local references to a dfn and a\n// self link to the selected dfn. Based on Bikeshed's dfn panels at\n// https://github.com/tabatkins/bikeshed/blob/ef44162c2e/bikeshed/dfnpanels.py\nimport css from \"../styles/dfn-panel.css.js\";\nimport { fetchBase } from \"./text-loader.js\";\nimport { html } from \"./import-maps.js\";\nimport { norm } from \"./utils.js\";\n\nexport const name = \"core/dfn-panel\";\n\nexport async function run() {\n document.head.insertBefore(\n html`<style>\n ${css}\n </style>`,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\n \"dfn[id]:not([data-cite]), #index-defined-elsewhere .index-term\"\n );\n const panels = document.createDocumentFragment();\n for (const el of elems) {\n panels.append(createPanel(el));\n // Make it possible to reach el by tabbing,\n // allowing keyboard action as needed.\n el.tabIndex = 0;\n el.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n document.body.append(panels);\n\n const script = document.createElement(\"script\");\n script.id = \"respec-dfn-panel\";\n script.textContent = await loadScript();\n document.body.append(script);\n}\n\n/** @param {HTMLElement} dfn */\nfunction createPanel(dfn) {\n const { id } = dfn;\n const href = dfn.dataset.href || `#${id}`;\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const links = document.querySelectorAll(`a[href=\"${href}\"]:not(.index-term)`);\n\n const panelId = `dfn-panel-for-${dfn.id}`;\n const definition = dfn.getAttribute(\"aria-label\") || norm(dfn.textContent);\n /** @type {HTMLElement} */\n const panel = html`\n <div\n class=\"dfn-panel\"\n id=\"${panelId}\"\n hidden\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Links in this document to definition: ${definition}\"\n >\n <span class=\"caret\"></span>\n <div>\n <a\n class=\"self-link\"\n href=\"${href}\"\n aria-label=\"Permalink for definition: ${definition}. Activate to close this dialog.\"\n >Permalink</a\n >\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n </div>\n <p><b>Referenced in:</b></p>\n ${referencesToHTML(id, links)}\n </div>\n `;\n return panel;\n}\n\n/** @param {HTMLElement} dfn */\nfunction dfnExportedMarker(dfn) {\n if (!dfn.matches(\"dfn[data-export]\")) return null;\n return html`<span\n class=\"marker dfn-exported\"\n title=\"Definition can be referenced by other specifications\"\n >exported</span\n >`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf<HTMLAnchorElement>} links\n */\nfunction idlMarker(dfn, links) {\n if (!dfn.hasAttribute(\"data-idl\")) return null;\n\n for (const anchor of links) {\n if (anchor.dataset.linkType !== dfn.dataset.dfnType) continue;\n const parentIdlBlock = anchor.closest(\"pre.idl\");\n if (parentIdlBlock && parentIdlBlock.id) {\n const href = `#${parentIdlBlock.id}`;\n return html`<a\n href=\"${href}\"\n class=\"marker idl-block\"\n title=\"Jump to IDL declaration\"\n >IDL</a\n >`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf<HTMLAnchorElement>} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`<ul>\n <li>Not referenced in this document.</li>\n </ul>`;\n }\n\n /** @type {Map<string, string[]>} */\n const titleToIDs = new Map();\n links.forEach((link, i) => {\n const linkID = link.id || `ref-for-${id}-${i + 1}`;\n if (!link.id) link.id = linkID;\n const title = getReferenceTitle(link);\n const ids = titleToIDs.get(title) || titleToIDs.set(title, []).get(title);\n ids.push(linkID);\n });\n\n /**\n * Returns a list that is easier to render in `listItemToHTML`.\n * @param {[string, string[]]} entry an entry from `titleToIDs`\n * @returns {{ title: string, text: string, id: string, }[]} The first list item contains\n * title from `getReferenceTitle`, rest of items contain strings like `(2)`,\n * `(3)` as title.\n */\n const toLinkProps = ([title, ids]) => {\n return [{ title, id: ids[0], text: title }].concat(\n ids.slice(1).map((id, i) => ({\n title: `Reference ${i + 2}`,\n text: `(${i + 2})`,\n id,\n }))\n );\n };\n\n /**\n * @param {[string, string[]]} entry\n * @returns {HTMLLIElement}\n */\n const listItemToHTML = entry => {\n return html`<li>\n ${toLinkProps(entry).map(link => {\n return html`<a href=\"#${link.id}\" title=\"${link.title}\">${link.text}</a\n >${\" \"}`;\n })}\n </li>`;\n };\n\n return html`<ul>\n ${[...titleToIDs].map(listItemToHTML)}\n </ul>`;\n}\n\n/** @param {HTMLAnchorElement} link */\nfunction getReferenceTitle(link) {\n const section = link.closest(\"section\");\n if (!section) return null;\n const heading = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\n if (!heading) return null;\n return `Ā§ ${norm(heading.textContent)}`;\n}\n\nasync function loadScript() {\n try {\n return (await import(\"text!./dfn-panel.runtime.js\")).default;\n } catch {\n return fetchBase(\"./src/core/dfn-panel.runtime.js\");\n }\n}\n","// @ts-check\n/**\n * Fetches commits between two commitish (tag or commit) - `from` and `to=HEAD`\n * and shows them as a list of \"changes during\" those commitish. If a filter\n * function is provided by the user, it is used to filter the commits that are\n * to be shown. Otherwise, all commits are shown.\n *\n * @typedef {{message: string, hash: string}} Commit\n */\nimport { github } from \"../github.js\";\nimport { html } from \"../import-maps.js\";\nimport { showError } from \"../utils.js\";\n\nexport const name = \"rs-changelog\";\n\nexport const element = class ChangelogElement extends HTMLElement {\n constructor() {\n super();\n this.props = {\n from: this.getAttribute(\"from\"),\n to: this.getAttribute(\"to\") || \"HEAD\",\n /** @type {(commit: Commit) => boolean} */\n filter:\n typeof window[this.getAttribute(\"filter\")] === \"function\"\n ? window[this.getAttribute(\"filter\")]\n : () => true,\n };\n }\n\n connectedCallback() {\n const { from, to, filter } = this.props;\n html.bind(this)`\n <ul>\n ${{\n any: fetchCommits(from, to, filter)\n .then(commits => toHTML(commits))\n .catch(error =>\n showError(error.message, name, { elements: [this], cause: error })\n )\n .finally(() => {\n this.dispatchEvent(new CustomEvent(\"done\"));\n }),\n placeholder: \"Loading list of commits...\",\n }}\n </ul>\n `;\n }\n};\n\nasync function fetchCommits(from, to, filter) {\n /** @type {Commit[]} */\n let commits;\n try {\n const gh = await github;\n if (!gh) {\n throw new Error(\"`respecConfig.github` is not set\");\n }\n const url = new URL(\"commits\", `${gh.apiBase}/${gh.fullName}/`);\n url.searchParams.set(\"from\", from);\n url.searchParams.set(\"to\", to);\n\n const res = await fetch(url.href);\n if (!res.ok) {\n throw new Error(\n `Request to ${url} failed with status code ${res.status}`\n );\n }\n commits = await res.json();\n if (!commits.length) {\n throw new Error(`No commits between ${from}..${to}.`);\n }\n commits = commits.filter(filter);\n } catch (error) {\n const msg = `Error loading commits from GitHub. ${error.message}`;\n throw new Error(msg, { cause: error });\n }\n return commits;\n}\n\nasync function toHTML(commits) {\n const { repoURL } = await github;\n return commits.map(commit => {\n const [message, prNumber = null] = commit.message.split(/\\(#(\\d+)\\)/, 2);\n const commitURL = `${repoURL}commit/${commit.hash}`;\n const prURL = prNumber ? `${repoURL}pull/${prNumber}` : null;\n const pr = prNumber && html` (<a href=\"${prURL}\">#${prNumber}</a>)`;\n return html`<li><a href=\"${commitURL}\">${message.trim()}</a>${pr}</li>`;\n });\n}\n","// @ts-check\n/**\n * Registers custom elements and waits for them to finish their processing.\n *\n * Every custom element file exports:\n * - `name`: registered name of the custom element, prefixed with `rs-`.\n * - `element`: class defintion of the custom element.\n *\n * Every custom element must dispatch a CustomEvent 'done' that tells the\n * element has finished its processing, with or without errors.\n *\n * @typedef {{ name: string, element: CustomElementConstructor }} CustomElementDfn\n */\n\nimport * as changelog from \"./rs-changelog.js\";\n/** @type {CustomElementDfn[]} */\nconst CUSTOM_ELEMENTS = [changelog];\n\nexport const name = \"core/custom-elements/index\";\n\nexport async function run() {\n // prepare and register elements\n CUSTOM_ELEMENTS.forEach(el => {\n customElements.define(el.name, el.element);\n });\n\n // wait for each element to be ready\n const selectors = CUSTOM_ELEMENTS.map(el => el.name).join(\", \");\n const elems = document.querySelectorAll(selectors);\n const readyPromises = [...elems].map(\n el => new Promise(res => el.addEventListener(\"done\", res, { once: true }))\n );\n await Promise.all(readyPromises);\n}\n","// @ts-check\n/**\n * This module adds a \"monetization\" meta-tag to enable web-monetization.\n *\n * The meta-tag is added only to \"live\" documents, and is removed from generated\n * static documents.\n */\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/web-monetization\";\n\nexport function run(conf) {\n if (conf.monetization === false) {\n return;\n }\n const { monetization } = conf;\n\n const { removeOnSave, paymentPointer } = canonicalizeConfig(monetization);\n\n const cssClass = removeOnSave ? \"removeOnSave\" : null;\n document.head.append(\n html`<meta\n name=\"monetization\"\n content=\"${paymentPointer}\"\n class=\"${cssClass}\"\n />`\n );\n}\n\n/**\n * @param {object|string} rawConfig\n * - {string} paymentPointer - The payment pointer to use.\n * - {boolean} removeOnSave - Whether to remove the meta tag when the document is saved.\n */\nfunction canonicalizeConfig(rawConfig) {\n const config = {\n paymentPointer: \"$respec.org\",\n removeOnSave: true,\n };\n switch (typeof rawConfig) {\n case \"string\":\n config.paymentPointer = rawConfig;\n break;\n case \"object\":\n if (rawConfig.paymentPointer) {\n config.paymentPointer = String(rawConfig.paymentPointer);\n }\n if (rawConfig.removeOnSave === false) {\n config.removeOnSave = false;\n }\n break;\n }\n return config;\n}\n","export const name = \"core/dfn-contract\";\n\nexport function run() {\n addContractDefaults();\n addDefinitionPointers();\n}\n\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf<HTMLElement> */\n const dfnsWithNoType = document.querySelectorAll(\n \"dfn:is([data-dfn-type=''],:not([data-dfn-type]))\"\n );\n for (const dfn of dfnsWithNoType) {\n dfn.dataset.dfnType = \"dfn\";\n }\n\n // Per \"the contract\", export all definitions, except where:\n // - Explicitly marked with data-noexport.\n // - The type is \"dfn\" and not explicitly marked for export (i.e., just a regular definition).\n // - definitions was included via (legacy) data-cite=\"foo#bar\".\n /** @type NodeListOf<HTMLElement> */\n const exportableDfns = document.querySelectorAll(\n \"dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])\"\n );\n for (const dfn of exportableDfns) {\n dfn.dataset.export = \"\";\n }\n}\n\n// - Sets data-defines on well-known definition content patterns\nfunction addDefinitionPointers() {\n // A dl with class hasdefinitions associated the dfn in each dt\n // the definition in the following sibling element\n /** @type NodeListOf<HTMLElement> */\n const describedDTs = document.querySelectorAll(\n \"dl.definitions dt:has(dfn[data-dfn-type])\"\n );\n for (const dt of describedDTs) {\n const dfnId = dt.querySelector(\"dfn[data-dfn-type]\").id;\n const dfnContent = /** @type {HTMLElement | null} */ (\n dt.nextElementSibling\n );\n if (dfnContent && !dfnContent.dataset.defines && dfnId) {\n dfnContent.dataset.defines = `#${dfnId}`;\n }\n }\n\n // an element with class \"definition\" is marked as defining the term\n // found in the element\n /** @type NodeListOf<HTMLElement> */\n const definitionContainers = document.querySelectorAll(\n \".definition:has(dfn[data-dfn-type])\"\n );\n for (const el of definitionContainers) {\n const dfn = el.querySelector(\"dfn[data-dfn-type]\");\n if (dfn.id && !el.dataset.defines) {\n el.dataset.defines = `#${dfn.id}`;\n }\n }\n}\n","import { docLink, showError } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/before-save\";\n\nexport function run(conf) {\n if (!conf.beforeSave) return;\n\n if (\n !Array.isArray(conf.beforeSave) ||\n conf.beforeSave.some(\n el => typeof el !== \"function\" || el.constructor.name === \"AsyncFunction\"\n )\n ) {\n const msg = docLink`${\"[beforeSave]\"} configuration option must be an array of synchronous JS functions.`;\n showError(msg, name);\n return;\n }\n\n sub(\n \"beforesave\",\n documentElement => {\n performTransformations(conf.beforeSave, documentElement.ownerDocument);\n },\n { once: true }\n );\n}\n/**\n * @param {Array<Function>} transforms\n * @param {Document}\n */\nfunction performTransformations(transforms, doc) {\n let pos = 0;\n for (const fn of transforms) {\n try {\n fn(doc);\n } catch (err) {\n const nameOrPosition = `\\`${fn.name}\\`` || `at position ${pos}`;\n const msg = docLink`Function ${nameOrPosition}\\` threw an error during processing of ${\"[beforeSave]\"}.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint, cause: err });\n } finally {\n pos++;\n }\n }\n}\n","// @ts-check\n/**\n * Checks whether the document has `<meta charset=\"utf-8\">` properly.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-charset\";\nexport const name = \"core/linter-rules/check-charset\";\n\nconst localizationStrings = {\n en: {\n msg: `Document must only contain one \\`<meta>\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`<head>\\` section - \\`<meta charset=\"utf-8\">\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `ę–‡ę”£åŖčƒ½åŒ…å«äø€äøŖ charset å±žę€§äøŗ utf-8 ēš„ \\`<meta>\\` ꠇē­¾`,\n hint: `å°†ę­¤č”Œę·»åŠ åˆ°ę–‡ę”£ēš„ \\`<head>\\` éƒØ分ā€”ā€” \\`<meta charset=\"utf-8\">\\` ęˆ–å°† charset č®¾ē½®äøŗ utf-8ļ¼ˆå¦‚ęžœå°šęœŖč®¾ē½®ļ¼‰ć€‚`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLMetaElement>} */\n const metas = document.querySelectorAll(\"meta[charset]\");\n const val = [];\n for (const meta of metas) {\n val.push(meta.getAttribute(\"charset\").trim().toLowerCase());\n }\n const utfExists = val.includes(\"utf-8\");\n\n // only a single meta[charset] and is set to utf-8, correct case\n if (utfExists && metas.length === 1) {\n return;\n }\n // if more than one meta[charset] tag defined along with utf-8\n // or\n // no meta[charset] present in the document\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: [...metas] });\n}\n","// @ts-check\n/**\n * Linter rule \"check-punctuation\". Makes sure the there are no punctuations missing at the end of a <p>.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-punctuation\";\nexport const name = \"core/linter-rules/check-punctuation\";\n\nconst punctuationMarks = [\".\", \":\", \"!\", \"?\"];\nconst humanMarks = punctuationMarks.map(mark => `\"${mark}\"`).join(\", \");\n\nconst localizationStrings = {\n en: {\n msg: \"`p` elements should end with a punctuation mark.\",\n hint: `Please make sure \\`p\\` elements end with one of: ${humanMarks}.`,\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // Check string ends with one of ., !, ?, :, ], or is empty.\n const punctuatingRegExp = new RegExp(\n `[${punctuationMarks.join(\"\")}\\\\]]$|^ *$`,\n \"m\"\n );\n\n /** @type {NodeListOf<HTMLParagraphElement>} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top,#w3c-state)\");\n const offendingElements = [...elems].filter(\n elem => !punctuatingRegExp.test(elem.textContent.trim())\n );\n\n if (!offendingElements.length) {\n return;\n }\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"check-internal-slots\".\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"check-internal-slots\";\nexport const name = \"core/linter-rules/check-internal-slots\";\n\nconst localizationStrings = {\n en: {\n msg: \"Internal slots should be preceded by a '.'\",\n hint: \"Add a '.' between the elements mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"var+a\");\n const offendingElements = [...elems].filter(\n ({ previousSibling: { nodeName } }) => {\n const isPrevVar = nodeName && nodeName === \"VAR\";\n return isPrevVar;\n }\n );\n\n if (!offendingElements.length) {\n return;\n }\n\n showWarning(l10n.msg, name, { hint: l10n.hint, elements: offendingElements });\n}\n","// @ts-check\n/**\n * Linter rule \"warn-local-ref\".\n * Warns about href's that link to nonexistent id's in a spec\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"local-refs-exist\";\nexport const name = \"core/linter-rules/local-refs-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"Broken local reference found in document.\",\n hint: \"Please fix the links mentioned.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n /** @type {NodeListOf<HTMLAnchorElement>} */\n const elems = document.querySelectorAll(\"a[href^='#']\");\n const offendingElements = [...elems].filter(isBrokenHyperlink);\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n\nfunction isBrokenHyperlink(elem) {\n const id = elem.getAttribute(\"href\").substring(1);\n const doc = elem.ownerDocument;\n return !doc.getElementById(id) && !doc.getElementsByName(id).length;\n}\n","// @ts-check\n/**\n * Linter rule \"no-captionless-tables\".\n *\n * Checks that there are no tables in the document which don't start\n * with a caption element.\n *\n * As some tables may not contain tabular data, this only applies to\n * tables marked with class=\"numbered\".\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-captionless-tables\";\nexport const name = \"core/linter-rules/no-captionless-tables\";\n\nconst localizationStrings = {\n en: {\n msg: \"All tables marked with class='numbered' must start with a caption element.\",\n hint: \"Add a `caption` to the offending table.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const tables = document.querySelectorAll(\"table.numbered\");\n const offendingElements = [...tables].filter(\n table => !(table.firstElementChild instanceof HTMLTableCaptionElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-dfns\".\n *\n * Complains if an internal/un-exported definitions is not linked to.\n */\nimport {\n docLink,\n getIntlData,\n norm,\n showError,\n showWarning,\n} from \"../utils.js\";\n\nconst ruleName = \"no-unused-dfns\";\nexport const name = \"core/linter-rules/no-unused-dfns\";\n\nconst localizationStrings = {\n en: {\n msg(text) {\n return `Found definition for \"${text}\", but nothing links to it. This is usually a spec bug!`;\n },\n get hint() {\n return docLink`\n You can do one of the following...\n\n * Add a \\`class=\"lint-ignore\"\\` attribute the definition.\n * Either remove the definition or change \\`<dfn>\\` to another type of HTML element.\n * If you meant to ${\"[export|#data-export]\"} the definition, add \\`class=\"export\"\\` to the definition.\n\n To silence this warning entirely, set \\`lint: { \"no-unused-dfns\": false }\\` in your \\`respecConfig\\`.`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) return;\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n /** @type NodeListOf<HTMLElement> */\n const definitions = document.querySelectorAll(\n \"dfn:not(.lint-ignore, [data-export], [data-cite])\"\n );\n\n const elements = [...definitions].filter(isDfnUnused);\n\n // These are usually bad spec bugs, so best shown individually.\n elements.forEach(element => {\n const elements = [element];\n const text = norm(element.textContent);\n logger(l10n.msg(text), name, { elements, hint: l10n.hint });\n });\n}\n\nfunction isDfnUnused(dfn) {\n // Not in the index\n // and not the \"self-link\" box\n return !document.querySelector(\n `a[href=\"#${dfn.id}\"]:not(.index-term, .self-link)`\n );\n}\n","// @ts-check\n/**\n * Linter rule \"no-headingless-sections\".\n *\n * Checks that there are no sections in the document that don't start\n * with a heading element (h1-6).\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-headingless-sections\";\nexport const name = \"core/linter-rules/no-headingless-sections\";\n\nconst localizationStrings = {\n en: {\n msg: \"All sections must start with a `h2-6` element.\",\n hint: \"Add a `h2-6` to the offending section or use a `<div>`.\",\n },\n nl: {\n msg: \"Alle secties moeten beginnen met een `h2-6` element.\",\n hint: \"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`.\",\n },\n zh: {\n msg: \"ꉀ꜉ē« čŠ‚ļ¼ˆsectionļ¼‰éƒ½åæ…锻仄 `h2-6` 元ē“ å¼€å¤“怂\",\n hint: \"将 `h2-6` ę·»åŠ åˆ°ęœ‰é—®é¢˜ēš„ē« čŠ‚ęˆ–ä½æē”Ø `<div>`怂\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-vars\".\n *\n * Checks that an variable is used if declared (the first use is treated as\n * declaration).\n */\nimport { getIntlData, norm, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-unused-vars\";\nexport const name = \"core/linter-rules/no-unused-vars\";\n\nconst localizationStrings = {\n en: {\n msg: \"Variable was defined, but never used.\",\n hint: \"Add a `data-ignore-unused` attribute to the `<var>`.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [];\n\n /**\n * Check if a <section> contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n * <section><ul class=\"algorithm\"></ul></section>\n * <section><div><ul class=\"algorithm\"></ul></div></section>\n * ```\n * The selector does not match:\n * ``` html\n * <section><section><ul class=\"algorithm\"></ul></section></section>\n * ```\n * @param {HTMLElement} section\n */\n const sectionContainsAlgorithm = section =>\n !!section.querySelector(\n \":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm\"\n );\n\n for (const section of document.querySelectorAll(\"section\")) {\n if (!sectionContainsAlgorithm(section)) continue;\n\n /**\n * `<var>` in this section, but excluding those in child sections.\n * @type {NodeListOf<HTMLElement>}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map<string, HTMLElement[]>} */\n const varUsage = new Map();\n for (const varElem of varElems) {\n const key = norm(varElem.textContent);\n const elems = varUsage.get(key) || varUsage.set(key, []).get(key);\n elems.push(varElem);\n }\n\n for (const vars of varUsage.values()) {\n if (vars.length === 1 && !vars[0].hasAttribute(\"data-ignore-unused\")) {\n offendingElements.push(vars[0]);\n }\n }\n }\n\n if (offendingElements.length) {\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n }\n}\n","// @ts-check\n/**\n * The W3C Process requires separate Privacy Considerations and Security\n * Considerations sections. This linter checks for the presence of these\n * sections, and reports an error if they are not present.\n */\n\nimport {\n InsensitiveStringSet,\n docLink,\n getIntlData,\n getIntlDataForKey,\n norm,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { W3CNotes, recTrackStatus } from \"../headers.js\";\n\nconst ruleName = \"required-sections\";\nexport const name = \"w3c/linter-rules/required-sections\";\n\nconst localizationStrings = {\n en: {\n msg(sectionTitle) {\n return `W3C Recommendation track documents require a separate \"${sectionTitle}\" section.`;\n },\n hint(sectionTitle) {\n return docLink`Add a \\`<section>\\` with a \"${sectionTitle}\" header. See the [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).\n If the document is not intended for the W3C Recommendation track, set ${\"[noRecTrack]\"} to \\`true\\`\n or turn off the ${`[${ruleName}]`} linter rule.`;\n },\n privacy_considerations: \"Privacy Considerations\",\n security_considerations: \"Security Considerations\",\n },\n es: {\n msg(sectionTitle) {\n return `Documentos que van a ser \"W3C Recommendation\" requieren una secciĆ³n \"${sectionTitle}\" separada.`;\n },\n hint(sectionTitle) {\n return docLink`Agrega una \\`<section>\\` con tĆ­tulo \"${sectionTitle}\". Ver los [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).\n Si el documento no estĆ” destinado a ser un W3C Recommendation, puedes poner ${\"[noRecTrack]\"} a \\`true\\`\n o apaga la regla de linter ${`[${ruleName}]`}.`;\n },\n privacy_considerations: \"Consideraciones de privacidad\",\n security_considerations: \"Consideraciones de Seguridad\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport const requiresSomeSectionStatus = new Set([...recTrackStatus]);\nrequiresSomeSectionStatus.delete(\"DISC\"); // \"Discontinued Draft\"\n// W3C notes do not require privacy or security considerations sections.\nW3CNotes.forEach(note => requiresSomeSectionStatus.delete(note));\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can't check for headers unless we also have a translation\n if (!getIntlDataForKey(localizationStrings, \"privacy_considerations\")) {\n // We can't check for headers unless we also have a translation\n const msg = `Cannot check for required sections as translations are not available.`;\n const hint = `File an issue to add translations or use a supported language.`;\n showWarning(msg, name, { hint });\n return;\n }\n\n if (conf.noRecTrack || !requiresSomeSectionStatus.has(conf.specStatus)) {\n return;\n }\n\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n\n const missingRequiredSections = new InsensitiveStringSet([\n l10n.privacy_considerations,\n l10n.security_considerations,\n ]);\n\n /** @type {NodeListOf<HTMLElement>} */\n const headers = document.querySelectorAll(\"h2, h3, h4, h5, h6\");\n for (const header of headers) {\n const clone = header.cloneNode(true);\n // section number and self-link anchor\n clone.querySelectorAll(\"bdi\")?.forEach(elem => elem.remove());\n const text = norm(clone.textContent);\n if (missingRequiredSections.has(text)) {\n missingRequiredSections.delete(text);\n // Check if we find them all...\n if (missingRequiredSections.size === 0) {\n return; // All present, early return!\n }\n }\n }\n\n // Show the ones we didn't find individually\n for (const title of missingRequiredSections) {\n logger(l10n.msg(title), name, {\n hint: l10n.hint(title),\n });\n }\n}\n","// @ts-check\n/**\n * Linter rule \"wpt-tests-exist\".\n * Warns about nonexistent web platform tests.\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"wpt-tests-exist\";\nexport const name = \"core/linter-rules/wpt-tests-exist\";\n\nconst localizationStrings = {\n en: {\n msg: \"The following test could not be found in Web Platform Tests:\",\n hint: \"Check [wpt.live](https://wpt.live) to see if it was deleted or renamed.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport async function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const filesInWPT = await getFilesInWPT(conf.testSuiteURI, conf.githubAPI);\n if (!filesInWPT) {\n return;\n }\n\n /** @type {NodeListOf<HTMLElement>} */\n const elems = document.querySelectorAll(\"[data-tests]\");\n const testables = [...elems].filter(elem => elem.dataset.tests);\n\n for (const elem of testables) {\n elem.dataset.tests\n .split(/,/gm)\n .map(test => test.trim().split(\"#\")[0])\n .filter(test => test && !filesInWPT.has(test))\n .map(missingTest => {\n showWarning(`${l10n.msg} \\`${missingTest}\\`.`, name, {\n hint: l10n.hint,\n elements: [elem],\n });\n });\n }\n}\n\n/**\n * @param {string} testSuiteURI\n * @param {string} githubAPIBase\n */\nasync function getFilesInWPT(testSuiteURI, githubAPIBase) {\n let wptDirectory;\n try {\n const testSuiteURL = new URL(testSuiteURI);\n if (\n testSuiteURL.pathname.startsWith(\"/web-platform-tests/wpt/tree/master/\")\n ) {\n const re = /web-platform-tests\\/wpt\\/tree\\/master\\/(.+)/;\n wptDirectory = testSuiteURL.pathname.match(re)[1].replace(/\\//g, \"\");\n } else {\n wptDirectory = testSuiteURL.pathname.replace(/\\//g, \"\");\n }\n } catch (error) {\n const msg = \"Failed to parse WPT directory from testSuiteURI\";\n showWarning(msg, `linter/${name}`);\n console.error(error);\n return null;\n }\n\n const url = new URL(\"web-platform-tests/wpt/files\", `${githubAPIBase}/`);\n url.searchParams.set(\"path\", wptDirectory);\n\n const response = await fetch(url);\n if (!response.ok) {\n const error = await response.text();\n const msg =\n \"Failed to fetch files from WPT repository. \" +\n `Request failed with error: ${error} (${response.status})`;\n showWarning(msg, `linter/${name}`);\n return null;\n }\n /** @type {{ entries: string[] }} */\n const { entries } = await response.json();\n const files = entries.filter(entry => !entry.endsWith(\"/\"));\n return new Set(files);\n}\n","// @ts-check\n/**\n * Linter rule \"no-http-props\". Makes sure the there are no URLs that\n * start with http:// in the ReSpec config.\n */\nimport { docLink, getIntlData, joinAnd, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-http-props\";\nexport const name = \"core/linter-rules/no-http-props\";\n\nconst localizationStrings = {\n en: {\n msg: docLink`Insecure URLs are not allowed in ${\"[respecConfig]\"}.`,\n hint: \"Please change the following properties to 'https://': \",\n },\n zh: {\n msg: docLink`${\"[respecConfig]\"} äø­äøå…č®øä½æē”Øäøå®‰å…Øēš„URL.`,\n hint: \"čƷ将仄äø‹å±žę€§ę›“ę”¹äøŗ https://ļ¼š\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can only really perform this check over http/https\n // Using parent's location as tests are loaded in iframe as a srcdoc.\n if (!parent.location.href.startsWith(\"http\")) {\n return;\n }\n\n const offendingMembers = Object.getOwnPropertyNames(conf)\n // this check is cheap, \"prevED\" is w3c exception.\n .filter(key => (key.endsWith(\"URI\") && conf[key]) || key === \"prevED\")\n // this check is expensive, so separate step\n .filter(key =>\n new URL(conf[key], parent.location.href).href.startsWith(\"http://\")\n );\n\n if (offendingMembers.length) {\n const keys = joinAnd(offendingMembers, key => docLink`${`[${key}]`}`);\n showWarning(l10n.msg, name, { hint: l10n.hint + keys });\n }\n}\n","// @ts-check\n/**\n * Lints for accessibility issues using axe-core package.\n */\n\nimport { showError, showWarning } from \"../utils.js\";\n\nexport const name = \"core/linter-rules/a11y\";\n\nconst DISABLED_RULES = [\n \"color-contrast\", // too slow šŸ¢\n \"landmark-one-main\", // need to add a <main>, else it marks entire page as errored\n \"landmark-unique\",\n \"region\",\n];\n\nexport async function run(conf) {\n if (!conf.lint?.a11y && /** legacy */ !conf.a11y) {\n return;\n }\n const config = conf.lint?.a11y || /** legacy */ conf.a11y;\n\n const options = config === true ? {} : config;\n const violations = await getViolations(options);\n for (const violation of violations) {\n /**\n * We're grouping by failureSummary as it contains hints to fix the issue.\n * For example, with color-constrast rule, it tells about the present color\n * contrast and how to fix it. If we don't group, errors will be repetitive.\n * @type {Map<string, HTMLElement[]>}\n */\n const groupedBySummary = new Map();\n for (const node of violation.nodes) {\n const { failureSummary, element } = node;\n const elements =\n groupedBySummary.get(failureSummary) ||\n groupedBySummary.set(failureSummary, []).get(failureSummary);\n elements.push(element);\n }\n\n const { id, help, description, helpUrl } = violation;\n const title = `a11y/${id}: ${help}.`;\n for (const [failureSummary, elements] of groupedBySummary) {\n const hints = formatHintsAsMarkdown(failureSummary);\n const details = `\\n\\n${description}.\\n\\n${hints}. ([Learn more](${helpUrl}))`;\n showWarning(title, name, { details, elements });\n }\n }\n}\n\n/**\n * @param {object} opts Options as described at https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter\n */\nasync function getViolations(opts) {\n const { rules, ...otherOptions } = opts;\n const options = {\n rules: {\n ...Object.fromEntries(DISABLED_RULES.map(id => [id, { enabled: false }])),\n ...rules,\n },\n ...otherOptions,\n elementRef: true,\n resultTypes: [\"violations\"],\n reporter: \"v1\", // v1 includes a `failureSummary`\n };\n\n let axe;\n try {\n axe = await importAxe();\n } catch (error) {\n const msg = \"Failed to load a11y linter.\";\n showError(msg, name);\n console.error(error);\n return [];\n }\n\n try {\n const result = await axe.run(document, options);\n return result.violations;\n } catch (error) {\n const msg = \"Error while looking for a11y issues.\";\n showError(msg, name);\n console.error(error);\n return [];\n }\n}\n\n/** @returns {Promise<typeof window.axe>} */\nfunction importAxe() {\n const script = document.createElement(\"script\");\n script.classList.add(\"remove\");\n script.src = \"https://cdn.jsdelivr.net/npm/axe-core@4/axe.min.js\";\n document.head.appendChild(script);\n return new Promise((resolve, reject) => {\n script.onload = () => resolve(window.axe);\n script.onerror = reject;\n });\n}\n\n/** @param {string} text */\nfunction formatHintsAsMarkdown(text) {\n const results = [];\n for (const group of text.split(\"\\n\\n\")) {\n const [msg, ...opts] = group.split(/^\\s{2}/m);\n const options = opts.map(opt => `- ${opt.trimEnd()}`).join(\"\\n\");\n results.push(`${msg}${options}`);\n }\n return results.join(\"\\n\\n\");\n}\n","// @ts-check\n/**\n * Linter rule \"informative-dfn\".\n *\n * Complains if an informative definition is referenced from a normative section.\n */\nimport { docLink, getIntlData, showError, showWarning } from \"../utils.js\";\n\nimport { informativeRefsInNormative } from \"../xref.js\";\n\nconst ruleName = \"informative-dfn\";\nexport const name = \"core/linter-rules/informative-dfn\";\n\nconst localizationStrings = {\n en: {\n msg(term, cite) {\n return `Normative reference to \"${term}\" found but term is defined \"informatively\" in \"${cite}\".`;\n },\n get hint() {\n return docLink`\n You can do one of the following...\n\n * Get the source definition to be made normative\n * Add a \\`class=\"lint-ignore\"\\` attribute to the link.\n * Use a local normative proxy for the definition Ć  la \\`<dfn data-cite=\"spec\">term</dfn>\\`\n\n To silence this warning entirely, set \\`lint: { \"${ruleName}\": false }\\` in your \\`respecConfig\\`.`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) return;\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n\n informativeRefsInNormative.forEach(({ term, spec, element }) => {\n if (element.classList.contains(\"lint-ignore\")) return;\n logger(l10n.msg(term, spec), name, {\n title: \"Normative reference to non-normative term.\",\n elements: [element],\n hint: l10n.hint,\n });\n });\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","instanceOfAny","constructors","some","c","idbProxyableTypes","cursorAdvanceMethods","transactionDoneMap","WeakMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","replaceTraps","wrapFunction","func","IDBCursor","prototype","advance","continue","continuePrimaryKey","includes","args","apply","unwrap","this","request","transformCachableValue","tx","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","addEventListener","cacheDonePromiseForTransaction","IDBDatabase","IDBObjectStore","IDBIndex","Proxy","IDBRequest","promise","success","result","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","transaction","store","index","shift","oldTraps","advanceMethodProps","methodMap","advanceResults","ittrProxiedCursorToOriginalProxy","cursorIteratorTraps","cachedFunc","iterate","cursor","openCursor","proxiedCursor","delete","isIteratorProp","Symbol","asyncIterator","blocked","indexedDB","deleteDatabase","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","catch","source","position","current","message","kind","level","autofix","ruleName","sliceTokens","count","slice","Math","max","tokensToText","inputs","precedes","text","t","trivia","join","nextToken","type","length","line","precedingLastLine","splitted","split","lastLine","subsequentTokens","subsequentText","sourceContext","repeat","contextType","context","partial","node","hierarchy","parent","unshift","n","base","appendIfExist","contextAsText","bareMessage","sourceName","input","tokens","syntaxError","validationError","token","options","Base","constructor","Object","defineProperties","writable","toJSON","json","inheritance","proto","descMap","getOwnPropertyDescriptors","key","entries","enumerable","getPrototypeOf","idlTypeIncludesDictionary","idlType","defs","useNullableInner","union","def","unique","typedefIncludesDictionary","cache","reference","dictionary","nullable","subtype","dictionaryIncludesRequiredField","dict","members","field","required","superdict","ArrayBase","Array","super","WrappedToken","parser","tokeniser","consumeKind","unescape","write","w","ts","separator","Eof","parse","tokenName","list","listName","extAttrValueSyntax","renamedLegacies","extAttrListItems","syntax","toks","ExtendedAttributeParameters","assign","consume","ret","autoParenter","asterisk","secondaryName","rhsIsList","argument_list","close","rhsType","reference_token","p","identifier","SimpleExtendedAttribute","params","defineProperty","rhs","arguments","validate","extAttr","arg","extendedAttribute","extendedAttributeReference","ExtendedAttributes","push","unconsume","probe","ea","type_suffix","obj","single_type","typeName","Type","return_type","type_with_extended_attributes","keyType","stringTypes","keyIdlType","valueType","generic_type","primitive_type","typeNameKeywords","generic","typ","or","union_type","extAttrs","Boolean","prefix","postfix","filter","replaceAllowShared","typedef","targetToken","firstToken","ref","unescaped","type_body","indexOf","splice","match","Default","const_value","expression","const_data","negative","Argument","start_position","optional","variadic","argumentNameKeywords","default","autofixOptionalDictionaryDefaultValue","requiredExists","a","isLastRequiredArgument","getFirstToken","name_token","data","Tokeniser","Operation","special","regular","termination","argument","body","definition","nameless","Attribute","noInherit","readonly","e","idlTypeIncludesEnforceRange","startsWith","allowDangler","first","items","item","num_type","integer_type","decimal_type","voidToken","stringifier","getLastIndentation","str","lines","autofixAddExposedWindow","exposed","existing","test","values","sort","x","y","isArray","tokenRe","decimal","integer","string","whitespace","comment","other","nonRegexTerminals","concat","punctuations","reserved","idl","lastCharIndex","nextChar","charAt","attemptTokenMatch","noFlushTrivia","currentTrivia","pop","lastIndex","WebIDLParseError","punctuation","re","exec","tokenise","probeKind","candidates","consumeIdentifier","EnumValue","Enum","v","Includes","mixin","Typedef","CallbackFunction","Container","instance","inheritable","allowedMembers","colon","mem","member","m","Constant","IterableLike","secondTypeRequired","secondTypeAllowed","argumentAllowed","argsOpen","argsClose","Constructor","static_member","Interface","extMembers","every","oldConstructors","autofixConstructor","factoryFunctions","named","i","opNames","ops","getOperations","statics","Set","op","nonstatics","groupOperationNames","partials","mixins","mixinMap","ext","additions","checkAdditions","forEach","add","existings","addition","checkInterfaceMemberDuplication","interfaceDef","constructorExtAttr","indentation","memberIndent","parentTrivia","indentCh","getMemberIndentation","constructorOp","existingIndex","array","predicate","reverse","findIndex","findLastIndex","removed","trim","Mixin","Field","Dictionary","Namespace","CallbackInterface","parseByTokens","interface_","opts","extensions","interface","productions","production","callbackInterface","namespace","res","eof","concrete","definitions","noop","templates","Writer","raw","wrapper","bind","id","getMixinMap","include","validateIterable","ast","duplicates","groupDefinitions","dup","checkDuplicatedNames","flat","it","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","paramName","paramValue","toLowerCase","_getDefaults","breaks","gfm","hooks","pedantic","renderer","silent","tokenizer","walkTokens","_defaults","changeDefaults","newDefaults","escapeTest","escapeReplace","RegExp","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape$1","encode","unescapeTest","_","String","fromCharCode","parseInt","substring","caret","edit","regex","opt","val","valSource","getRegex","cleanUrl","href","encodeURI","noopTest","splitCells","tableRow","cells","offset","escaped","curr","rtrim","invert","l","suffLen","currChar","outputLink","cap","link","lexer","title","state","inLink","inlineTokens","_Tokenizer","rules","space","src","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","matchIndentInNode","indentInNode","indentCodeCompensation","inline","anyPunctuation","heading","trimmed","depth","hr","blockquote","top","blockTokens","bull","isordered","ordered","start","loose","itemRegex","itemContents","endsWithBlankLine","endEarly","nextLine","indent","trimStart","search","blankLine","nextBulletRegex","min","hrRegex","fencesBeginRegex","headingBeginRegex","rawLine","ischecked","istask","task","checked","trimEnd","spacers","hasMultipleLineBreaks","pre","tag","table","headers","aligns","rows","header","align","row","cell","lheading","paragraph","escape","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","emStrongLDelim","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","emStrongRDelimAst","emStrongRDelimUnd","lastCharLength","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","bullet","_paragraph","_blockLabel","_tag","_comment","blockNormal","gfmTable","blockGfm","blockPedantic","_punctuation","_inlineComment","_inlineLabel","inlineNormal","blockSkip","reflinkSearch","inlinePedantic","inlineGfm","inlineBreaks","normal","_Lexer","inlineQueue","create","lex","lexInline","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","call","startBlock","startIndex","Infinity","tempSrc","tempStart","getStartIndex","errMsg","charCodeAt","console","keepPrevChar","keys","lastIndexOf","startInline","_Renderer","infostring","quote","listitem","checkbox","tablerow","content","tablecell","flags","strong","em","cleanHref","out","image","_TextRenderer","_Parser","textRenderer","parseInline","renderers","genericToken","headingToken","codeToken","tableToken","j","k","blockquoteToken","listToken","itemBody","htmlToken","paragraphToken","textToken","escapeToken","tagToken","linkToken","imageToken","strongToken","emToken","codespanToken","delToken","_Hooks","static","preprocess","markdown","postprocess","processAllTokens","markedInstance","defaults","setOptions","parseMarkdown","Parser","Renderer","TextRenderer","Lexer","Tokenizer","Hooks","use","childTokens","pack","prevRenderer","extLevel","rendererProp","rendererFunc","tokenizerProp","tokenizerFunc","prevTokenizer","hooksProp","hooksFunc","prevHook","passThroughHooks","packWalktokens","origOpt","warn","throwError","onError","toString","msg","marked","getDefaultExportFromCjs","__esModule","hasOwnProperty","marked$1","getDefaults","hasRequiredPluralize","pluralize$2","exports","module","pluralizeExports","root","pluralize","pluralize$1","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","r","configurable","o","random","s","WeakSet","u","insertBefore","selected","selectedIndex","f","querySelectorAll","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","g","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","detail","CustomEvent","_wire$","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","R","H","innerHTML","F","$1","childNodes","firstChild","appendChild","createDocumentFragment","createElementNS","I","z","V","Z","G","q","B","J","Q","U","X","Y","toFixed","ee","createElement","getAttribute","te","ne","ie","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","be","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","ke","Oe","Te","Me","setAttribute","getAttributeNode","je","style","_e","cssText","setProperty","Le","Pe","De","We","lastChild","ownerDocument","createRange","setStartBefore","setEndAfter","deleteContents","valueOf","$e","Re","Ke","Je","render","Fe","placeholder","He","Ie","ze","Ve","Ze","Ge","qe","Qe","Event","MutationObserver","observe","subtree","childList","clearTimeout","setTimeout","addedNodes","removedNodes","dispatchEvent","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","TypeError","parserMode","inputArray","from","char","fromEntries","parseMimeType","parameters","essence","mimeType","size","paramStr","serialize","_pluralize","webidl2","_webidl2","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","W3CDate","nonNormativeSelector","createResourceHint","URL","baseURI","linkElem","rel","hint","origin","corsMode","location","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","joinOr","xmlEscape","norm","getIntlData","localizationStrings","getIntlDataForKey","concatDate","date","sep","format","runTransforms","flist","funcArgs","methods","meth","showWarning","cause","fetchAndCache","maxAge","Request","cachedResponse","caches","Date","err","response","fetch","ok","clonedResponse","clone","customHeaders","Headers","expiryDate","now","toISOString","cacheResponse","Response","blob","put","htmlJoinComma","joined","htmlJoinAnd","addHashId","hash","imul","hashString","addId","pfx","txt","noLC","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","getElementsByTagName","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","getPreviousSections","sections","previous","previousElementSibling","iteratePreviousElements","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","getCanonicalKey","existingKey","find","makeSafeCopy","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","elements","markAsOffending","stack","details","showError","pluginName","pub","makePluginUtils","toMDCode","codedJoinOr","quotes","addQuotes","codedJoinAnd","docLink","strings","reindent","endsWith","linkingText","indents","leastIndent","subscriptions","EventTarget","topic","self","JSON","stringify","postMessage","sub","cb","once","ev","removeList","mimeTypes","rsDocToDataURL","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","toHTML","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodeURIComponent","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","utils","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$p","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","firstTwo","lastTwo","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","buttonId","button","ol","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","locationHash","l10n$D","group","style$1","github$1","dataInclude","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","tables","webidl","biblio$1","linkToDfn","xref","dataCite","renderBiblio","dfnIndex","contrib","fixHeaders","webidlIndex","structure","informative","idHeaders","caniuse","mdnAnnotation","saveHtml","searchSpecref","searchXref","aboutRespec","seo$1","seo","highlight","webidlClipboard","dataTests","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","webMonetization","dfnContract","beforeSave","checkCharset","checkPunctuation","checkInternalSlots","localRefsExist","noCaptionlessTables","noUnusedDfns","noHeadinglessSections","noUnusedVars","requiredSections","wptTestsExist","noHttpProps","a11y","informativeDfn","ReSpec.run","newHash","isLegacyFrag","W3C_GROUPS_API","getGroupDetails","shortname","wgId","wg","patentURI","wgPatentURI","patentPolicy","wgPatentPolicy","groupType","wgURI","status","groupDetails","groups","getMultipleGroupDetails","showLink","class","showLinkData","showLogo","logo","alt","height","width","until","es","ko","ja","zh","orcidIcon","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","remainder","Number","reduce","acc","lastDigitInt","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","extras","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","protocol","hCard","companyElem","note","classVal","renderExtra","time","archives","author","authors","commit_history","edited_in_place","editor","editors","feedback","former_editor","former_editors","history","implementation_report","latest_editors_draft","latest_published_version","latest_recommendation","message_topic","more_details_about_this_doc","multiple_alternates","prev_editor_draft","prev_recommendation","prev_version","publication_history","test_suite","this_version","with_subject_line","your_topic_here","nl","getSpecSubTitleElem","specSubTitleElem","subtitle","headersTmpl","logos","specType","isCR","isCRY","longStatus","textStatus","prependW3C","specStatus","dashDate","publishDate","modificationDate","renderSpecTitle","localStorage","getItem","thisVersion","latestVersion","edDraftURI","historyURI","github","commitHistoryURL","testSuiteURI","implementationReportURI","prevED","showPreviousVersion","prevVersion","prevRecURI","isRec","formerEditors","wgPublicList","renderFeedback","errata","otherLinks","shortName","alternateFormats","multipleAlternates","alternatesHTML","existingCopyright","isUnofficial","licenseInfo","copyrightStart","publishYear","additionalCopyrightHolders","short","linkLicense","renderOfficialCopyright","renderCopyright","repoURL","issuesURL","newIssuesURL","pullsURL","fullName","mailToURL","subject","subjectPrefix","mailingListLink","subjectLine","emailSubject","archiveURL","archiveLink","cgbgHeadersTmpl","specTitleElem","specTitleElemClone","isCGFinal","sotd","status_at_publication","processLink","sotdTmpl","isPreview","renderPreview","additionalContent","renderIsUnofficial","isTagFinding","isNoTrack","isMO","renderIsNoTrack","isMemberSubmission","teamComment","getUTCFullYear","submissionCommentNumber","patentPolicyURL","noteForMemberSubmission","noteForSubmission","sotdAfterWGinfo","overrideStatus","changes","proposedAdditions","proposedCorrections","corrections","hasRevisions","track","status2track","getWgHTML","linkToWorkingGroup","revisedRecEnd","updatableRec","reviewTarget","renderIsRec","statusExplanation","reviewPolicy","endorsement","updatePolicy","lsUpdatePolicy","pubMode","humanPREnd","humanCREnd","crEnd","prEnd","renderNotRec","isNote","isRegistry","multipleWGs","wgPatentHTML","producers","renderDeliverer","additionalSections","prUrl","prNumber","idx","cgbgSotdTmpl","mailToWGPublicListWithSubject","mailToWGPublicListSubscription","renderPublicList","issueBase","linkToCommunity","w3Url","status2maturity","LS","LD","FPWD","status2text","DNOTE","NOTE","STMT","MO","ED","WD","CR","CRD","PR","REC","DISC","RSCND","DRY","CRYD","CRY","RY","unofficial","UD","finding","status2long","W3CNotes","recTrackStatus","registryTrackStatus","tagStatus","cgStatus","bgStatus","cgbgStatus","trStatus","noTrackStatus","licenses","patentPolicies","validateDateAndRecover","fallbackDate","isFinite","formattedDate","collectSotdContent","sotdClone","hasChildNodes","isBasic","isCGBG","isCRDraft","isEd","isPR","isRecTrack","isRegular","isTagEditorFinding","license","lCaseLicense","deriveLicenseInfo","lastModified","pubSpace","derivePubSpace","maturity","docVersion","reportType","latestVersionURL","validateCGBG","validateIfAllowedOnTR","latestPath","previousPublishDate","previousMaturity","prevMaturity","pubDate","prevPubDate","prevRecShortname","uri","publishISODate","shortISODate","policies","policy","validatePatentPolicies","canShowHistory","historyURL","deriveHistoryURI","wgPotentialArray","isPr","isUpdatableRec","contains","hasCorrections","hasProposedCorrections","hasAdditions","hasProposedAdditions","noRecTrack","notAllowed","mailToWGPublicList","populateSoTD","generatedSubtitle","coreDefaults","lint","highlightVars","addSectionLinks","w3cLogo","memSubmissionLogo","w3cDefaults","doJsonLd","excludeGithubLinks","supportedStatus","validateStatusForGroup","isWgStatus","inWorkingGroup","doesNotNeedWG","processLogos","css$n","noReSpecCSS","attachFixupScript","getStyleUrl","resourceHints","createResourceHints","styleMover","linkURL","exportDoc","w3cStyle","styleFile","noToc","finalStyleURL","canonicalStatus","canUseW3CStyle","getStyleFile","colorScheme","darkModeStyleUrl","resolveGithubPromise","rejectGithubPromise","file_a_bug","participate","ghURL","tempURL","org","repo","branch","newProps","githubToken","githubUser","atRiskBase","pullBase","githubAPI","hostname","otherLink","normalizedGHObj","apiBase","normalizedConfig","DOMBuilder","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","includeId","default_title","h1Elem","isConnected","tempElem","documentTitle","setDocumentTitle","isInteger","searchString","toLocaleLowerCase","findAbstract","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","renderParent","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","range","IDBKeyRange","lowerBound","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","addAll","aliasesAndRefs","alias","promisesToAdd","flatMap","isInDB","clear","storeNames","stores","clearStorePromises","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","oneHourFromNow","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","rfc2119Keywords","inlineCodeRegExp","inlineIdlReference","inlineVariable","inlineCitation","inlineExpansion","inlineAnchor","inlineElement","inlineElementMatches","matched","attrValue","xrefType","xrefFor","inlineRFC2119Matches","nodeElement","inlineRefMatches","inlineXrefMatches","inlineCodeMatches","inlineBibrefMatches","spec","cite","cleanRef","citeElem","inlineAbbrMatches","abbrMap","inlineVariableMatches","matches","varName","inlineAnchorMatches","cleanUp","safeStr","lastSlashIdx","splitByFor","isFor","processedContent","processInlineContent","clean","part","respecRFC2119","abbrElements","abbrRx","txts","exclusions","wsNodes","exclusionQuery","nodeIterator","createNodeIterator","SHOW_TEXT","FILTER_REJECT","FILTER_ACCEPT","textNodes","getTextNodes","keywords","inlinesRegex","subtxt","df","normativity","keywordInterpretation","terms","processConformance","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","closestType","computeExport","export","titles","pluralizeDfn","dfnTexts","dfns","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$l","makeTitle","num","report","number","div","inAside","exampleTitle","css$j","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","handleIssues","ins","ghIssues","getIssueNumber","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","issueNumbers","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","decorateTableOfFigures","list_of_tables","listOfTables","decorateTable","tableId","listOfTablesCaption","getListOfTablesListItem","collectTables","listOfTablesElement","decorateListOfTables","topLevelEntities","findDfn","defn","findNormalDfn","asMethodName","findOperationDfn","resolvedName","getDfns","alternativeDfns","decorateDfn","dfnElem","idlAst","lCaseParent","middle","last","getDataType","local","exportable","addAlternativeNames","asQualifiedName","asFullyQualifiedName","asMethodWithArgs","operationName","argsAst","operationNames","isOptional","requiredArgs","requiredOperation","optionalOps","generateMethodNamesWithArgs","getAlternativeNames","originalName","foundDfns","dfnForArray","closestDfnFor","idlStruct","copyButton","createButton","addCopyIDLButton","idlHeader","idlText","clipboard","writeText","css$h","idlPartials","Text","keyword","wrapped","idlLink","defineIdlName","getIdlDefinitionClassName","parentName","idlId","getNameAndId","getDfnType","isDefaultJSON","unlinkedAnchor","nameResolverMap","getDefnName","getIdlId","resolvePartial","overload","qualifiedName","fullyQualifiedName","resolveOverload","resolveNameAndId","topLevelIdlTypes","renderWebIDL","idlElement","highlights","closestCite","cites","addIDLHeader","idls","astArray","validations","validation","THIS_SPEC","getLinkProps","citeDetails","frag","canonicalHref","relPath","linkProps","wrapInCiteEl","citePath","citeFrag","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","STORE_NAME","VERSION_CHECK_WAIT","getIdbCache","resolveXrefCache","queries","cachedData","lastChecked","setItem","API_URL","lastUpdated","shouldBustCache","clearXrefData","requiredKeySet","query","profiles","informativeRefsInNormative","getRequestEntry","getTermFromElement","specs","dataciteElem","closestSection","inlineRefs","uniqueSpecContext","higherPriority","uniqueSpecs","dedupeSpecContext","getSpecContext","types","getTypeContext","dataXrefForElem","getForContext","addDataCite","normative","isNormRef","closestNormative","closestInform","addToReferences","objectHash","buffer","TextEncoder","crypto","subtle","digest","bufferToHexString","Uint8Array","padStart","invalidProfileError","profile","normalizeConfig","bodyCite","externalDFNs","findExplicitExternalLinks","queryKeys","apiUrl","uniqueIds","uniqueQueryKeys","resultsFromCache","termsToLook","fetchedResults","fetchFromNetwork","cacheXrefData","getData","ambiguous","notFound","collector","getPrefilledFormURL","howToFix","howToCiteURL","originalTerm","formUrl","specsString","forParent","moreInfo","showErrors","addDataCiteToTerms","css$f","headingExternal","headlingLocal","dfnOf","CODE_TYPES","getLocalTermType","ds","getLocalTermParentContext","getLocalTermSuffix","appendSectionNumbers","secNum","getSectionNumber","collectExternalTerms","uniqueReferences","uniqueID","renderExternalTermEntry","typeSuffix","TYPE_TERMS","TYPED_TYPES","linkForText","getTermText","styleEl","localTermIndex","dataSortedByTerm","collectLocalTerms","renderItem","suffix","getLocalTermText","renderLocalTerm","createLocalTermIndex","externalTermIndex","dataSortedBySpec","specA","specB","createExternalTermIndex","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","showContributors","getParents","idlIndexSec","idlIndex","lowerHeaderTags","toc","scanSections","maxTocLevel","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","css$d","BROWSERS","statToText","defaultBrowsers","DEFAULTS","removeOnSave","browsers","feature","normalizeCaniuseConf","invalidBrowsers","browser","validateBrowsers","featureURL","headDlElem","contentPromise","statusText","fetchStats","toBrowserCell","browserId","browserName","supportLevel","cssClass","textVersion","getLogoSrc","browserCellRenderer","processJson","handleError","definitionPair","outputDoc","css$b","BASE_JSON_PATH","MDN_URL_BASE","MDN_BROWSERS","chrome","chrome_android","edge","edge_mobile","firefox","firefox_android","opera","opera_android","safari","safari_ios","samsunginternet_android","webview_android","inAllEngines","inSomeEngines","insertMDNBox","targetAncestor","targetSibling","mdnBox","attachMDNDetail","mdnSpec","slug","summary","support","engines","mdnSubPath","engineSupport","getEngineSupportIcons","getEngineSupport","createRow","yesNoUnknown","displayStatus","createRowFromBrowserData","versionData","version_removed","versionAdded","version_added","buildBrowserSupportTable","mdnKey","mdn","getMdnKey","mdnSpecJson","mdnConf","baseJsonPath","getMdnData","findElements","mdnSpecArray","save_snapshot","downloadLinks","epubURL","saveDialog","filename","toDownloadLink","supportsDownload","HTMLAnchorElement","search_specref","specrefSearchUI","xrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","gitRevision","metaElem","firstParagraph","status2rdf","LC","requiresCanonicalLink","addPerson","ed","worksFor","addRef","jsonld","creator","publishedDate","isbn","canonicalURI","rdfStatus","w3p","foaf","datePublished","inLanguage","isBasedOn","copyrightHolder","discussionUrl","alternativeHeadline","addl","description","contributor","citationIds","citationContents","citation","addJSONLDInfo","css$9","fetchBase","_documentCurrentScript","workerPromise","workerScript","respecWorker$1","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","missing_test_suite_uri","tests","toListItem","emojiList","testFile","testParts","testFileName","requiresConnectionEmoji","manualPerformEmoji","toTestURLs","handleDuplicates","testURLs","uniqueList","testables","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","css$5","varMap","variables","currentSection","css$3","textNode","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","monetization","paymentPointer","rawConfig","canonicalizeConfig","dfnsWithNoType","exportableDfns","addContractDefaults","describedDTs","dfnId","dfnContent","defines","definitionContainers","addDefinitionPointers","transforms","pos","performTransformations","metas","meta","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLTableCaptionElement","isDfnUnused","logger","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","sectionTitle","privacy_considerations","security_considerations","requiresSomeSectionStatus","missingRequiredSections","filesInWPT","githubAPIBase","wptDirectory","testSuiteURL","files","getFilesInWPT","missingTest","offendingMembers","getOwnPropertyNames","DISABLED_RULES","formatHintsAsMarkdown","violations","otherOptions","enabled","elementRef","resultTypes","reporter","axe","onload","onerror","importAxe","getViolations","violation","groupedBySummary","nodes","failureSummary","help","helpUrl","hints"],"mappings":"qHACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IAClD,EACDV,EAAQG,QAAU,CAAE,EACpBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCpBO,MAEDC,EAAOC,SAASC,gBAGjBF,GAAMG,aAAa,UACtBH,EAAKI,KAAO,KACPJ,EAAKG,aAAa,SACrBH,EAAKK,IAAM,QAIR,MAAMC,EAAO,CAAE,EAETF,EAAOJ,GAAMI,MAAQ,4DAdd,gBAgBb,SAAaG,GAClBA,EAAOD,KAAOA,EAAKF,IAASE,EAAKE,EACnC,IC3BA,MAAMC,EAAgB,CAACV,EAAQW,IAAiBA,EAAaC,MAAMC,GAAMb,aAAkBa,IAE3F,IAAIC,EACAC,EAqBJ,MAAMC,EAAqB,IAAIC,QACzBC,EAAiB,IAAID,QACrBE,EAAwB,IAAIF,QAgDlC,IAAIG,EAAgB,CAChB,GAAAC,CAAIC,EAAQC,EAAMC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13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,37]} \ No newline at end of file diff --git a/package.json b/package.json index 09ac227ddc..b3dca8a464 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "respec", - "version": "35.1.2", + "version": "35.2.0", "license": "W3C", "description": "A technical specification pre-processor.", "engines": { "node": ">=20.12.1" }, - "packageManager": "pnpm@9.8.0", + "packageManager": "pnpm@9.14.2", "bin": { "respec": "tools/respec2html.js", "respec2html": "tools/respec2html.js" @@ -24,25 +24,25 @@ "Robin Berjon" ], "devDependencies": { - "@rollup/plugin-alias": "^5.1.0", - "@rollup/plugin-commonjs": "^26.0.1", - "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-alias": "^5.1.1", + "@rollup/plugin-commonjs": "^28.0.1", + "@rollup/plugin-node-resolve": "^15.3.0", "@rollup/plugin-terser": "^0.4.4", "@types/pluralize": "0.0.33", "boxen": "^8.0.1", - "chokidar": "^3.6.0", + "chokidar": "^4.0.1", "clean-css": "^5.3.3", "epipebomb": "^1.0.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-import": "^2.29.1", - "eslint-plugin-jasmine": "^4.2.1", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-jasmine": "^4.2.2", "eslint-plugin-prettier": "^5.2.1", "highlight.js": "^11.10.0", "hyperhtml": "^2.34.2", "idb": "^8.0.0", - "jasmine": "^5.2.0", - "jasmine-core": "^5.2.0", + "jasmine": "^5.4.0", + "jasmine-core": "^5.4.0", "karma": "^6.4.4", "karma-chrome-launcher": "^3.2.0", "karma-firefox-launcher": "^2.1.3", @@ -52,15 +52,15 @@ "karma-safari-launcher": "^1.0.0", "loading-indicator": "^2.0.0", "pluralize": "^8.0.0", - "prettier": "^3.3.3", + "prettier": "^3.4.0", "prompt": "^1.3.0", - "rollup": "^4.21.0", + "rollup": "^4.27.4", "rollup-plugin-minify-html-literals": "^1.2.6", - "serve": "^14.2.3", - "serve-handler": "^6.1.5", + "serve": "^14.2.4", + "serve-handler": "^6.1.6", "sniffy-mimetype": "^1.1.1", - "typescript": "^5.5.4", - "vnu-jar": "^23.4.11", + "typescript": "^5.7.2", + "vnu-jar": "^24.10.17", "webidl2": "^24.4.1" }, "scripts": { @@ -87,11 +87,11 @@ }, "dependencies": { "colors": "1.4.0", - "finalhandler": "^1.2.0", + "finalhandler": "^1.3.1", "marked": "^12.0.2", - "puppeteer": "^23.1.1", + "puppeteer": "^23.9.0", "sade": "^1.8.1", - "serve-static": "^1.15.0" + "serve-static": "^1.16.2" }, "files": [ "builds/", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index debf3d8852..1e87ffca42 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,33 +12,33 @@ importers: specifier: 1.4.0 version: 1.4.0 finalhandler: - specifier: ^1.2.0 - version: 1.2.0 + specifier: ^1.3.1 + version: 1.3.1 marked: specifier: ^12.0.2 version: 12.0.2 puppeteer: - specifier: ^23.1.1 - version: 23.1.1(typescript@5.5.4) + specifier: ^23.9.0 + version: 23.9.0(typescript@5.7.2) sade: specifier: ^1.8.1 version: 1.8.1 serve-static: - specifier: ^1.15.0 - version: 1.15.0 + specifier: ^1.16.2 + version: 1.16.2 devDependencies: '@rollup/plugin-alias': - specifier: ^5.1.0 - version: 5.1.0(rollup@4.21.0) + specifier: ^5.1.1 + version: 5.1.1(rollup@4.27.4) '@rollup/plugin-commonjs': - specifier: ^26.0.1 - version: 26.0.1(rollup@4.21.0) + specifier: ^28.0.1 + version: 28.0.1(rollup@4.27.4) '@rollup/plugin-node-resolve': - specifier: ^15.2.3 - version: 15.2.3(rollup@4.21.0) + specifier: ^15.3.0 + version: 15.3.0(rollup@4.27.4) '@rollup/plugin-terser': specifier: ^0.4.4 - version: 0.4.4(rollup@4.21.0) + version: 0.4.4(rollup@4.27.4) '@types/pluralize': specifier: 0.0.33 version: 0.0.33 @@ -46,8 +46,8 @@ importers: specifier: ^8.0.1 version: 8.0.1 chokidar: - specifier: ^3.6.0 - version: 3.6.0 + specifier: ^4.0.1 + version: 4.0.1 clean-css: specifier: ^5.3.3 version: 5.3.3 @@ -61,14 +61,14 @@ importers: specifier: ^9.1.0 version: 9.1.0(eslint@8.57.0) eslint-plugin-import: - specifier: ^2.29.1 - version: 2.29.1(eslint@8.57.0) + specifier: ^2.31.0 + version: 2.31.0(eslint@8.57.0) eslint-plugin-jasmine: - specifier: ^4.2.1 - version: 4.2.1 + specifier: ^4.2.2 + version: 4.2.2 eslint-plugin-prettier: specifier: ^5.2.1 - version: 5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.3.3) + version: 5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.4.0) highlight.js: specifier: ^11.10.0 version: 11.10.0 @@ -79,11 +79,11 @@ importers: specifier: ^8.0.0 version: 8.0.0 jasmine: - specifier: ^5.2.0 - version: 5.2.0 + specifier: ^5.4.0 + version: 5.4.0 jasmine-core: - specifier: ^5.2.0 - version: 5.2.0 + specifier: ^5.4.0 + version: 5.4.0 karma: specifier: ^6.4.4 version: 6.4.4 @@ -98,7 +98,7 @@ importers: version: 5.1.0(karma@6.4.4) karma-jasmine-html-reporter: specifier: ^2.1.0 - version: 2.1.0(jasmine-core@5.2.0)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4) + version: 2.1.0(jasmine-core@5.4.0)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4) karma-mocha-reporter: specifier: ^2.2.5 version: 2.2.5(karma@6.4.4) @@ -112,32 +112,32 @@ importers: specifier: ^8.0.0 version: 8.0.0 prettier: - specifier: ^3.3.3 - version: 3.3.3 + specifier: ^3.4.0 + version: 3.4.0 prompt: specifier: ^1.3.0 version: 1.3.0 rollup: - specifier: ^4.21.0 - version: 4.21.0 + specifier: ^4.27.4 + version: 4.27.4 rollup-plugin-minify-html-literals: specifier: ^1.2.6 - version: 1.2.6(rollup@4.21.0) + version: 1.2.6(rollup@4.27.4) serve: - specifier: ^14.2.3 - version: 14.2.3 + specifier: ^14.2.4 + version: 14.2.4 serve-handler: - specifier: ^6.1.5 - version: 6.1.5 + specifier: ^6.1.6 + version: 6.1.6 sniffy-mimetype: specifier: ^1.1.1 version: 1.1.1 typescript: - specifier: ^5.5.4 - version: 5.5.4 + specifier: ^5.7.2 + version: 5.7.2 vnu-jar: - specifier: ^23.4.11 - version: 23.4.11 + specifier: ^24.10.17 + version: 24.10.17 webidl2: specifier: ^24.4.1 version: 24.4.1 @@ -240,13 +240,13 @@ packages: resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - '@puppeteer/browsers@2.3.1': - resolution: {integrity: sha512-uK7o3hHkK+naEobMSJ+2ySYyXtQkBxIH8Gn4MK9ciePjNV+Pf+PgY/W7iPzn2MTjl3stcYB5AlcTmPYw7AXDwA==} + '@puppeteer/browsers@2.4.1': + resolution: {integrity: sha512-0kdAbmic3J09I6dT8e9vE2JOCSt13wHCW5x/ly8TSt2bDtuIWe2TgLZZDHdcziw9AVCzflMAXCrVyRIhIs44Ng==} engines: {node: '>=18'} hasBin: true - '@rollup/plugin-alias@5.1.0': - resolution: {integrity: sha512-lpA3RZ9PdIG7qqhEfv79tBffNaoDuukFDrmhLqg9ifv99u/ehn+lOg30x2zmhf8AQqQUZaMk/B9fZraQ6/acDQ==} + '@rollup/plugin-alias@5.1.1': + resolution: {integrity: sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 @@ -254,8 +254,8 @@ packages: rollup: optional: true - '@rollup/plugin-commonjs@26.0.1': - resolution: {integrity: sha512-UnsKoZK6/aGIH6AdkptXhNvhaqftcjq3zZdT+LY5Ftms6JR06nADcDsYp5hTU9E2lbJUEOhdlY5J4DNTneM+jQ==} + '@rollup/plugin-commonjs@28.0.1': + resolution: {integrity: sha512-+tNWdlWKbpB3WgBN7ijjYkq9X5uhjmcvyjEght4NmH5fAU++zfQzAJ6wumLS+dNcvwEZhKx2Z+skY8m7v0wGSA==} engines: {node: '>=16.0.0 || 14 >= 14.17'} peerDependencies: rollup: ^2.68.0||^3.0.0||^4.0.0 @@ -263,8 +263,8 @@ packages: rollup: optional: true - '@rollup/plugin-node-resolve@15.2.3': - resolution: {integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==} + '@rollup/plugin-node-resolve@15.3.0': + resolution: {integrity: sha512-9eO5McEICxMzJpDW9OnMYSv4Sta3hmt7VtBFz5zR9273suNOydOyq/FrGeGy+KsTRFm8w0SLVhzig2ILFT63Ag==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^2.78.0||^3.0.0||^4.0.0 @@ -290,86 +290,99 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.21.0': - resolution: {integrity: sha512-WTWD8PfoSAJ+qL87lE7votj3syLavxunWhzCnx3XFxFiI/BA/r3X7MUM8dVrH8rb2r4AiO8jJsr3ZjdaftmnfA==} + '@rollup/rollup-android-arm-eabi@4.27.4': + resolution: {integrity: sha512-2Y3JT6f5MrQkICUyRVCw4oa0sutfAsgaSsb0Lmmy1Wi2y7X5vT9Euqw4gOsCyy0YfKURBg35nhUKZS4mDcfULw==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.21.0': - resolution: {integrity: sha512-a1sR2zSK1B4eYkiZu17ZUZhmUQcKjk2/j9Me2IDjk1GHW7LB5Z35LEzj9iJch6gtUfsnvZs1ZNyDW2oZSThrkA==} + '@rollup/rollup-android-arm64@4.27.4': + resolution: {integrity: sha512-wzKRQXISyi9UdCVRqEd0H4cMpzvHYt1f/C3CoIjES6cG++RHKhrBj2+29nPF0IB5kpy9MS71vs07fvrNGAl/iA==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.21.0': - resolution: {integrity: sha512-zOnKWLgDld/svhKO5PD9ozmL6roy5OQ5T4ThvdYZLpiOhEGY+dp2NwUmxK0Ld91LrbjrvtNAE0ERBwjqhZTRAA==} + '@rollup/rollup-darwin-arm64@4.27.4': + resolution: {integrity: sha512-PlNiRQapift4LNS8DPUHuDX/IdXiLjf8mc5vdEmUR0fF/pyy2qWwzdLjB+iZquGr8LuN4LnUoSEvKRwjSVYz3Q==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.21.0': - resolution: {integrity: sha512-7doS8br0xAkg48SKE2QNtMSFPFUlRdw9+votl27MvT46vo44ATBmdZdGysOevNELmZlfd+NEa0UYOA8f01WSrg==} + '@rollup/rollup-darwin-x64@4.27.4': + resolution: {integrity: sha512-o9bH2dbdgBDJaXWJCDTNDYa171ACUdzpxSZt+u/AAeQ20Nk5x+IhA+zsGmrQtpkLiumRJEYef68gcpn2ooXhSQ==} cpu: [x64] os: [darwin] - '@rollup/rollup-linux-arm-gnueabihf@4.21.0': - resolution: {integrity: sha512-pWJsfQjNWNGsoCq53KjMtwdJDmh/6NubwQcz52aEwLEuvx08bzcy6tOUuawAOncPnxz/3siRtd8hiQ32G1y8VA==} + '@rollup/rollup-freebsd-arm64@4.27.4': + resolution: {integrity: sha512-NBI2/i2hT9Q+HySSHTBh52da7isru4aAAo6qC3I7QFVsuhxi2gM8t/EI9EVcILiHLj1vfi+VGGPaLOUENn7pmw==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.27.4': + resolution: {integrity: sha512-wYcC5ycW2zvqtDYrE7deary2P2UFmSh85PUpAx+dwTCO9uw3sgzD6Gv9n5X4vLaQKsrfTSZZ7Z7uynQozPVvWA==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.27.4': + resolution: {integrity: sha512-9OwUnK/xKw6DyRlgx8UizeqRFOfi9mf5TYCw1uolDaJSbUmBxP85DE6T4ouCMoN6pXw8ZoTeZCSEfSaYo+/s1w==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.21.0': - resolution: {integrity: sha512-efRIANsz3UHZrnZXuEvxS9LoCOWMGD1rweciD6uJQIx2myN3a8Im1FafZBzh7zk1RJ6oKcR16dU3UPldaKd83w==} + '@rollup/rollup-linux-arm-musleabihf@4.27.4': + resolution: {integrity: sha512-Vgdo4fpuphS9V24WOV+KwkCVJ72u7idTgQaBoLRD0UxBAWTF9GWurJO9YD9yh00BzbkhpeXtm6na+MvJU7Z73A==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.21.0': - resolution: {integrity: sha512-ZrPhydkTVhyeGTW94WJ8pnl1uroqVHM3j3hjdquwAcWnmivjAwOYjTEAuEDeJvGX7xv3Z9GAvrBkEzCgHq9U1w==} + '@rollup/rollup-linux-arm64-gnu@4.27.4': + resolution: {integrity: sha512-pleyNgyd1kkBkw2kOqlBx+0atfIIkkExOTiifoODo6qKDSpnc6WzUY5RhHdmTdIJXBdSnh6JknnYTtmQyobrVg==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.21.0': - resolution: {integrity: sha512-cfaupqd+UEFeURmqNP2eEvXqgbSox/LHOyN9/d2pSdV8xTrjdg3NgOFJCtc1vQ/jEke1qD0IejbBfxleBPHnPw==} + '@rollup/rollup-linux-arm64-musl@4.27.4': + resolution: {integrity: sha512-caluiUXvUuVyCHr5DxL8ohaaFFzPGmgmMvwmqAITMpV/Q+tPoaHZ/PWa3t8B2WyoRcIIuu1hkaW5KkeTDNSnMA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.21.0': - resolution: {integrity: sha512-ZKPan1/RvAhrUylwBXC9t7B2hXdpb/ufeu22pG2psV7RN8roOfGurEghw1ySmX/CmDDHNTDDjY3lo9hRlgtaHg==} + '@rollup/rollup-linux-powerpc64le-gnu@4.27.4': + resolution: {integrity: sha512-FScrpHrO60hARyHh7s1zHE97u0KlT/RECzCKAdmI+LEoC1eDh/RDji9JgFqyO+wPDb86Oa/sXkily1+oi4FzJQ==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.21.0': - resolution: {integrity: sha512-H1eRaCwd5E8eS8leiS+o/NqMdljkcb1d6r2h4fKSsCXQilLKArq6WS7XBLDu80Yz+nMqHVFDquwcVrQmGr28rg==} + '@rollup/rollup-linux-riscv64-gnu@4.27.4': + resolution: {integrity: sha512-qyyprhyGb7+RBfMPeww9FlHwKkCXdKHeGgSqmIXw9VSUtvyFZ6WZRtnxgbuz76FK7LyoN8t/eINRbPUcvXB5fw==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.21.0': - resolution: {integrity: sha512-zJ4hA+3b5tu8u7L58CCSI0A9N1vkfwPhWd/puGXwtZlsB5bTkwDNW/+JCU84+3QYmKpLi+XvHdmrlwUwDA6kqw==} + '@rollup/rollup-linux-s390x-gnu@4.27.4': + resolution: {integrity: sha512-PFz+y2kb6tbh7m3A7nA9++eInGcDVZUACulf/KzDtovvdTizHpZaJty7Gp0lFwSQcrnebHOqxF1MaKZd7psVRg==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.21.0': - resolution: {integrity: sha512-e2hrvElFIh6kW/UNBQK/kzqMNY5mO+67YtEh9OA65RM5IJXYTWiXjX6fjIiPaqOkBthYF1EqgiZ6OXKcQsM0hg==} + '@rollup/rollup-linux-x64-gnu@4.27.4': + resolution: {integrity: sha512-Ni8mMtfo+o/G7DVtweXXV/Ol2TFf63KYjTtoZ5f078AUgJTmaIJnj4JFU7TK/9SVWTaSJGxPi5zMDgK4w+Ez7Q==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.21.0': - resolution: {integrity: sha512-1vvmgDdUSebVGXWX2lIcgRebqfQSff0hMEkLJyakQ9JQUbLDkEaMsPTLOmyccyC6IJ/l3FZuJbmrBw/u0A0uCQ==} + '@rollup/rollup-linux-x64-musl@4.27.4': + resolution: {integrity: sha512-5AeeAF1PB9TUzD+3cROzFTnAJAcVUGLuR8ng0E0WXGkYhp6RD6L+6szYVX+64Rs0r72019KHZS1ka1q+zU/wUw==} cpu: [x64] os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.21.0': - resolution: {integrity: sha512-s5oFkZ/hFcrlAyBTONFY1TWndfyre1wOMwU+6KCpm/iatybvrRgmZVM+vCFwxmC5ZhdlgfE0N4XorsDpi7/4XQ==} + '@rollup/rollup-win32-arm64-msvc@4.27.4': + resolution: {integrity: sha512-yOpVsA4K5qVwu2CaS3hHxluWIK5HQTjNV4tWjQXluMiiiu4pJj4BN98CvxohNCpcjMeTXk/ZMJBRbgRg8HBB6A==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.21.0': - resolution: {integrity: sha512-G9+TEqRnAA6nbpqyUqgTiopmnfgnMkR3kMukFBDsiyy23LZvUCpiUwjTRx6ezYCjJODXrh52rBR9oXvm+Fp5wg==} + '@rollup/rollup-win32-ia32-msvc@4.27.4': + resolution: {integrity: sha512-KtwEJOaHAVJlxV92rNYiG9JQwQAdhBlrjNRp7P9L8Cb4Rer3in+0A+IPhJC9y68WAi9H0sX4AiG2NTsVlmqJeQ==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.21.0': - resolution: {integrity: sha512-2jsCDZwtQvRhejHLfZ1JY6w6kEuEtfF9nzYsZxzSlNVKDX+DpsDJ+Rbjkm74nvg2rdx0gwBS+IMdvwJuq3S9pQ==} + '@rollup/rollup-win32-x64-msvc@4.27.4': + resolution: {integrity: sha512-3j4jx1TppORdTAoBJRd+/wJRGCPC0ETWkXOecJ6PPZLj6SptXkrXcNqdj0oclbKML6FkQltdz7bBA3rUSirZug==} cpu: [x64] os: [win32] + '@rtsao/scc@1.1.0': + resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} + '@socket.io/component-emitter@3.1.0': resolution: {integrity: sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==} @@ -388,6 +401,9 @@ packages: '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} + '@types/estree@1.0.6': + resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} + '@types/html-minifier@3.5.3': resolution: {integrity: sha512-j1P/4PcWVVCPEy5lofcHnQ6BtXz9tHGiFPWzqm7TtGuWZEfCHEP446HlkSNc9fQgNJaJZ6ewPtp2aaFla/Uerg==} @@ -524,12 +540,16 @@ packages: array-buffer-byte-length@1.0.0: resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} - array-includes@3.1.7: - resolution: {integrity: sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==} + array-buffer-byte-length@1.0.1: + resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} engines: {node: '>= 0.4'} - array.prototype.findlastindex@1.2.3: - resolution: {integrity: sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==} + array-includes@3.1.8: + resolution: {integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==} + engines: {node: '>= 0.4'} + + array.prototype.findlastindex@1.2.5: + resolution: {integrity: sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==} engines: {node: '>= 0.4'} array.prototype.flat@1.3.2: @@ -544,6 +564,10 @@ packages: resolution: {integrity: sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==} engines: {node: '>= 0.4'} + arraybuffer.prototype.slice@1.0.3: + resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} + engines: {node: '>= 0.4'} + ast-types@0.13.4: resolution: {integrity: sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==} engines: {node: '>=4'} @@ -558,6 +582,10 @@ packages: resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} engines: {node: '>= 0.4'} + available-typed-arrays@1.0.7: + resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} + engines: {node: '>= 0.4'} + b4a@1.6.4: resolution: {integrity: sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==} @@ -591,8 +619,8 @@ packages: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} - body-parser@1.20.2: - resolution: {integrity: sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==} + body-parser@1.20.3: + resolution: {integrity: sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} boxen@7.0.0: @@ -609,8 +637,8 @@ packages: brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} - braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} buffer-crc32@0.2.13: @@ -622,10 +650,6 @@ packages: buffer@5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - builtin-modules@3.3.0: - resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} - engines: {node: '>=6'} - bytes@3.0.0: resolution: {integrity: sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==} engines: {node: '>= 0.8'} @@ -637,6 +661,10 @@ packages: call-bind@1.0.5: resolution: {integrity: sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==} + call-bind@1.0.7: + resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} + engines: {node: '>= 0.4'} + callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -676,8 +704,12 @@ packages: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} - chromium-bidi@0.6.4: - resolution: {integrity: sha512-8zoq6ogmhQQkAKZVKO2ObFTl4uOkqoX1PlKQX3hZQ5E9cbUotcAb7h4pTNVAGGv8Z36PF3CtdOriEp/Rz82JqQ==} + chokidar@4.0.1: + resolution: {integrity: sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==} + engines: {node: '>= 14.16.0'} + + chromium-bidi@0.8.0: + resolution: {integrity: sha512-uJydbGdTw0DEUjhoogGveneJVWX/9YuqkWePzMmkBYwtdAqo5d3J/ovNKFr+/2hWXYmYCr6it8mSSTIj6SS6Ug==} peerDependencies: devtools-protocol: '*' @@ -775,8 +807,8 @@ packages: typescript: optional: true - cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} custom-event@1.0.1: @@ -790,6 +822,18 @@ packages: resolution: {integrity: sha512-MZd3VlchQkp8rdend6vrx7MmVDJzSNTBvghvKjirLkD+WTChA3KUf0jkE68Q4UyctNqI11zZO9/x2Yx+ub5Cvg==} engines: {node: '>= 14'} + data-view-buffer@1.0.1: + resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} + engines: {node: '>= 0.4'} + + data-view-byte-length@1.0.1: + resolution: {integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==} + engines: {node: '>= 0.4'} + + data-view-byte-offset@1.0.0: + resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} + engines: {node: '>= 0.4'} + date-format@4.0.14: resolution: {integrity: sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==} engines: {node: '>=4.0'} @@ -810,8 +854,8 @@ packages: supports-color: optional: true - debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + debug@4.3.6: + resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -819,8 +863,8 @@ packages: supports-color: optional: true - debug@4.3.6: - resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} + debug@4.3.7: + resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -843,6 +887,10 @@ packages: resolution: {integrity: sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==} engines: {node: '>= 0.4'} + define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + define-properties@1.2.1: resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} engines: {node: '>= 0.4'} @@ -859,8 +907,8 @@ packages: resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} - devtools-protocol@0.0.1312386: - resolution: {integrity: sha512-DPnhUXvmvKT2dFA/j7B+riVLUt9Q6RKJlcppojL5CoRywJJKLDYnRlw0gTFKfgDPHP5E04UoB71SxoJlVZy8FA==} + devtools-protocol@0.0.1367902: + resolution: {integrity: sha512-XxtPuC3PGakY6PD7dG66/o8KwJ/LkH2/EKe19Dcw58w53dv4/vSQEkn/SzuyhHE2q4zPgCkxQBxus3VV4ql+Pg==} di@0.0.1: resolution: {integrity: sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA==} @@ -910,6 +958,10 @@ packages: resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} engines: {node: '>= 0.8'} + encodeurl@2.0.0: + resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==} + engines: {node: '>= 0.8'} + end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} @@ -939,10 +991,30 @@ packages: resolution: {integrity: sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==} engines: {node: '>= 0.4'} + es-abstract@1.23.5: + resolution: {integrity: sha512-vlmniQ0WNPwXqA0BnmwV3Ng7HxiGlh6r5U6JcTMNx8OilcAGqVJBHJcPjqOMaczU9fRuRK5Px2BdVyPRnKMMVQ==} + engines: {node: '>= 0.4'} + + es-define-property@1.0.0: + resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + es-object-atoms@1.0.0: + resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} + engines: {node: '>= 0.4'} + es-set-tostringtag@2.0.2: resolution: {integrity: sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q==} engines: {node: '>= 0.4'} + es-set-tostringtag@2.0.3: + resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==} + engines: {node: '>= 0.4'} + es-shim-unscopables@1.0.2: resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} @@ -979,8 +1051,8 @@ packages: eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} - eslint-module-utils@2.8.0: - resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} + eslint-module-utils@2.12.0: + resolution: {integrity: sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -1000,18 +1072,18 @@ packages: eslint-import-resolver-webpack: optional: true - eslint-plugin-import@2.29.1: - resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} + eslint-plugin-import@2.31.0: + resolution: {integrity: sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9 peerDependenciesMeta: '@typescript-eslint/parser': optional: true - eslint-plugin-jasmine@4.2.1: - resolution: {integrity: sha512-Vwecc66rjMgz2e9UtGScsUdo6D+SbfgPA4Kf0zdAl4+5IQMRL0mXd8973MaZuYYF89XpRjQEGl5TNmg2Bv+KcQ==} + eslint-plugin-jasmine@4.2.2: + resolution: {integrity: sha512-nALbewRk63uz28UGNhUTJyd6GofXxVNFpWFNAwr9ySc6kpSRIoO4suwZqIYz3cfJmCacilmjp7+1Ocjr7zRagA==} engines: {node: '>=8', npm: '>=6'} eslint-plugin-prettier@5.2.1: @@ -1039,6 +1111,7 @@ packages: eslint@8.57.0: resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. hasBin: true espree@9.6.1: @@ -1114,29 +1187,34 @@ packages: fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - fast-url-parser@1.1.3: - resolution: {integrity: sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ==} - fastq@1.16.0: resolution: {integrity: sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==} fd-slicer@1.1.0: resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} + fdir@6.4.2: + resolution: {integrity: sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} - fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} finalhandler@1.1.2: resolution: {integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==} engines: {node: '>= 0.8'} - finalhandler@1.2.0: - resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} + finalhandler@1.3.1: + resolution: {integrity: sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==} engines: {node: '>= 0.8'} find-up@5.0.0: @@ -1203,6 +1281,10 @@ packages: get-intrinsic@1.2.2: resolution: {integrity: sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==} + get-intrinsic@1.2.4: + resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} + engines: {node: '>= 0.4'} + get-stream@5.2.0: resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} engines: {node: '>=8'} @@ -1215,6 +1297,10 @@ packages: resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} engines: {node: '>= 0.4'} + get-symbol-description@1.0.2: + resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} + engines: {node: '>= 0.4'} + get-uri@6.0.2: resolution: {integrity: sha512-5KLucCJobh8vBY1K07EFV4+cPZH3mrV9YeAruUseCQKHB58SGjjT2l9/eA9LD082IiuMjSlFJEcdJ27TXvbZNw==} engines: {node: '>= 14'} @@ -1227,11 +1313,6 @@ packages: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} - glob@10.3.10: - resolution: {integrity: sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==} - engines: {node: '>=16 || 14 >=14.17'} - hasBin: true - glob@10.4.5: resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true @@ -1248,6 +1329,10 @@ packages: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} engines: {node: '>= 0.4'} + globalthis@1.0.4: + resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} + engines: {node: '>= 0.4'} + gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} @@ -1271,10 +1356,17 @@ packages: has-property-descriptors@1.0.1: resolution: {integrity: sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==} + has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + has-proto@1.0.1: resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} engines: {node: '>= 0.4'} + has-proto@1.0.3: + resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} + engines: {node: '>= 0.4'} + has-symbols@1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} @@ -1283,10 +1375,18 @@ packages: resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} engines: {node: '>= 0.4'} + has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + hasown@2.0.0: resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} engines: {node: '>= 0.4'} + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + he@1.2.0: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true @@ -1365,6 +1465,10 @@ packages: resolution: {integrity: sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==} engines: {node: '>= 0.4'} + internal-slot@1.0.7: + resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} + engines: {node: '>= 0.4'} + ip@1.1.8: resolution: {integrity: sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==} @@ -1374,9 +1478,17 @@ packages: is-array-buffer@3.0.2: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} + is-array-buffer@3.0.4: + resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} + engines: {node: '>= 0.4'} + is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + is-async-function@2.0.0: + resolution: {integrity: sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==} + engines: {node: '>= 0.4'} + is-bigint@1.0.4: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} @@ -1388,10 +1500,6 @@ packages: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} engines: {node: '>= 0.4'} - is-builtin-module@3.2.1: - resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} - engines: {node: '>=6'} - is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} @@ -1399,6 +1507,14 @@ packages: is-core-module@2.13.1: resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} + is-core-module@2.15.1: + resolution: {integrity: sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==} + engines: {node: '>= 0.4'} + + is-data-view@1.0.1: + resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} + engines: {node: '>= 0.4'} + is-date-object@1.0.5: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} @@ -1412,14 +1528,25 @@ packages: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} + is-finalizationregistry@1.0.2: + resolution: {integrity: sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==} + is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + is-generator-function@1.0.10: + resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} + engines: {node: '>= 0.4'} + is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-map@2.0.3: + resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} + engines: {node: '>= 0.4'} + is-module@1.0.0: resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} @@ -1427,6 +1554,10 @@ packages: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} + is-negative-zero@2.0.3: + resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} + engines: {node: '>= 0.4'} + is-number-object@1.0.7: resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} engines: {node: '>= 0.4'} @@ -1450,9 +1581,17 @@ packages: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} + is-set@2.0.3: + resolution: {integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==} + engines: {node: '>= 0.4'} + is-shared-array-buffer@1.0.2: resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} + is-shared-array-buffer@1.0.3: + resolution: {integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==} + engines: {node: '>= 0.4'} + is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} @@ -1469,9 +1608,21 @@ packages: resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==} engines: {node: '>= 0.4'} + is-typed-array@1.1.13: + resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} + engines: {node: '>= 0.4'} + + is-weakmap@2.0.2: + resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} + engines: {node: '>= 0.4'} + is-weakref@1.0.2: resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} + is-weakset@2.0.3: + resolution: {integrity: sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==} + engines: {node: '>= 0.4'} + is-wsl@2.2.0: resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} engines: {node: '>=8'} @@ -1489,21 +1640,17 @@ packages: isstream@0.1.2: resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==} - jackspeak@2.3.6: - resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==} - engines: {node: '>=14'} - jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} jasmine-core@4.6.0: resolution: {integrity: sha512-O236+gd0ZXS8YAjFx8xKaJ94/erqUliEkJTDedyE7iHvv4ZVqi+q+8acJxu05/WJDKm512EUNn809In37nWlAQ==} - jasmine-core@5.2.0: - resolution: {integrity: sha512-tSAtdrvWybZkQmmaIoDgnvHG8ORUNw5kEVlO5CvrXj02Jjr9TZrmjFq7FUiOUzJiOP2wLGYT6PgrQgQF4R1xiw==} + jasmine-core@5.4.0: + resolution: {integrity: sha512-T4fio3W++llLd7LGSGsioriDHgWyhoL6YTu4k37uwJLF7DzOzspz7mNxRoM3cQdLWtL/ebazQpIf/yZGJx/gzg==} - jasmine@5.2.0: - resolution: {integrity: sha512-il+noV96N1BGU9/FMmc8QtAMxC8lPnXUiAvgb0o9MDZATRdxglTQe9wo6UdL049ropQL6MopDYwDlludKR6wJQ==} + jasmine@5.4.0: + resolution: {integrity: sha512-E2u4ylX5tgGYvbynImU6EUBKKrSVB1L72FEPjGh4M55ov1VsxR26RA2JU91L9YSPFgcjo4mCLyKn/QXvEYGBkA==} hasBin: true js-tokens@4.0.0: @@ -1608,10 +1755,6 @@ packages: lower-case@1.1.4: resolution: {integrity: sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==} - lru-cache@10.1.0: - resolution: {integrity: sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==} - engines: {node: 14 || >=16.14} - lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} @@ -1674,10 +1817,6 @@ packages: minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - minimatch@9.0.3: - resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} - engines: {node: '>=16 || 14 >=14.17'} - minimatch@9.0.5: resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} engines: {node: '>=16 || 14 >=14.17'} @@ -1685,10 +1824,6 @@ packages: minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - minipass@7.0.4: - resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} - engines: {node: '>=16 || 14 >=14.17'} - minipass@7.1.2: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} @@ -1745,6 +1880,10 @@ packages: object-inspect@1.13.1: resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} + object-inspect@1.13.3: + resolution: {integrity: sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==} + engines: {node: '>= 0.4'} + object-keys@1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} engines: {node: '>= 0.4'} @@ -1753,15 +1892,16 @@ packages: resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} engines: {node: '>= 0.4'} - object.fromentries@2.0.7: - resolution: {integrity: sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==} + object.fromentries@2.0.8: + resolution: {integrity: sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==} engines: {node: '>= 0.4'} - object.groupby@1.0.1: - resolution: {integrity: sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==} + object.groupby@1.0.3: + resolution: {integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==} + engines: {node: '>= 0.4'} - object.values@1.1.7: - resolution: {integrity: sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==} + object.values@1.2.0: + resolution: {integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==} engines: {node: '>= 0.4'} on-finished@2.3.0: @@ -1846,16 +1986,12 @@ packages: path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - path-scurry@1.10.1: - resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} - engines: {node: '>=16 || 14 >=14.17'} - path-scurry@1.11.1: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} - path-to-regexp@2.2.1: - resolution: {integrity: sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==} + path-to-regexp@3.3.0: + resolution: {integrity: sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==} pend@1.2.0: resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} @@ -1864,10 +2000,18 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + picomatch@4.0.2: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + pluralize@8.0.0: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} + possible-typed-array-names@1.0.0: + resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} + engines: {node: '>= 0.4'} + prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -1876,8 +2020,8 @@ packages: resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} engines: {node: '>=6.0.0'} - prettier@3.3.3: - resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + prettier@3.4.0: + resolution: {integrity: sha512-/OXNZcLyWkfo13ofOW5M7SLh+k5pnIs07owXK2teFpnfaOEcycnSy7HQxldaVX1ZP/7Q8oO1eDuQJNwbomQq5Q==} engines: {node: '>=14'} hasBin: true @@ -1899,19 +2043,16 @@ packages: pump@3.0.0: resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} - punycode@1.4.1: - resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} - punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} - puppeteer-core@23.1.1: - resolution: {integrity: sha512-OeTqNiYGF9qZtwZU4Yc88DDqFJs4TJ4rnK81jkillh6MwDeQodyisM9xe5lBmPhwiDy92s5J5DQtQLjCKHFQ3g==} + puppeteer-core@23.9.0: + resolution: {integrity: sha512-hLVrav2HYMVdK0YILtfJwtnkBAwNOztUdR4aJ5YKDvgsbtagNr6urUJk9HyjRA9e+PaLI3jzJ0wM7A4jSZ7Qxw==} engines: {node: '>=18'} - puppeteer@23.1.1: - resolution: {integrity: sha512-giN4Ikwl5hkkouH/dVyxIPTPslWuqZ8fjALdSw5Cvt+r0LuDpLdfPxRADlB75YJ2UjPZhgok+xYBYk8ffzv4MA==} + puppeteer@23.9.0: + resolution: {integrity: sha512-WfB8jGwFV+qrD9dcJJVvWPFJBU6kxeu2wxJz9WooDGfM3vIiKLgzImEDBxUQnCBK/2cXB3d4dV6gs/LLpgfLDg==} engines: {node: '>=18'} hasBin: true @@ -1919,8 +2060,8 @@ packages: resolution: {integrity: sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==} engines: {node: '>=0.9'} - qs@6.11.0: - resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} + qs@6.13.0: + resolution: {integrity: sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==} engines: {node: '>=0.6'} queue-microtask@1.2.3: @@ -1956,10 +2097,22 @@ packages: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} + readdirp@4.0.2: + resolution: {integrity: sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==} + engines: {node: '>= 14.16.0'} + + reflect.getprototypeof@1.0.6: + resolution: {integrity: sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==} + engines: {node: '>= 0.4'} + regexp.prototype.flags@1.5.1: resolution: {integrity: sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==} engines: {node: '>= 0.4'} + regexp.prototype.flags@1.5.3: + resolution: {integrity: sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==} + engines: {node: '>= 0.4'} + registry-auth-token@3.3.2: resolution: {integrity: sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==} @@ -2018,8 +2171,8 @@ packages: rollup-pluginutils@2.8.2: resolution: {integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==} - rollup@4.21.0: - resolution: {integrity: sha512-vo+S/lfA2lMS7rZ2Qoubi6I5hwZwzXeUIctILZLbHI+laNtvhhOIon2S1JksA5UEDQ7l3vberd0fxK44lTYjbQ==} + rollup@4.27.4: + resolution: {integrity: sha512-RLKxqHEMjh/RGLsDxAEsaLO3mWgyoU6x9w6n1ikAzet4B3gI2/3yP6PWY2p9QzRTh6MfEIXB3MwsOY0Iv3vNrw==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -2034,6 +2187,10 @@ packages: resolution: {integrity: sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==} engines: {node: '>=0.4'} + safe-array-concat@1.1.2: + resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} + engines: {node: '>=0.4'} + safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} @@ -2043,6 +2200,10 @@ packages: safe-regex-test@1.0.0: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} + safe-regex-test@1.0.3: + resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} + engines: {node: '>= 0.4'} + safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} @@ -2055,22 +2216,22 @@ packages: engines: {node: '>=10'} hasBin: true - send@0.18.0: - resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} + send@0.19.0: + resolution: {integrity: sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==} engines: {node: '>= 0.8.0'} serialize-javascript@6.0.1: resolution: {integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==} - serve-handler@6.1.5: - resolution: {integrity: sha512-ijPFle6Hwe8zfmBxJdE+5fta53fdIY0lHISJvuikXB3VYFafRjMRpOffSPvCYsbKyBA7pvy9oYr/BT1O3EArlg==} + serve-handler@6.1.6: + resolution: {integrity: sha512-x5RL9Y2p5+Sh3D38Fh9i/iQ5ZK+e4xuXRd/pGbM4D13tgo/MGwbttUk8emytcr1YYzBYs+apnUngBDFYfpjPuQ==} - serve-static@1.15.0: - resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} + serve-static@1.16.2: + resolution: {integrity: sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==} engines: {node: '>= 0.8.0'} - serve@14.2.3: - resolution: {integrity: sha512-VqUFMC7K3LDGeGnJM9h56D3XGKb6KGgOw0cVNtA26yYXHCcpxf3xwCTUaQoWlVS7i8Jdh3GjQkOB23qsXyjoyQ==} + serve@14.2.4: + resolution: {integrity: sha512-qy1S34PJ/fcY8gjVGszDB3EXiPSk5FKhUa7tQe0UPRddxRidc2V6cNHPNewbE1D7MAkgLuWEt3Vw56vYy73tzQ==} engines: {node: '>= 14'} hasBin: true @@ -2078,10 +2239,18 @@ packages: resolution: {integrity: sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==} engines: {node: '>= 0.4'} + set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + set-function-name@2.0.1: resolution: {integrity: sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==} engines: {node: '>= 0.4'} + set-function-name@2.0.2: + resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==} + engines: {node: '>= 0.4'} + setprototypeof@1.2.0: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} @@ -2096,6 +2265,10 @@ packages: side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} + side-channel@1.0.6: + resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} + engines: {node: '>= 0.4'} + signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} @@ -2103,10 +2276,6 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} - slash@4.0.0: - resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} - engines: {node: '>=12'} - smart-buffer@4.2.0: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} @@ -2181,12 +2350,20 @@ packages: resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==} engines: {node: '>= 0.4'} - string.prototype.trimend@1.0.7: - resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} + string.prototype.trim@1.2.9: + resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} + engines: {node: '>= 0.4'} + + string.prototype.trimend@1.0.8: + resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==} string.prototype.trimstart@1.0.7: resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} + string.prototype.trimstart@1.0.8: + resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} + engines: {node: '>= 0.4'} + strip-ansi@4.0.0: resolution: {integrity: sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==} engines: {node: '>=4'} @@ -2290,17 +2467,33 @@ packages: resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} engines: {node: '>= 0.4'} + typed-array-buffer@1.0.2: + resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} + engines: {node: '>= 0.4'} + typed-array-byte-length@1.0.0: resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} engines: {node: '>= 0.4'} + typed-array-byte-length@1.0.1: + resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==} + engines: {node: '>= 0.4'} + typed-array-byte-offset@1.0.0: resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==} engines: {node: '>= 0.4'} + typed-array-byte-offset@1.0.3: + resolution: {integrity: sha512-GsvTyUHTriq6o/bHcTd0vM7OQ9JEdlvluu9YISaA7+KzDzPaIzEeDFNkTfhdE3MYcNhNi0vq/LlegYgIs5yPAw==} + engines: {node: '>= 0.4'} + typed-array-length@1.0.4: resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} + typed-array-length@1.0.6: + resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} + engines: {node: '>= 0.4'} + typed-query-selector@2.12.0: resolution: {integrity: sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==} @@ -2309,8 +2502,8 @@ packages: engines: {node: '>=4.2.0'} hasBin: true - typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} + typescript@5.7.2: + resolution: {integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==} engines: {node: '>=14.17'} hasBin: true @@ -2365,8 +2558,8 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - vnu-jar@23.4.11: - resolution: {integrity: sha512-lI5dzBYXtxhilNI7EeQ5iUduYnNBq7YWx4UjfBVLXfBQHnXYZSf3y3bpM0bSyDU6jy/+OyKV7nw4tzpR5lXSZg==} + vnu-jar@24.10.17: + resolution: {integrity: sha512-YT7gNrRY5PiJrI1GavlWRHWIwqq2o52COc6J9QeXPfoldKRiZ9BeGP4shNLLaVfi0naA+/LMksdYWkKCr4pnVg==} engines: {node: '>=0.10'} void-elements@2.0.1: @@ -2380,10 +2573,22 @@ packages: which-boxed-primitive@1.0.2: resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + which-builtin-type@1.1.4: + resolution: {integrity: sha512-bppkmBSsHFmIMSl8BO9TbsyzsvGjVoppt8xUiGzwiu/bhDCGxnpOKCxgqj6GuyHE0mINMDecBFPlOm2hzY084w==} + engines: {node: '>= 0.4'} + + which-collection@1.0.2: + resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==} + engines: {node: '>= 0.4'} + which-typed-array@1.1.13: resolution: {integrity: sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==} engines: {node: '>= 0.4'} + which-typed-array@1.1.15: + resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==} + engines: {node: '>= 0.4'} + which@1.3.1: resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} hasBin: true @@ -2508,7 +2713,7 @@ snapshots: '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 - debug: 4.3.6 + debug: 4.3.7 espree: 9.6.1 globals: 13.24.0 ignore: 5.3.0 @@ -2524,7 +2729,7 @@ snapshots: '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.6 + debug: 4.3.7 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -2581,9 +2786,9 @@ snapshots: '@pkgr/core@0.1.1': {} - '@puppeteer/browsers@2.3.1': + '@puppeteer/browsers@2.4.1': dependencies: - debug: 4.3.6 + debug: 4.3.7 extract-zip: 2.0.1 progress: 2.0.3 proxy-agent: 6.4.0 @@ -2594,98 +2799,104 @@ snapshots: transitivePeerDependencies: - supports-color - '@rollup/plugin-alias@5.1.0(rollup@4.21.0)': - dependencies: - slash: 4.0.0 + '@rollup/plugin-alias@5.1.1(rollup@4.27.4)': optionalDependencies: - rollup: 4.21.0 + rollup: 4.27.4 - '@rollup/plugin-commonjs@26.0.1(rollup@4.21.0)': + '@rollup/plugin-commonjs@28.0.1(rollup@4.27.4)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.21.0) + '@rollup/pluginutils': 5.1.0(rollup@4.27.4) commondir: 1.0.1 estree-walker: 2.0.2 - glob: 10.4.5 + fdir: 6.4.2(picomatch@4.0.2) is-reference: 1.2.1 magic-string: 0.30.5 + picomatch: 4.0.2 optionalDependencies: - rollup: 4.21.0 + rollup: 4.27.4 - '@rollup/plugin-node-resolve@15.2.3(rollup@4.21.0)': + '@rollup/plugin-node-resolve@15.3.0(rollup@4.27.4)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.21.0) + '@rollup/pluginutils': 5.1.0(rollup@4.27.4) '@types/resolve': 1.20.2 deepmerge: 4.3.1 - is-builtin-module: 3.2.1 is-module: 1.0.0 resolve: 1.22.8 optionalDependencies: - rollup: 4.21.0 + rollup: 4.27.4 - '@rollup/plugin-terser@0.4.4(rollup@4.21.0)': + '@rollup/plugin-terser@0.4.4(rollup@4.27.4)': dependencies: serialize-javascript: 6.0.1 smob: 1.4.1 terser: 5.26.0 optionalDependencies: - rollup: 4.21.0 + rollup: 4.27.4 - '@rollup/pluginutils@5.1.0(rollup@4.21.0)': + '@rollup/pluginutils@5.1.0(rollup@4.27.4)': dependencies: '@types/estree': 1.0.5 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: - rollup: 4.21.0 + rollup: 4.27.4 + + '@rollup/rollup-android-arm-eabi@4.27.4': + optional: true - '@rollup/rollup-android-arm-eabi@4.21.0': + '@rollup/rollup-android-arm64@4.27.4': optional: true - '@rollup/rollup-android-arm64@4.21.0': + '@rollup/rollup-darwin-arm64@4.27.4': optional: true - '@rollup/rollup-darwin-arm64@4.21.0': + '@rollup/rollup-darwin-x64@4.27.4': optional: true - '@rollup/rollup-darwin-x64@4.21.0': + '@rollup/rollup-freebsd-arm64@4.27.4': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.21.0': + '@rollup/rollup-freebsd-x64@4.27.4': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.21.0': + '@rollup/rollup-linux-arm-gnueabihf@4.27.4': optional: true - '@rollup/rollup-linux-arm64-gnu@4.21.0': + '@rollup/rollup-linux-arm-musleabihf@4.27.4': optional: true - '@rollup/rollup-linux-arm64-musl@4.21.0': + '@rollup/rollup-linux-arm64-gnu@4.27.4': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.21.0': + '@rollup/rollup-linux-arm64-musl@4.27.4': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.21.0': + '@rollup/rollup-linux-powerpc64le-gnu@4.27.4': optional: true - '@rollup/rollup-linux-s390x-gnu@4.21.0': + '@rollup/rollup-linux-riscv64-gnu@4.27.4': optional: true - '@rollup/rollup-linux-x64-gnu@4.21.0': + '@rollup/rollup-linux-s390x-gnu@4.27.4': optional: true - '@rollup/rollup-linux-x64-musl@4.21.0': + '@rollup/rollup-linux-x64-gnu@4.27.4': optional: true - '@rollup/rollup-win32-arm64-msvc@4.21.0': + '@rollup/rollup-linux-x64-musl@4.27.4': optional: true - '@rollup/rollup-win32-ia32-msvc@4.21.0': + '@rollup/rollup-win32-arm64-msvc@4.27.4': optional: true - '@rollup/rollup-win32-x64-msvc@4.21.0': + '@rollup/rollup-win32-ia32-msvc@4.27.4': optional: true + '@rollup/rollup-win32-x64-msvc@4.27.4': + optional: true + + '@rtsao/scc@1.1.0': {} + '@socket.io/component-emitter@3.1.0': {} '@tootallnate/quickjs-emscripten@0.23.0': {} @@ -2703,6 +2914,8 @@ snapshots: '@types/estree@1.0.5': {} + '@types/estree@1.0.6': {} + '@types/html-minifier@3.5.3': dependencies: '@types/clean-css': 4.2.11 @@ -2773,7 +2986,7 @@ snapshots: agent-base@7.1.0: dependencies: - debug: 4.3.6 + debug: 4.3.7 transitivePeerDependencies: - supports-color @@ -2826,24 +3039,31 @@ snapshots: array-buffer-byte-length@1.0.0: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 is-array-buffer: 3.0.2 - array-includes@3.1.7: + array-buffer-byte-length@1.0.1: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 + is-array-buffer: 3.0.4 + + array-includes@3.1.8: + dependencies: + call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.3 - get-intrinsic: 1.2.2 + es-abstract: 1.23.5 + es-object-atoms: 1.0.0 + get-intrinsic: 1.2.4 is-string: 1.0.7 - array.prototype.findlastindex@1.2.3: + array.prototype.findlastindex@1.2.5: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.3 + es-abstract: 1.23.5 + es-errors: 1.3.0 + es-object-atoms: 1.0.0 es-shim-unscopables: 1.0.2 - get-intrinsic: 1.2.2 array.prototype.flat@1.3.2: dependencies: @@ -2862,13 +3082,24 @@ snapshots: arraybuffer.prototype.slice@1.0.2: dependencies: array-buffer-byte-length: 1.0.0 - call-bind: 1.0.5 + call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.22.3 - get-intrinsic: 1.2.2 + get-intrinsic: 1.2.4 is-array-buffer: 3.0.2 is-shared-array-buffer: 1.0.2 + arraybuffer.prototype.slice@1.0.3: + dependencies: + array-buffer-byte-length: 1.0.1 + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.5 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + is-array-buffer: 3.0.4 + is-shared-array-buffer: 1.0.3 + ast-types@0.13.4: dependencies: tslib: 2.6.2 @@ -2881,6 +3112,10 @@ snapshots: available-typed-arrays@1.0.5: {} + available-typed-arrays@1.0.7: + dependencies: + possible-typed-array-names: 1.0.0 + b4a@1.6.4: {} balanced-match@1.0.2: {} @@ -2912,7 +3147,7 @@ snapshots: binary-extensions@2.2.0: {} - body-parser@1.20.2: + body-parser@1.20.3: dependencies: bytes: 3.1.2 content-type: 1.0.5 @@ -2922,7 +3157,7 @@ snapshots: http-errors: 2.0.0 iconv-lite: 0.4.24 on-finished: 2.4.1 - qs: 6.11.0 + qs: 6.13.0 raw-body: 2.5.2 type-is: 1.6.18 unpipe: 1.0.0 @@ -2960,9 +3195,9 @@ snapshots: dependencies: balanced-match: 1.0.2 - braces@3.0.2: + braces@3.0.3: dependencies: - fill-range: 7.0.1 + fill-range: 7.1.1 buffer-crc32@0.2.13: {} @@ -2973,8 +3208,6 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 - builtin-modules@3.3.0: {} - bytes@3.0.0: {} bytes@3.1.2: {} @@ -2985,6 +3218,14 @@ snapshots: get-intrinsic: 1.2.2 set-function-length: 1.1.1 + call-bind@1.0.7: + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + set-function-length: 1.2.2 + callsites@3.1.0: {} camel-case@3.0.0: @@ -3018,7 +3259,7 @@ snapshots: chokidar@3.6.0: dependencies: anymatch: 3.1.3 - braces: 3.0.2 + braces: 3.0.3 glob-parent: 5.1.2 is-binary-path: 2.1.0 is-glob: 4.0.3 @@ -3027,9 +3268,13 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - chromium-bidi@0.6.4(devtools-protocol@0.0.1312386): + chokidar@4.0.1: dependencies: - devtools-protocol: 0.0.1312386 + readdirp: 4.0.2 + + chromium-bidi@0.8.0(devtools-protocol@0.0.1367902): + dependencies: + devtools-protocol: 0.0.1367902 mitt: 3.0.1 urlpattern-polyfill: 10.0.0 zod: 3.23.8 @@ -3124,16 +3369,16 @@ snapshots: object-assign: 4.1.1 vary: 1.1.2 - cosmiconfig@9.0.0(typescript@5.5.4): + cosmiconfig@9.0.0(typescript@5.7.2): dependencies: env-paths: 2.2.1 import-fresh: 3.3.0 js-yaml: 4.1.0 parse-json: 5.2.0 optionalDependencies: - typescript: 5.5.4 + typescript: 5.7.2 - cross-spawn@7.0.3: + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 @@ -3145,6 +3390,24 @@ snapshots: data-uri-to-buffer@6.0.1: {} + data-view-buffer@1.0.1: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + + data-view-byte-length@1.0.1: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + + data-view-byte-offset@1.0.0: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + date-format@4.0.14: {} debug@2.6.9: @@ -3155,13 +3418,13 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.3.4: + debug@4.3.6: dependencies: ms: 2.1.2 - debug@4.3.6: + debug@4.3.7: dependencies: - ms: 2.1.2 + ms: 2.1.3 deep-extend@0.6.0: {} @@ -3171,10 +3434,16 @@ snapshots: define-data-property@1.1.1: dependencies: - get-intrinsic: 1.2.2 + get-intrinsic: 1.2.4 gopd: 1.0.1 has-property-descriptors: 1.0.1 + define-data-property@1.1.4: + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + gopd: 1.0.1 + define-properties@1.2.1: dependencies: define-data-property: 1.1.1 @@ -3191,7 +3460,7 @@ snapshots: destroy@1.2.0: {} - devtools-protocol@0.0.1312386: {} + devtools-protocol@0.0.1367902: {} di@0.0.1: {} @@ -3244,6 +3513,8 @@ snapshots: encodeurl@1.0.2: {} + encodeurl@2.0.0: {} + end-of-stream@1.4.4: dependencies: once: 1.4.0 @@ -3259,7 +3530,7 @@ snapshots: base64id: 2.0.0 cookie: 0.4.2 cors: 2.8.5 - debug: 4.3.4 + debug: 4.3.7 engine.io-parser: 5.2.1 ws: 8.11.0 transitivePeerDependencies: @@ -3293,7 +3564,7 @@ snapshots: has-property-descriptors: 1.0.1 has-proto: 1.0.1 has-symbols: 1.0.3 - hasown: 2.0.0 + hasown: 2.0.2 internal-slot: 1.0.6 is-array-buffer: 3.0.2 is-callable: 1.2.7 @@ -3310,7 +3581,7 @@ snapshots: safe-array-concat: 1.0.1 safe-regex-test: 1.0.0 string.prototype.trim: 1.2.8 - string.prototype.trimend: 1.0.7 + string.prototype.trimend: 1.0.8 string.prototype.trimstart: 1.0.7 typed-array-buffer: 1.0.0 typed-array-byte-length: 1.0.0 @@ -3319,15 +3590,80 @@ snapshots: unbox-primitive: 1.0.2 which-typed-array: 1.1.13 + es-abstract@1.23.5: + dependencies: + array-buffer-byte-length: 1.0.1 + arraybuffer.prototype.slice: 1.0.3 + available-typed-arrays: 1.0.7 + call-bind: 1.0.7 + data-view-buffer: 1.0.1 + data-view-byte-length: 1.0.1 + data-view-byte-offset: 1.0.0 + es-define-property: 1.0.0 + es-errors: 1.3.0 + es-object-atoms: 1.0.0 + es-set-tostringtag: 2.0.3 + es-to-primitive: 1.2.1 + function.prototype.name: 1.1.6 + get-intrinsic: 1.2.4 + get-symbol-description: 1.0.2 + globalthis: 1.0.4 + gopd: 1.0.1 + has-property-descriptors: 1.0.2 + has-proto: 1.0.3 + has-symbols: 1.0.3 + hasown: 2.0.2 + internal-slot: 1.0.7 + is-array-buffer: 3.0.4 + is-callable: 1.2.7 + is-data-view: 1.0.1 + is-negative-zero: 2.0.3 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.3 + is-string: 1.0.7 + is-typed-array: 1.1.13 + is-weakref: 1.0.2 + object-inspect: 1.13.3 + object-keys: 1.1.1 + object.assign: 4.1.5 + regexp.prototype.flags: 1.5.3 + safe-array-concat: 1.1.2 + safe-regex-test: 1.0.3 + string.prototype.trim: 1.2.9 + string.prototype.trimend: 1.0.8 + string.prototype.trimstart: 1.0.8 + typed-array-buffer: 1.0.2 + typed-array-byte-length: 1.0.1 + typed-array-byte-offset: 1.0.3 + typed-array-length: 1.0.6 + unbox-primitive: 1.0.2 + which-typed-array: 1.1.15 + + es-define-property@1.0.0: + dependencies: + get-intrinsic: 1.2.4 + + es-errors@1.3.0: {} + + es-object-atoms@1.0.0: + dependencies: + es-errors: 1.3.0 + es-set-tostringtag@2.0.2: dependencies: - get-intrinsic: 1.2.2 + get-intrinsic: 1.2.4 has-tostringtag: 1.0.0 - hasown: 2.0.0 + hasown: 2.0.2 + + es-set-tostringtag@2.0.3: + dependencies: + get-intrinsic: 1.2.4 + has-tostringtag: 1.0.2 + hasown: 2.0.2 es-shim-unscopables@1.0.2: dependencies: - hasown: 2.0.0 + hasown: 2.0.2 es-to-primitive@1.2.1: dependencies: @@ -3358,12 +3694,12 @@ snapshots: eslint-import-resolver-node@0.3.9: dependencies: debug: 3.2.7 - is-core-module: 2.13.1 + is-core-module: 2.15.1 resolve: 1.22.8 transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.0(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): + eslint-module-utils@2.12.0(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: @@ -3372,37 +3708,39 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import@2.29.1(eslint@8.57.0): + eslint-plugin-import@2.31.0(eslint@8.57.0): dependencies: - array-includes: 3.1.7 - array.prototype.findlastindex: 1.2.3 + '@rtsao/scc': 1.1.0 + array-includes: 3.1.8 + array.prototype.findlastindex: 1.2.5 array.prototype.flat: 1.3.2 array.prototype.flatmap: 1.3.2 debug: 3.2.7 doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) - hasown: 2.0.0 - is-core-module: 2.13.1 + eslint-module-utils: 2.12.0(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) + hasown: 2.0.2 + is-core-module: 2.15.1 is-glob: 4.0.3 minimatch: 3.1.2 - object.fromentries: 2.0.7 - object.groupby: 1.0.1 - object.values: 1.1.7 + object.fromentries: 2.0.8 + object.groupby: 1.0.3 + object.values: 1.2.0 semver: 6.3.1 + string.prototype.trimend: 1.0.8 tsconfig-paths: 3.15.0 transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-jasmine@4.2.1: {} + eslint-plugin-jasmine@4.2.2: {} - eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.3.3): + eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.4.0): dependencies: eslint: 8.57.0 - prettier: 3.3.3 + prettier: 3.4.0 prettier-linter-helpers: 1.0.0 synckit: 0.9.1 optionalDependencies: @@ -3427,7 +3765,7 @@ snapshots: '@ungap/structured-clone': 1.2.0 ajv: 6.12.6 chalk: 4.1.2 - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 debug: 4.3.6 doctrine: 3.0.0 escape-string-regexp: 4.0.0 @@ -3488,7 +3826,7 @@ snapshots: execa@5.1.1: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 get-stream: 6.0.1 human-signals: 2.1.0 is-stream: 2.0.1 @@ -3504,7 +3842,7 @@ snapshots: extract-zip@2.0.1: dependencies: - debug: 4.3.6 + debug: 4.3.7 get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -3524,10 +3862,6 @@ snapshots: fast-levenshtein@2.0.6: {} - fast-url-parser@1.1.3: - dependencies: - punycode: 1.4.1 - fastq@1.16.0: dependencies: reusify: 1.0.4 @@ -3536,11 +3870,15 @@ snapshots: dependencies: pend: 1.2.0 + fdir@6.4.2(picomatch@4.0.2): + optionalDependencies: + picomatch: 4.0.2 + file-entry-cache@6.0.1: dependencies: flat-cache: 3.2.0 - fill-range@7.0.1: + fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 @@ -3556,10 +3894,10 @@ snapshots: transitivePeerDependencies: - supports-color - finalhandler@1.2.0: + finalhandler@1.3.1: dependencies: debug: 2.6.9 - encodeurl: 1.0.2 + encodeurl: 2.0.0 escape-html: 1.0.3 on-finished: 2.4.1 parseurl: 1.3.3 @@ -3589,7 +3927,7 @@ snapshots: foreground-child@3.1.1: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 signal-exit: 4.1.0 fresh@0.5.2: {} @@ -3609,9 +3947,9 @@ snapshots: function.prototype.name@1.1.6: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.3 + es-abstract: 1.23.5 functions-have-names: 1.2.3 functions-have-names@1.2.3: {} @@ -3627,6 +3965,14 @@ snapshots: has-symbols: 1.0.3 hasown: 2.0.0 + get-intrinsic@1.2.4: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + has-proto: 1.0.1 + has-symbols: 1.0.3 + hasown: 2.0.2 + get-stream@5.2.0: dependencies: pump: 3.0.0 @@ -3635,14 +3981,20 @@ snapshots: get-symbol-description@1.0.0: dependencies: - call-bind: 1.0.5 - get-intrinsic: 1.2.2 + call-bind: 1.0.7 + get-intrinsic: 1.2.4 + + get-symbol-description@1.0.2: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 get-uri@6.0.2: dependencies: basic-ftp: 5.0.4 data-uri-to-buffer: 6.0.1 - debug: 4.3.6 + debug: 4.3.7 fs-extra: 8.1.0 transitivePeerDependencies: - supports-color @@ -3655,14 +4007,6 @@ snapshots: dependencies: is-glob: 4.0.3 - glob@10.3.10: - dependencies: - foreground-child: 3.1.1 - jackspeak: 2.3.6 - minimatch: 9.0.3 - minipass: 7.0.4 - path-scurry: 1.10.1 - glob@10.4.5: dependencies: foreground-child: 3.1.1 @@ -3689,9 +4033,14 @@ snapshots: dependencies: define-properties: 1.2.1 + globalthis@1.0.4: + dependencies: + define-properties: 1.2.1 + gopd: 1.0.1 + gopd@1.0.1: dependencies: - get-intrinsic: 1.2.2 + get-intrinsic: 1.2.4 graceful-fs@4.2.11: {} @@ -3705,20 +4054,34 @@ snapshots: has-property-descriptors@1.0.1: dependencies: - get-intrinsic: 1.2.2 + get-intrinsic: 1.2.4 + + has-property-descriptors@1.0.2: + dependencies: + es-define-property: 1.0.0 has-proto@1.0.1: {} + has-proto@1.0.3: {} + has-symbols@1.0.3: {} has-tostringtag@1.0.0: dependencies: has-symbols: 1.0.3 + has-tostringtag@1.0.2: + dependencies: + has-symbols: 1.0.3 + hasown@2.0.0: dependencies: function-bind: 1.1.2 + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + he@1.2.0: {} highlight.js@11.10.0: {} @@ -3744,7 +4107,7 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.0 - debug: 4.3.6 + debug: 4.3.7 transitivePeerDependencies: - supports-color @@ -3759,7 +4122,7 @@ snapshots: https-proxy-agent@7.0.4: dependencies: agent-base: 7.1.0 - debug: 4.3.6 + debug: 4.3.7 transitivePeerDependencies: - supports-color @@ -3812,8 +4175,14 @@ snapshots: internal-slot@1.0.6: dependencies: - get-intrinsic: 1.2.2 - hasown: 2.0.0 + get-intrinsic: 1.2.4 + hasown: 2.0.2 + side-channel: 1.0.4 + + internal-slot@1.0.7: + dependencies: + es-errors: 1.3.0 + hasown: 2.0.2 side-channel: 1.0.4 ip@1.1.8: {} @@ -3822,12 +4191,21 @@ snapshots: is-array-buffer@3.0.2: dependencies: - call-bind: 1.0.5 - get-intrinsic: 1.2.2 + call-bind: 1.0.7 + get-intrinsic: 1.2.4 is-typed-array: 1.1.12 + is-array-buffer@3.0.4: + dependencies: + call-bind: 1.0.7 + get-intrinsic: 1.2.4 + is-arrayish@0.2.1: {} + is-async-function@2.0.0: + dependencies: + has-tostringtag: 1.0.2 + is-bigint@1.0.4: dependencies: has-bigints: 1.0.2 @@ -3838,19 +4216,23 @@ snapshots: is-boolean-object@1.1.2: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 has-tostringtag: 1.0.0 - is-builtin-module@3.2.1: - dependencies: - builtin-modules: 3.3.0 - is-callable@1.2.7: {} is-core-module@2.13.1: dependencies: hasown: 2.0.0 + is-core-module@2.15.1: + dependencies: + hasown: 2.0.2 + + is-data-view@1.0.1: + dependencies: + is-typed-array: 1.1.13 + is-date-object@1.0.5: dependencies: has-tostringtag: 1.0.0 @@ -3859,16 +4241,28 @@ snapshots: is-extglob@2.1.1: {} + is-finalizationregistry@1.0.2: + dependencies: + call-bind: 1.0.7 + is-fullwidth-code-point@3.0.0: {} + is-generator-function@1.0.10: + dependencies: + has-tostringtag: 1.0.2 + is-glob@4.0.3: dependencies: is-extglob: 2.1.1 + is-map@2.0.3: {} + is-module@1.0.0: {} is-negative-zero@2.0.2: {} + is-negative-zero@2.0.3: {} + is-number-object@1.0.7: dependencies: has-tostringtag: 1.0.0 @@ -3885,12 +4279,18 @@ snapshots: is-regex@1.1.4: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 has-tostringtag: 1.0.0 + is-set@2.0.3: {} + is-shared-array-buffer@1.0.2: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 + + is-shared-array-buffer@1.0.3: + dependencies: + call-bind: 1.0.7 is-stream@2.0.1: {} @@ -3906,9 +4306,20 @@ snapshots: dependencies: which-typed-array: 1.1.13 + is-typed-array@1.1.13: + dependencies: + which-typed-array: 1.1.15 + + is-weakmap@2.0.2: {} + is-weakref@1.0.2: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 + + is-weakset@2.0.3: + dependencies: + call-bind: 1.0.7 + get-intrinsic: 1.2.4 is-wsl@2.2.0: dependencies: @@ -3922,12 +4333,6 @@ snapshots: isstream@0.1.2: {} - jackspeak@2.3.6: - dependencies: - '@isaacs/cliui': 8.0.2 - optionalDependencies: - '@pkgjs/parseargs': 0.11.0 - jackspeak@3.4.3: dependencies: '@isaacs/cliui': 8.0.2 @@ -3936,12 +4341,12 @@ snapshots: jasmine-core@4.6.0: {} - jasmine-core@5.2.0: {} + jasmine-core@5.4.0: {} - jasmine@5.2.0: + jasmine@5.4.0: dependencies: - glob: 10.3.10 - jasmine-core: 5.2.0 + glob: 10.4.5 + jasmine-core: 5.4.0 js-tokens@4.0.0: {} @@ -3976,9 +4381,9 @@ snapshots: is-wsl: 2.2.0 which: 3.0.1 - karma-jasmine-html-reporter@2.1.0(jasmine-core@5.2.0)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4): + karma-jasmine-html-reporter@2.1.0(jasmine-core@5.4.0)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4): dependencies: - jasmine-core: 5.2.0 + jasmine-core: 5.4.0 karma: 6.4.4 karma-jasmine: 5.1.0(karma@6.4.4) @@ -4001,8 +4406,8 @@ snapshots: karma@6.4.4: dependencies: '@colors/colors': 1.5.0 - body-parser: 1.20.2 - braces: 3.0.2 + body-parser: 1.20.3 + braces: 3.0.3 chokidar: 3.6.0 connect: 3.7.0 di: 0.0.1 @@ -4065,7 +4470,7 @@ snapshots: log4js@6.9.1: dependencies: date-format: 4.0.14 - debug: 4.3.4 + debug: 4.3.7 flatted: 3.2.9 rfdc: 1.3.0 streamroller: 3.1.5 @@ -4074,8 +4479,6 @@ snapshots: lower-case@1.1.4: {} - lru-cache@10.1.0: {} - lru-cache@10.4.3: {} lru-cache@7.18.3: {} @@ -4124,18 +4527,12 @@ snapshots: dependencies: brace-expansion: 1.1.11 - minimatch@9.0.3: - dependencies: - brace-expansion: 2.0.1 - minimatch@9.0.5: dependencies: brace-expansion: 2.0.1 minimist@1.2.8: {} - minipass@7.0.4: {} - minipass@7.1.2: {} mitt@3.0.1: {} @@ -4174,33 +4571,35 @@ snapshots: object-inspect@1.13.1: {} + object-inspect@1.13.3: {} + object-keys@1.1.1: {} object.assign@4.1.5: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 define-properties: 1.2.1 has-symbols: 1.0.3 object-keys: 1.1.1 - object.fromentries@2.0.7: + object.fromentries@2.0.8: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.3 + es-abstract: 1.23.5 + es-object-atoms: 1.0.0 - object.groupby@1.0.1: + object.groupby@1.0.3: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.3 - get-intrinsic: 1.2.2 + es-abstract: 1.23.5 - object.values@1.1.7: + object.values@1.2.0: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.3 + es-object-atoms: 1.0.0 on-finished@2.3.0: dependencies: @@ -4243,7 +4642,7 @@ snapshots: dependencies: '@tootallnate/quickjs-emscripten': 0.23.0 agent-base: 7.1.0 - debug: 4.3.6 + debug: 4.3.7 get-uri: 6.0.2 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.4 @@ -4291,31 +4690,30 @@ snapshots: path-parse@1.0.7: {} - path-scurry@1.10.1: - dependencies: - lru-cache: 10.1.0 - minipass: 7.0.4 - path-scurry@1.11.1: dependencies: lru-cache: 10.4.3 minipass: 7.1.2 - path-to-regexp@2.2.1: {} + path-to-regexp@3.3.0: {} pend@1.2.0: {} picomatch@2.3.1: {} + picomatch@4.0.2: {} + pluralize@8.0.0: {} + possible-typed-array-names@1.0.0: {} + prelude-ls@1.2.1: {} prettier-linter-helpers@1.0.0: dependencies: fast-diff: 1.3.0 - prettier@3.3.3: {} + prettier@3.4.0: {} progress@2.0.3: {} @@ -4330,7 +4728,7 @@ snapshots: proxy-agent@6.4.0: dependencies: agent-base: 7.1.0 - debug: 4.3.6 + debug: 4.3.7 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.4 lru-cache: 7.18.3 @@ -4347,16 +4745,14 @@ snapshots: end-of-stream: 1.4.4 once: 1.4.0 - punycode@1.4.1: {} - punycode@2.3.1: {} - puppeteer-core@23.1.1: + puppeteer-core@23.9.0: dependencies: - '@puppeteer/browsers': 2.3.1 - chromium-bidi: 0.6.4(devtools-protocol@0.0.1312386) - debug: 4.3.6 - devtools-protocol: 0.0.1312386 + '@puppeteer/browsers': 2.4.1 + chromium-bidi: 0.8.0(devtools-protocol@0.0.1367902) + debug: 4.3.7 + devtools-protocol: 0.0.1367902 typed-query-selector: 2.12.0 ws: 8.18.0 transitivePeerDependencies: @@ -4364,13 +4760,13 @@ snapshots: - supports-color - utf-8-validate - puppeteer@23.1.1(typescript@5.5.4): + puppeteer@23.9.0(typescript@5.7.2): dependencies: - '@puppeteer/browsers': 2.3.1 - chromium-bidi: 0.6.4(devtools-protocol@0.0.1312386) - cosmiconfig: 9.0.0(typescript@5.5.4) - devtools-protocol: 0.0.1312386 - puppeteer-core: 23.1.1 + '@puppeteer/browsers': 2.4.1 + chromium-bidi: 0.8.0(devtools-protocol@0.0.1367902) + cosmiconfig: 9.0.0(typescript@5.7.2) + devtools-protocol: 0.0.1367902 + puppeteer-core: 23.9.0 typed-query-selector: 2.12.0 transitivePeerDependencies: - bufferutil @@ -4380,9 +4776,9 @@ snapshots: qjobs@1.2.0: {} - qs@6.11.0: + qs@6.13.0: dependencies: - side-channel: 1.0.4 + side-channel: 1.0.6 queue-microtask@1.2.3: {} @@ -4418,12 +4814,31 @@ snapshots: dependencies: picomatch: 2.3.1 + readdirp@4.0.2: {} + + reflect.getprototypeof@1.0.6: + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.5 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + globalthis: 1.0.4 + which-builtin-type: 1.1.4 + regexp.prototype.flags@1.5.1: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 define-properties: 1.2.1 set-function-name: 2.0.1 + regexp.prototype.flags@1.5.3: + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-errors: 1.3.0 + set-function-name: 2.0.2 + registry-auth-token@3.3.2: dependencies: rc: 1.2.8 @@ -4464,36 +4879,38 @@ snapshots: dependencies: glob: 7.2.3 - rollup-plugin-minify-html-literals@1.2.6(rollup@4.21.0): + rollup-plugin-minify-html-literals@1.2.6(rollup@4.27.4): dependencies: minify-html-literals: 1.3.5 - rollup: 4.21.0 + rollup: 4.27.4 rollup-pluginutils: 2.8.2 rollup-pluginutils@2.8.2: dependencies: estree-walker: 0.6.1 - rollup@4.21.0: + rollup@4.27.4: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.21.0 - '@rollup/rollup-android-arm64': 4.21.0 - '@rollup/rollup-darwin-arm64': 4.21.0 - '@rollup/rollup-darwin-x64': 4.21.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.21.0 - '@rollup/rollup-linux-arm-musleabihf': 4.21.0 - '@rollup/rollup-linux-arm64-gnu': 4.21.0 - '@rollup/rollup-linux-arm64-musl': 4.21.0 - '@rollup/rollup-linux-powerpc64le-gnu': 4.21.0 - '@rollup/rollup-linux-riscv64-gnu': 4.21.0 - '@rollup/rollup-linux-s390x-gnu': 4.21.0 - '@rollup/rollup-linux-x64-gnu': 4.21.0 - '@rollup/rollup-linux-x64-musl': 4.21.0 - '@rollup/rollup-win32-arm64-msvc': 4.21.0 - '@rollup/rollup-win32-ia32-msvc': 4.21.0 - '@rollup/rollup-win32-x64-msvc': 4.21.0 + '@rollup/rollup-android-arm-eabi': 4.27.4 + '@rollup/rollup-android-arm64': 4.27.4 + '@rollup/rollup-darwin-arm64': 4.27.4 + '@rollup/rollup-darwin-x64': 4.27.4 + '@rollup/rollup-freebsd-arm64': 4.27.4 + '@rollup/rollup-freebsd-x64': 4.27.4 + '@rollup/rollup-linux-arm-gnueabihf': 4.27.4 + '@rollup/rollup-linux-arm-musleabihf': 4.27.4 + '@rollup/rollup-linux-arm64-gnu': 4.27.4 + '@rollup/rollup-linux-arm64-musl': 4.27.4 + '@rollup/rollup-linux-powerpc64le-gnu': 4.27.4 + '@rollup/rollup-linux-riscv64-gnu': 4.27.4 + '@rollup/rollup-linux-s390x-gnu': 4.27.4 + '@rollup/rollup-linux-x64-gnu': 4.27.4 + '@rollup/rollup-linux-x64-musl': 4.27.4 + '@rollup/rollup-win32-arm64-msvc': 4.27.4 + '@rollup/rollup-win32-ia32-msvc': 4.27.4 + '@rollup/rollup-win32-x64-msvc': 4.27.4 fsevents: 2.3.3 run-parallel@1.2.0: @@ -4506,8 +4923,15 @@ snapshots: safe-array-concat@1.0.1: dependencies: - call-bind: 1.0.5 - get-intrinsic: 1.2.2 + call-bind: 1.0.7 + get-intrinsic: 1.2.4 + has-symbols: 1.0.3 + isarray: 2.0.5 + + safe-array-concat@1.1.2: + dependencies: + call-bind: 1.0.7 + get-intrinsic: 1.2.4 has-symbols: 1.0.3 isarray: 2.0.5 @@ -4517,8 +4941,14 @@ snapshots: safe-regex-test@1.0.0: dependencies: - call-bind: 1.0.5 - get-intrinsic: 1.2.2 + call-bind: 1.0.7 + get-intrinsic: 1.2.4 + is-regex: 1.1.4 + + safe-regex-test@1.0.3: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 is-regex: 1.1.4 safer-buffer@2.1.2: {} @@ -4527,7 +4957,7 @@ snapshots: semver@7.6.3: {} - send@0.18.0: + send@0.19.0: dependencies: debug: 2.6.9 depd: 2.0.0 @@ -4549,27 +4979,26 @@ snapshots: dependencies: randombytes: 2.1.0 - serve-handler@6.1.5: + serve-handler@6.1.6: dependencies: bytes: 3.0.0 content-disposition: 0.5.2 - fast-url-parser: 1.1.3 mime-types: 2.1.18 minimatch: 3.1.2 path-is-inside: 1.0.2 - path-to-regexp: 2.2.1 + path-to-regexp: 3.3.0 range-parser: 1.2.0 - serve-static@1.15.0: + serve-static@1.16.2: dependencies: - encodeurl: 1.0.2 + encodeurl: 2.0.0 escape-html: 1.0.3 parseurl: 1.3.3 - send: 0.18.0 + send: 0.19.0 transitivePeerDependencies: - supports-color - serve@14.2.3: + serve@14.2.4: dependencies: '@zeit/schemas': 2.36.0 ajv: 8.12.0 @@ -4580,7 +5009,7 @@ snapshots: clipboardy: 3.0.0 compression: 1.7.4 is-port-reachable: 4.0.0 - serve-handler: 6.1.5 + serve-handler: 6.1.6 update-check: 1.5.4 transitivePeerDependencies: - supports-color @@ -4588,16 +5017,32 @@ snapshots: set-function-length@1.1.1: dependencies: define-data-property: 1.1.1 - get-intrinsic: 1.2.2 + get-intrinsic: 1.2.4 gopd: 1.0.1 has-property-descriptors: 1.0.1 + set-function-length@1.2.2: + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + gopd: 1.0.1 + has-property-descriptors: 1.0.2 + set-function-name@2.0.1: dependencies: define-data-property: 1.1.1 functions-have-names: 1.2.3 has-property-descriptors: 1.0.1 + set-function-name@2.0.2: + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + functions-have-names: 1.2.3 + has-property-descriptors: 1.0.2 + setprototypeof@1.2.0: {} shebang-command@2.0.0: @@ -4608,16 +5053,21 @@ snapshots: side-channel@1.0.4: dependencies: - call-bind: 1.0.5 - get-intrinsic: 1.2.2 - object-inspect: 1.13.1 + call-bind: 1.0.7 + get-intrinsic: 1.2.4 + object-inspect: 1.13.3 + + side-channel@1.0.6: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + object-inspect: 1.13.3 signal-exit@3.0.7: {} signal-exit@4.1.0: {} - slash@4.0.0: {} - smart-buffer@4.2.0: {} smob@1.4.1: {} @@ -4634,7 +5084,7 @@ snapshots: socket.io-parser@4.2.4: dependencies: '@socket.io/component-emitter': 3.1.0 - debug: 4.3.4 + debug: 4.3.7 transitivePeerDependencies: - supports-color @@ -4643,7 +5093,7 @@ snapshots: accepts: 1.3.8 base64id: 2.0.0 cors: 2.8.5 - debug: 4.3.4 + debug: 4.3.7 engine.io: 6.5.4 socket.io-adapter: 2.5.2 socket.io-parser: 4.2.4 @@ -4655,7 +5105,7 @@ snapshots: socks-proxy-agent@8.0.2: dependencies: agent-base: 7.1.0 - debug: 4.3.6 + debug: 4.3.7 socks: 2.7.1 transitivePeerDependencies: - supports-color @@ -4683,7 +5133,7 @@ snapshots: streamroller@3.1.5: dependencies: date-format: 4.0.14 - debug: 4.3.4 + debug: 4.3.7 fs-extra: 8.1.0 transitivePeerDependencies: - supports-color @@ -4713,22 +5163,35 @@ snapshots: string.prototype.trim@1.2.8: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.22.3 - string.prototype.trimend@1.0.7: + string.prototype.trim@1.2.9: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.3 + es-abstract: 1.23.5 + es-object-atoms: 1.0.0 + + string.prototype.trimend@1.0.8: + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 string.prototype.trimstart@1.0.7: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.22.3 + string.prototype.trimstart@1.0.8: + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + strip-ansi@4.0.0: dependencies: ansi-regex: 3.0.1 @@ -4825,36 +5288,69 @@ snapshots: typed-array-buffer@1.0.0: dependencies: - call-bind: 1.0.5 - get-intrinsic: 1.2.2 + call-bind: 1.0.7 + get-intrinsic: 1.2.4 is-typed-array: 1.1.12 + typed-array-buffer@1.0.2: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-typed-array: 1.1.13 + typed-array-byte-length@1.0.0: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 for-each: 0.3.3 has-proto: 1.0.1 is-typed-array: 1.1.12 + typed-array-byte-length@1.0.1: + dependencies: + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-proto: 1.0.3 + is-typed-array: 1.1.13 + typed-array-byte-offset@1.0.0: dependencies: available-typed-arrays: 1.0.5 - call-bind: 1.0.5 + call-bind: 1.0.7 for-each: 0.3.3 has-proto: 1.0.1 is-typed-array: 1.1.12 + typed-array-byte-offset@1.0.3: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-proto: 1.0.3 + is-typed-array: 1.1.13 + reflect.getprototypeof: 1.0.6 + typed-array-length@1.0.4: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 for-each: 0.3.3 is-typed-array: 1.1.12 + typed-array-length@1.0.6: + dependencies: + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-proto: 1.0.3 + is-typed-array: 1.1.13 + possible-typed-array-names: 1.0.0 + typed-query-selector@2.12.0: {} typescript@4.9.5: {} - typescript@5.5.4: {} + typescript@5.7.2: {} ua-parser-js@0.7.37: {} @@ -4866,7 +5362,7 @@ snapshots: unbox-primitive@1.0.2: dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 has-bigints: 1.0.2 has-symbols: 1.0.3 which-boxed-primitive: 1.0.2 @@ -4899,7 +5395,7 @@ snapshots: vary@1.1.2: {} - vnu-jar@23.4.11: {} + vnu-jar@24.10.17: {} void-elements@2.0.1: {} @@ -4913,14 +5409,44 @@ snapshots: is-string: 1.0.7 is-symbol: 1.0.4 + which-builtin-type@1.1.4: + dependencies: + function.prototype.name: 1.1.6 + has-tostringtag: 1.0.2 + is-async-function: 2.0.0 + is-date-object: 1.0.5 + is-finalizationregistry: 1.0.2 + is-generator-function: 1.0.10 + is-regex: 1.1.4 + is-weakref: 1.0.2 + isarray: 2.0.5 + which-boxed-primitive: 1.0.2 + which-collection: 1.0.2 + which-typed-array: 1.1.15 + + which-collection@1.0.2: + dependencies: + is-map: 2.0.3 + is-set: 2.0.3 + is-weakmap: 2.0.2 + is-weakset: 2.0.3 + which-typed-array@1.1.13: dependencies: available-typed-arrays: 1.0.5 - call-bind: 1.0.5 + call-bind: 1.0.7 for-each: 0.3.3 gopd: 1.0.1 has-tostringtag: 1.0.0 + which-typed-array@1.1.15: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.2 + which@1.3.1: dependencies: isexe: 2.0.0 diff --git a/src/core/before-save.js b/src/core/before-save.js index a2d58c10e7..e79d8a6515 100644 --- a/src/core/before-save.js +++ b/src/core/before-save.js @@ -38,8 +38,7 @@ function performTransformations(transforms, doc) { const nameOrPosition = `\`${fn.name}\`` || `at position ${pos}`; const msg = docLink`Function ${nameOrPosition}\` threw an error during processing of ${"[beforeSave]"}.`; const hint = "See developer console."; - showError(msg, name, { hint }); - console.error(err); + showError(msg, name, { hint, cause: err }); } finally { pos++; } diff --git a/src/core/caniuse.js b/src/core/caniuse.js index 7b4ad3b5a7..5d7f36612c 100644 --- a/src/core/caniuse.js +++ b/src/core/caniuse.js @@ -103,8 +103,7 @@ export async function run(conf) { function handleError(err, options, featureURL) { const msg = `Failed to retrieve feature "${options.feature}".`; const hint = docLink`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${"[caniuse]"}.`; - showError(msg, name, { hint }); - console.error(err); + showError(msg, name, { hint, cause: err }); return html`<a href="${featureURL}">caniuse.com</a>`; } diff --git a/src/core/contrib.js b/src/core/contrib.js index 0bd6673b89..621dd43a28 100644 --- a/src/core/contrib.js +++ b/src/core/contrib.js @@ -60,8 +60,7 @@ async function showContributors(editors, apiURL) { ); } catch (error) { const msg = "Error loading contributors from GitHub."; - showError(msg, name); - console.error(error); + showError(msg, name, { cause: error }); return null; } } diff --git a/src/core/custom-elements/rs-changelog.js b/src/core/custom-elements/rs-changelog.js index dd477328da..26d77aa908 100644 --- a/src/core/custom-elements/rs-changelog.js +++ b/src/core/custom-elements/rs-changelog.js @@ -34,7 +34,9 @@ export const element = class ChangelogElement extends HTMLElement { ${{ any: fetchCommits(from, to, filter) .then(commits => toHTML(commits)) - .catch(error => showError(error.message, name, { elements: [this] })) + .catch(error => + showError(error.message, name, { elements: [this], cause: error }) + ) .finally(() => { this.dispatchEvent(new CustomEvent("done")); }), @@ -70,8 +72,7 @@ async function fetchCommits(from, to, filter) { commits = commits.filter(filter); } catch (error) { const msg = `Error loading commits from GitHub. ${error.message}`; - console.error(error); - throw new Error(msg); + throw new Error(msg, { cause: error }); } return commits; } diff --git a/src/core/data-include.js b/src/core/data-include.js index 49d4f1222f..55ffa0dbee 100644 --- a/src/core/data-include.js +++ b/src/core/data-include.js @@ -102,8 +102,7 @@ async function runIncludes(root, currentDepth) { } } catch (err) { const msg = `\`data-include\` failed: \`${url}\` (${err.message}).`; - console.error(msg, el, err); - showError(msg, name, { elements: [el] }); + showError(msg, name, { elements: [el], cause: err }); } }); await Promise.all(promisesToInclude); diff --git a/src/core/dfn-index.js b/src/core/dfn-index.js index 03626f8bd4..573718e525 100644 --- a/src/core/dfn-index.js +++ b/src/core/dfn-index.js @@ -224,7 +224,9 @@ function getLocalTermSuffix(dfn, type, term = "") { function appendSectionNumbers() { const getSectionNumber = id => { const dfn = document.getElementById(id); - const sectionNumberEl = dfn.closest("section").querySelector(".secno"); + const sectionNumberEl = dfn + .closest("section:not(.notoc)") + .querySelector(".secno"); const secNum = `Ā§${sectionNumberEl.textContent.trim()}`; return html`<span class="print-only">${secNum}</span>`; }; @@ -275,7 +277,7 @@ function collectExternalTerms() { continue; } - const { type, linkFor } = elem.dataset; + const { linkType: type, linkFor } = elem.dataset; const term = getTermFromElement(elem); if (!term) { continue; // <a data-cite="SPEC"></a> diff --git a/src/core/post-process.js b/src/core/post-process.js index ad4a4ae338..20d0fc53f3 100644 --- a/src/core/post-process.js +++ b/src/core/post-process.js @@ -32,8 +32,7 @@ export async function run(config) { } catch (err) { const msg = `Function ${f.name} threw an error during \`postProcess\`.`; const hint = "See developer console."; - showError(msg, name, { hint }); - console.error(err); + showError(msg, name, { hint, cause: err }); } }); await Promise.all(promises); diff --git a/src/core/pre-process.js b/src/core/pre-process.js index 5eb830a721..b9a389f920 100644 --- a/src/core/pre-process.js +++ b/src/core/pre-process.js @@ -31,8 +31,7 @@ export async function run(config) { } catch (err) { const msg = `Function ${f.name} threw an error during \`preProcess\`.`; const hint = "See developer console."; - showError(msg, name, { hint }); - console.error(err); + showError(msg, name, { hint, cause: err }); } }); await Promise.all(promises); diff --git a/src/core/pubsubhub.js b/src/core/pubsubhub.js index 230dd0630d..014ac0cd87 100644 --- a/src/core/pubsubhub.js +++ b/src/core/pubsubhub.js @@ -8,6 +8,7 @@ export const name = "core/pubsubhub"; import { expose } from "./expose-modules.js"; +import { showError } from "./utils.js"; const subscriptions = new EventTarget(); @@ -36,7 +37,15 @@ export function pub(topic, detail) { * used for unsubscribing from messages. */ export function sub(topic, cb, options = { once: false }) { - const listener = e => cb(e.detail); + /** @param {CustomEvent} ev */ + const listener = async ev => { + try { + await cb(ev.detail); + } catch (error) { + const msg = `Error in handler for topic "${topic}": ${error.message}`; + showError(msg, `sub:${topic}`, { cause: error }); + } + }; subscriptions.addEventListener(topic, listener, options); } diff --git a/src/core/render-biblio.js b/src/core/render-biblio.js index 06412a7212..76ae3f7ec3 100644 --- a/src/core/render-biblio.js +++ b/src/core/render-biblio.js @@ -232,7 +232,7 @@ function stringifyReference(ref) { if (ref.authors && ref.authors.length) { output += ref.authors.join("; "); if (ref.etAl) output += " et al"; - output += ". "; + if (!output.endsWith(".")) output += ". "; } if (ref.publisher) { output = `${output} ${endWithDot(ref.publisher)} `; diff --git a/src/core/utils.js b/src/core/utils.js index 373e7fc66b..5cd3fb622e 100644 --- a/src/core/utils.js +++ b/src/core/utils.js @@ -294,8 +294,7 @@ export function runTransforms(content, flist, ...funcArgs) { } catch (e) { const msg = `call to \`${meth}()\` failed with: ${e}.`; const hint = "See developer console for stack trace."; - showWarning(msg, "utils/runTransforms", { hint }); - console.error(e); + showWarning(msg, "utils/runTransforms", { hint, cause: e }); } } } @@ -850,7 +849,7 @@ export class RespecError extends Error { * @param {Parameters<typeof showError>[2] & { isWarning: boolean }} options */ constructor(message, plugin, options) { - super(message); + super(message, { ...(options.cause && { cause: options.cause }) }); const name = options.isWarning ? "ReSpecWarning" : "ReSpecError"; Object.assign(this, { message, plugin, name, ...options }); if (options.elements) { @@ -864,7 +863,23 @@ export class RespecError extends Error { const { message, name, stack } = this; // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792 const { plugin, hint, elements, title, details } = this; - return { message, name, plugin, hint, elements, title, details, stack }; + return { + message, + name, + plugin, + hint, + elements, + title, + details, + stack, + ...(this.cause instanceof Error && { + cause: { + name: this.cause.name, + message: this.cause.message, + stack: this.cause.stack, + }, + }), + }; } } @@ -876,6 +891,7 @@ export class RespecError extends Error { * @param {HTMLElement[]} [options.elements] Offending elements. * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message. * @param {string} [options.details] Any further details/context. + * @param {Error} [options.cause] The error that caused this one. */ export function showError(message, pluginName, options = {}) { const opts = { ...options, isWarning: false }; @@ -890,6 +906,7 @@ export function showError(message, pluginName, options = {}) { * @param {HTMLElement[]} [options.elements] Offending elements. * @param {string} [options.title] Title attribute for offending elements. Can be a shorter form of the message. * @param {string} [options.details] Any further details/context. + * @param {Error} [options.cause] The error that caused this one. */ export function showWarning(message, pluginName, options = {}) { const opts = { ...options, isWarning: true }; diff --git a/src/core/xref.js b/src/core/xref.js index 6bc80ea7f4..9e4c5af886 100644 --- a/src/core/xref.js +++ b/src/core/xref.js @@ -405,7 +405,7 @@ function addDataCite(elem, query, result, conf) { // a filename. That filename must be preserved if there's no specific path. if (citePath === "/") citePath = ""; const citeFrag = url.hash.slice(1); - const dataset = { cite, citePath, citeFrag, type }; + const dataset = { cite, citePath, citeFrag, linkType: type }; if (forContext) dataset.linkFor = forContext[0]; if (url.origin && url.origin !== "https://partial") { dataset.citeHref = url.href; diff --git a/src/jsconfig.json b/src/jsconfig.json index 248cbb30e2..d63e4b2e55 100644 --- a/src/jsconfig.json +++ b/src/jsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { - "target": "es2019", + "target": "es2022", "moduleResolution": "node", "noImplicitThis": true, - "module": "es2020" + "module": "es2022" } } diff --git a/tests/spec/core/biblio-spec.js b/tests/spec/core/biblio-spec.js index 6c30c5d73f..381ce7fa25 100644 --- a/tests/spec/core/biblio-spec.js +++ b/tests/spec/core/biblio-spec.js @@ -18,7 +18,7 @@ describe("W3C ā€” Bibliographic References", () => { TestRef1: { title: "Test ref title", href: "http://test.com", - authors: ["William Shakespeare"], + authors: ["William Shakespeare Jr."], publisher: "Publishers Inc.", }, TestRef2: { @@ -79,6 +79,11 @@ describe("W3C ā€” Bibliographic References", () => { expect(ref.textContent.trim()).toBe( "evercookie - virtually irrevocable persistent cookies. Samy Kamkar. September 2010. URL: https://samy.pl/evercookie/" ); + + const refWithPeriodInEnd = doc.querySelector("#bib-testref1 + dd"); + expect(refWithPeriodInEnd.textContent.trim()).toBe( + "Test ref title. William Shakespeare Jr. Publishers Inc. URL: http://test.com" + ); }); it("pings biblio service to see if it's running", () => { diff --git a/tests/spec/core/inlines-spec.js b/tests/spec/core/inlines-spec.js index a08815174c..ed8b132daf 100644 --- a/tests/spec/core/inlines-spec.js +++ b/tests/spec/core/inlines-spec.js @@ -623,7 +623,7 @@ describe("Core - Inlines", () => { expect(primitiveAnchor.hash).toBe("#idl-unsigned-short"); const primitiveData = primitiveAnchor.dataset; - expect(primitiveData.linkType).toBe("idl"); + expect(primitiveData.linkType).toBe("interface"); expect(primitiveData.cite).toBe("webidl"); expect(primitiveData.xrefType).toBe("interface"); expect(primitiveData.lt).toBe("unsigned short"); diff --git a/tests/spec/core/xref-spec.js b/tests/spec/core/xref-spec.js index 0c13a7338f..1cfaabf0ac 100644 --- a/tests/spec/core/xref-spec.js +++ b/tests/spec/core/xref-spec.js @@ -77,6 +77,7 @@ describe("Core ā€” xref", () => { expect(link.href).toBe( "https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" ); + expect(link.dataset.linkType).toBe("dfn"); expect(link.classList.contains("respec-offending-element")).toBeFalsy(); const dfn = doc.querySelector("#external-dfn dfn a"); diff --git a/tools/respec2html.js b/tools/respec2html.js index 6aa53ddf66..931217c94b 100755 --- a/tools/respec2html.js +++ b/tools/respec2html.js @@ -90,15 +90,32 @@ class Logger { /** @param {import("./respecDocWriter").ReSpecError} rsError */ _printDetails(rsError) { + const shouldPrintStacktrace = this._shouldPrintStacktrace(rsError); const print = (title, value) => { if (!value) return; - const padWidth = "Plugin".length + 1; // "Plugin" is the longest title + const longestTitle = shouldPrintStacktrace ? "Stacktrace" : "Plugin"; + const padWidth = longestTitle.length + 1; const paddedTitle = `${title}:`.padStart(padWidth); console.error(" ", colors.bold(paddedTitle), this._formatMarkdown(value)); }; print("Count", rsError.elements && String(rsError.elements.length)); print("Plugin", rsError.plugin); print("Hint", rsError.hint); + if (shouldPrintStacktrace) { + let stacktrace = `${rsError.stack}`; + if (rsError.cause) { + stacktrace += `\n ${colors.bold("Caused by:")} ${rsError.cause.stack.split("\n").join("\n ")}`; + } + print("Stacktrace", stacktrace); + } + } + + _shouldPrintStacktrace(rsError) { + return ( + this.verbose && + !!rsError.stack && + (!!rsError.cause?.stack || rsError.plugin === "unknown") + ); } } diff --git a/tools/respecDocWriter.js b/tools/respecDocWriter.js index 0f4dae4f1e..e0454eb9c0 100644 --- a/tools/respecDocWriter.js +++ b/tools/respecDocWriter.js @@ -309,6 +309,25 @@ function handleConsoleMessages(page, onError, onWarning) { if (typeof obj === "string") { // Old ReSpec versions might report errors as strings. return JSON.stringify({ message: String(obj) }); + } else if (obj instanceof Error && !obj.plugin) { + let cause; + if (obj.cause instanceof Error) { + cause = { + name: obj.cause.name, + message: obj.cause.message, + stack: obj.cause.stack, + }; + } + return JSON.stringify({ + message: obj.message, + plugin: "unknown", + name: obj.name, + cause, + stack: obj.stack?.replace( + obj.message, + `${obj.message.slice(0, 30)}ā€¦` + ), + }); } else { // Ideally: `obj instanceof RsError` and `RsError instanceof Error`. return JSON.stringify(obj); @@ -335,6 +354,7 @@ function handleConsoleMessages(page, onError, onWarning) { switch (type) { case "error": return onError(JSON.parse(text)); + case "warn": case "warning": return onWarning(JSON.parse(text)); }