From 015f44b50c6b8eabc6ae2ddce509240d1c0dae33 Mon Sep 17 00:00:00 2001 From: Xavi Aracil Date: Wed, 3 Jul 2024 18:06:36 +0200 Subject: [PATCH] Build respec-1edtech --- builds/respec-1edtech.js | 690 ++++++++++++++++++----------------- builds/respec-1edtech.js.map | 2 +- 2 files changed, 363 insertions(+), 329 deletions(-) diff --git a/builds/respec-1edtech.js b/builds/respec-1edtech.js index 37418de1ab..34ced503bd 100644 --- a/builds/respec-1edtech.js +++ b/builds/respec-1edtech.js @@ -1,13 +1,22 @@ -window.respecVersion="26.16.1",function(){"use strict";const e=!!window.require;if(!e){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 t(t,n){e||(window.require.modules[t]=n)}const n=document.documentElement;n&&!n.hasAttribute("lang")&&(n.lang="en",n.hasAttribute("dir")||(n.dir="ltr"));const r={},o=n.lang;var i=Object.freeze({__proto__:null,name:"core/l10n",l10n:r,lang:o,run:function(e){e.l10n=r[o]||r.en}});let a,s;const c=new WeakMap,l=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return l.get(e);if("objectStoreNames"===t)return e.objectStoreNames||d.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return g(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){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(s||(s=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(b(this),t),g(c.get(this))}:function(...t){return g(e.apply(b(this),t))}:function(t,...n){const r=e.call(b(this),t,...n);return d.set(r,t.sort?t.sort():[t]),g(r)}}function m(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(l.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{t(),r()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)}));l.set(e,t)}(e),t=e,(a||(a=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,f):e);var t}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(g(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)}));return t.then((t=>{t instanceof IDBCursor&&c.set(t,e)})).catch((()=>{})),p.set(t,e),t}(e);if(u.has(e))return u.get(e);const t=m(e);return t!==e&&(u.set(e,t),p.set(t,e)),t}const b=e=>p.get(e);const y=["get","getKey","getAll","getAllKeys","count"],w=["put","add","delete","clear"],v=new Map;function $(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(v.get(t))return v.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=w.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!y.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let a=i.store;return r&&(a=a.index(t.shift())),(await Promise.all([a[n](...t),o&&i.done]))[0]};return v.set(t,i),i}f=(e=>({...e,get:(t,n,r)=>$(t,n)||e.get(t,n,r),has:(t,n)=>!!$(t,n)||e.has(t,n)}))(f);var x=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(()=>t())),g(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const a=indexedDB.open(e,t),s=g(a);return r&&a.addEventListener("upgradeneeded",(e=>{r(g(a.result),e.oldVersion,e.newVersion,g(a.transaction))})),n&&a.addEventListener("blocked",(()=>n())),s.then((e=>{i&&e.addEventListener("close",(()=>i())),o&&e.addEventListener("versionchange",(()=>o()))})).catch((()=>{})),s},unwrap:b,wrap:g});const k=/^[!#$%&'*+-.^`|~\w]+$/,E=/[\u000A\u000D\u0009\u0020]/u,_=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function A(e,t,n){(t&&""!==t&&!e.has(t)&&_.test(n)||null===n)&&e.set(t.toLowerCase(),n)}var S={exports:{}},C={exports:{}};function T(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}C.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:T,changeDefaults:function(e){C.exports.defaults=e}};const L=/[&<>"']/,N=/[&<>"']/g,R=/[<>"']|&(?!#?\w+;)/,I=/[<>"']|&(?!#?\w+;)/g,O={"&":"&","<":"<",">":">",'"':""","'":"'"},P=e=>O[e];const j=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function D(e){return e.replace(j,((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;const M=/[^\w:]/g,q=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const F={},U=/^[^:]+:\/*[^/]*$/,B=/^([^:]+:)[\s\S]*$/,H=/^([^:]+:\/*[^/]*)[\s\S]*$/;function W(e,t){F[" "+e]||(U.test(e)?F[" "+e]=e+"/":F[" "+e]=V(e,"/",!0));const n=-1===(e=F[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(B,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(H,"$1")+t:e+t}function V(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o(r=(r=r.source||r).replace(z,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(D(n)).replace(M,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!q.test(n)&&(n=W(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:W,noopTest:{exec:function(){}},merge:function(e){let t,n,r=1;for(;r{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[n.length-1].trim()||n.pop(),n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}};const{defaults:Z}=C.exports,{rtrim:G,splitCells:X,escape:K,findClosingBracket:J}=Y;function Q(e,t,n,r){const o=t.href,i=t.title?K(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a,[])};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:i,text:K(a)}}var ee=class{constructor(e){this.options=e||Z}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}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():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())}const n={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}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){const e=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,i,a,s,c,l,d,u,p=t[1].trim();const f=p.length>1,h={type:"list",raw:"",ordered:f,start:f?+p.slice(0,-1):"",loose:!1,items:[]};p=f?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=f?p:"[*+-]");const m=new RegExp(`^( {0,3}${p})((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))`);for(;e&&!this.rules.block.hr.test(e)&&(t=m.exec(e));){d=t[2].split("\n"),this.options.pedantic?(i=2,u=d[0].trimLeft()):(i=t[2].search(/[^ ]/),i=t[1].length+(i>4?1:i),u=d[0].slice(i-t[1].length)),s=!1,n=t[0],!d[0]&&/^ *$/.test(d[1])&&(n=t[1]+d.slice(0,2).join("\n")+"\n",h.loose=!0,d=[]);const p=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(a=1;a=i)&&l.trim()){n=t[1]+d.slice(0,a).join("\n")+"\n";break}u+="\n"+l.slice(i)}else l.trim()||(s=!0),l.search(/[^ ]/)>=i?u+="\n"+l.slice(i):u+="\n"+l}h.loose||(c?h.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(u),r&&(o="[ ] "!==r[0],u=u.replace(/^\[[ xX]\] +/,""))),h.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:u}),h.raw+=n,e=e.slice(n.length)}h.items[h.items.length-1].raw=n.trimRight(),h.items[h.items.length-1].text=u.trimRight(),h.raw=h.raw.trimRight();const g=h.items.length;for(a=0;a"space"===e.type))&&(h.loose=!0,h.items[a].loose=!0);return h}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):K(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));return{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:X(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,i,a=e.align.length;for(n=0;n({text:e})));for(a=e.header.length,r=0;r/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:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):K(t[0]):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=G(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=J(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(e)?n.slice(1):n.slice(1,-1)),Q(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$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))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Q(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,i,a=n,s=0;const c="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;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(i=o.length,r[3]||r[4]){a+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){s+=i;continue}if(a-=i,a>0)continue;if(i=Math.min(i,i+a+s),Math.min(n,i)%2){const t=e.slice(1,n+r.index+i);return{type:"em",raw:e.slice(0,n+r.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,n+r.index+i-1);return{type:"strong",raw:e.slice(0,n+r.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}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,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=K(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=K(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=K(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=K(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):K(n[0]):n[0]:K(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}};const{noopTest:te,edit:ne,merge:re}=Y,oe={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {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|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:te,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};oe.def=ne(oe.def).replace("label",oe._label).replace("title",oe._title).getRegex(),oe.bullet=/(?:[*+-]|\d{1,9}[.)])/,oe.listItemStart=ne(/^( *)(bull) */).replace("bull",oe.bullet).getRegex(),oe.list=ne(oe.list).replace(/bull/g,oe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+oe.def.source+")").getRegex(),oe._tag="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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",oe._comment=/|$)/,oe.html=ne(oe.html,"i").replace("comment",oe._comment).replace("tag",oe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oe.paragraph=ne(oe._paragraph).replace("hr",oe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").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",oe._tag).getRegex(),oe.blockquote=ne(oe.blockquote).replace("paragraph",oe.paragraph).getRegex(),oe.normal=re({},oe),oe.gfm=re({},oe.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),oe.gfm.table=ne(oe.gfm.table).replace("hr",oe.hr).replace("heading"," {0,3}#{1,6} ").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",oe._tag).getRegex(),oe.pedantic=re({},oe.normal,{html:ne("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",oe._comment).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:te,paragraph:ne(oe.normal._paragraph).replace("hr",oe.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",oe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const ie={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:te,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:te,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};ie.punctuation=ne(ie.punctuation).replace(/punctuation/g,ie._punctuation).getRegex(),ie.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,ie.escapedEmSt=/\\\*|\\_/g,ie._comment=ne(oe._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),ie.emStrong.lDelim=ne(ie.emStrong.lDelim).replace(/punct/g,ie._punctuation).getRegex(),ie.emStrong.rDelimAst=ne(ie.emStrong.rDelimAst,"g").replace(/punct/g,ie._punctuation).getRegex(),ie.emStrong.rDelimUnd=ne(ie.emStrong.rDelimUnd,"g").replace(/punct/g,ie._punctuation).getRegex(),ie._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ie._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ie._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])?)+(?![-_])/,ie.autolink=ne(ie.autolink).replace("scheme",ie._scheme).replace("email",ie._email).getRegex(),ie._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ie.tag=ne(ie.tag).replace("comment",ie._comment).replace("attribute",ie._attribute).getRegex(),ie._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ie._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ie._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ie.link=ne(ie.link).replace("label",ie._label).replace("href",ie._href).replace("title",ie._title).getRegex(),ie.reflink=ne(ie.reflink).replace("label",ie._label).getRegex(),ie.reflinkSearch=ne(ie.reflinkSearch,"g").replace("reflink",ie.reflink).replace("nolink",ie.nolink).getRegex(),ie.normal=re({},ie),ie.pedantic=re({},ie.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:ne(/^!?\[(label)\]\((.*?)\)/).replace("label",ie._label).getRegex(),reflink:ne(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ie._label).getRegex()}),ie.gfm=re({},ie.normal,{escape:ne(ie.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}var he=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ce,this.options.tokenizer=this.options.tokenizer||new se,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:le.normal,inline:de.normal};this.options.pedantic?(t.block=le.pedantic,t.inline=de.pedantic):this.options.gfm&&(t.block=le.gfm,this.options.breaks?t.inline=de.breaks:t.inline=de.gfm),this.tokenizer.rules=t}static get rules(){return{block:le,inline:de}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,o,i;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));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),n.type&&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((function(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],i&&"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),i=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){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let n,r,o,i,a,s,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,i.index)+"["+ue("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,i.index)+"["+ue("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,i.index)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(a||(s=""),a=!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,s))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,fe))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,fe))){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((function(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,pe))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(s=n.raw.slice(-1)),a=!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}};const{defaults:me}=C.exports,{cleanUrl:ge,escape:be}=Y;var ye=class{constructor(e){this.options=e||me}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'
'+(n?e:be(e,!0))+"
\n":"
"+(n?e:be(e,!0))+"
\n"}blockquote(e){return"
\n"+e+"
\n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
\n":"
\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){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 this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,n){if(null===(e=ge(this.options.sanitize,this.options.baseUrl,e)))return n;let r='",r}image(e,t,n){if(null===(e=ge(this.options.sanitize,this.options.baseUrl,e)))return n;let r=''+n+'":">",r}text(e){return e}},we=class{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""}},ve=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}};const $e=ye,xe=we,ke=ve,{defaults:Ee}=C.exports,{unescape:_e}=Y;var Ae=class e{constructor(e){this.options=e||Ee,this.options.renderer=this.options.renderer||new $e,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new xe,this.slugger=new ke}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n,r,o,i,a,s,c,l,d,u,p,f,h,m,g,b,y,w,v,$="";const x=e.length;for(n=0;n0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,h),d+=this.renderer.listitem(m,y,b);$+=this.renderer.list(d,p,f);continue;case"html":$+=this.renderer.html(u.text);continue;case"paragraph":$+=this.renderer.paragraph(this.parseInline(u.tokens));continue;case"text":for(d=u.tokens?this.parseInline(u.tokens):u.text;n+1{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),a--,0===a&&i()}))}),0))})),void(0===a&&i())}try{const n=Se.lex(e,t);return t.walkTokens&&Me.walkTokens(n,t.walkTokens),Ce.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Pe(e.message+"",!0)+"
    ";throw e}}Me.options=Me.setOptions=function(e){return Ie(Me.defaults,e),De(Me.defaults),Me},Me.getDefaults=je,Me.defaults=ze,Me.use=function(...e){const t=Ie({},...e),n=Me.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach((e=>{if(e.extensions&&(r=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)}))),e.renderer){const n=Me.defaults.renderer||new Le;for(const t in e.renderer){const r=n[t];n[t]=(...o)=>{let i=e.renderer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.renderer=n}if(e.tokenizer){const n=Me.defaults.tokenizer||new Te;for(const t in e.tokenizer){const r=n[t];n[t]=(...o)=>{let i=e.tokenizer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.tokenizer=n}if(e.walkTokens){const n=Me.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),n&&n.call(this,t)}}r&&(t.extensions=n),Me.setOptions(t)}))},Me.walkTokens=function(e,t){for(const n of e)switch(t.call(Me,n),n.type){case"table":for(const e of n.header)Me.walkTokens(e.tokens,t);for(const e of n.rows)for(const n of e)Me.walkTokens(n.tokens,t);break;case"list":Me.walkTokens(n.items,t);break;default:Me.defaults.extensions&&Me.defaults.extensions.childTokens&&Me.defaults.extensions.childTokens[n.type]?Me.defaults.extensions.childTokens[n.type].forEach((function(e){Me.walkTokens(n[e],t)})):n.tokens&&Me.walkTokens(n.tokens,t)}},Me.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=Ie({},Me.defaults,t||{}),Oe(t);try{const n=Se.lexInline(e,t);return t.walkTokens&&Me.walkTokens(n,t.walkTokens),Ce.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+Pe(e.message+"",!0)+"
    ";throw e}},Me.Parser=Ce,Me.parser=Ce.parse,Me.Renderer=Le,Me.TextRenderer=Ne,Me.Lexer=Se,Me.lexer=Se.lex,Me.Tokenizer=Te,Me.Slugger=Re,Me.parse=Me;const qe=Me,Fe=he,Ue=Ae,Be=ee,He=ye,We=we,Ve=ve;S.exports=qe,S.exports.parse=qe,S.exports.Parser=Ue,S.exports.parser=Ue.parse,S.exports.Renderer=He,S.exports.TextRenderer=We,S.exports.Lexer=Fe,S.exports.lexer=Fe.lex,S.exports.Tokenizer=Be,S.exports.Slugger=Ve;var Ye=S.exports;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Ze,Ge={exports:{}};Ze=Ge,function(e,t){Ze.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function a(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 s(e,t){return e.replace(/\$(\d{1,2})/g,(function(e,n){return t[n]||""}))}function c(e,t){return e.replace(t[0],(function(n,r){var o=s(t[1],arguments);return a(""===n?e[r-1]:n,o)}))}function l(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var i=r[o];if(i[0].test(t))return c(t,i)}return t}function d(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?a(r,o):e.hasOwnProperty(o)?a(r,e[o]):l(o,r,n)}}function u(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&l(o,o,n)===o}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=d(o,r,e),p.isPlural=u(o,r,e),p.singular=d(r,o,t),p.isSingular=u(r,o,t),p.addPluralRule=function(t,n){e.push([i(t),n])},p.addSingularRule=function(e,n){t.push([i(e),n])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},p.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 p.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 p.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 p.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(p.addUncountableRule),p}));var Xe=Ge.exports,Ke=function(e){var t={};try{t.WeakMap=WeakMap}catch(d){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=i.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},i;function i(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(a,this)}function a(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(d){!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,i){for(var a=("selectedIndex"in t),s=a;r>>0;na;)--c;l=s+r-c;var y=Array(l),w=d[c];for(--n;w;){for(var v=w.newi,$=w.oldi;v"+e+"",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=z(A),n=z("div");return n.innerHTML=''+e+"",D(t,n.firstChild.childNodes),t}:C)(e)});function D(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===A?_.createDocumentFragment():_.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,F,U,B,H,W,V,Y,Z=(q="appendChild",F="cloneNode",U="createTextNode",H=(B="importNode")in(M=e),(W=M.createDocumentFragment())[q](M[U]("g")),W[q](M[U]("")),(H?M[B](W,!0):W[F](!0)).childNodes.length<2?function e(t,n){for(var r=t[F](),o=t.childNodes||[],i=o.length,a=0;n&&a

    ',V.content.childNodes[0].getAttribute(Y)==X)||(X="_dt: "+X.slice(1,-1)+";",K=!0)}catch(d){}var J="\x3c!--"+X+"--\x3e",Q=/^(?:style|textarea)$/i,ee=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,te=" \\f\\n\\r\\t",ne="[^"+te+"\\/>\"'=]+",re="["+te+"]+"+ne,oe="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ie="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",ae=new RegExp(oe+re+ie+"+)(["+te+"]*/?>)","g"),se=new RegExp(oe+re+ie+"*)(["+te+"]*/>)","g"),ce=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+J+"\\2","gi");function le(e,t,n,r){return"<"+t+n.replace(ce,de)+r}function de(e,t,n){return t+(n||'"')+X+(n||'"')}function ue(e,t,n){return ee.test(t)?e:"<"+t+n+">"}var pe=K?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 fe(t,n,r,o){for(var i=t.childNodes,a=i.length,s=0;s{e.remove()}))}function ct(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:o})=>"element"===n&&t?t(o,r++,e):o))}}const lt=ct("conjunction"),dt=ct("disjunction");function ut(e,t){return lt(e,t).join("")}function pt(e,t){return dt(e,t).join("")}function ft(e){return e.trim().replace(/\s+/g," ")}function ht(e,t=o){return t=function(e){return{"zh-hans":"zh","zh-cn":"zh"}[e]||e}(t.toLowerCase()),new Proxy(e,{get(e,n){const r=e[t]&&e[t][n]||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function mt(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)}function gt(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 bt(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 yt(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 vt(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 $t(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 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 _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 At(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{vt(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 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 Lt 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||yt(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:i,title:a,details:s}=this;return{message:e,name:t,plugin:r,hint:o,elements:i,title:a,details:s,stack:n}}}function Nt(e,t,n={}){const r={...n,isWarning:!1};Mt("error",new Lt(e,t,r))}function Rt(e,t,n={}){const r={...n,isWarning:!0};Mt("warn",new Lt(e,t,r))}function It(e){return e?`\`${e}\``:""}function Ot(e,{quotes:t}={quotes:!1}){return ut(e,t?e=>It(Pt(e)):It)}function Pt(e){return String(e)?`"${e}"`:""}function jt(e,...t){return e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,i]=r.slice(1,-1).split("|");if(i){return`${e}[${o}](${new URL(i,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`})).join("")}const Dt="core/pubsubhub",zt=new Map;function Mt(e,...t){if(!zt.has(e))return;if(Array.from(zt.get(e)).forEach((e=>{try{e(...t)}catch(t){Nt(`Error when calling function ${e.name}.`,Dt,{hint:"See developer console."}),console.error(t)}})),window.parent===window.self)return;const n=t.map((e=>String(JSON.stringify(e.stack||e))));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function qt(e,t,n={once:!1}){return n.once?qt(e,(function n(...r){!function({topic:e,cb:t}){const n=zt.get(e);if(!n||!n.has(t))return console.warn("Already unsubscribed:",e,t),!1;n.delete(t)}({topic:e,cb:n}),t(...r)})):(zt.has(e)?zt.get(e).add(t):zt.set(e,new Set([t])),{topic:e,cb:t})}t(Dt,{sub:qt});const Ft=["githubToken","githubUser"];const Ut=new Map([["text/html","html"],["application/xml","xml"]]);function Bt(e,t=document){const n=Ut.get(e);if(!n){const t=[...Ut.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;St(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),st(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=Qe``);o.appendChild(a);const s=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=Qe` - - `;o.appendChild(c),t.prepend(o),Mt("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}t("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 Vt="core/post-process";const Yt="core/pre-process";const Zt="core/base-runner";async function Gt(e){!function(){const e=new Wt;Object.defineProperty(document,"respec",{value:e});let t=!1;Object.defineProperty(document,"respecIsReady",{get:()=>(t||(Rt("`document.respecIsReady` is deprecated and will be removed in a future release.","core/respec-global",{hint:"Use `document.respec.ready` instead."}),t=!0),document.respec.ready)})}(),Mt("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 Ft)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),Mt("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||Nt("Every item in `preProcess` must be a JS function.",Yt),t})).map((async t=>{try{return await t(e,document)}catch(e){Nt(`Function ${t.name} threw an error during \`preProcess\`.`,Yt,{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))),respecConfig.state={},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 i=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(i),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}}))}catch(e){console.error(e)}}}(t,respecConfig),respecConfig.state={},Mt("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.",Vt),t})).map((async t=>{try{return await t(e,document)}catch(e){Nt(`Function ${t.name} threw an error during \`postProcess\`.`,Vt,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),Mt("end-all"),st(document),performance.mark(`${Zt}-end`),performance.measure(Zt,`${Zt}-start`,`${Zt}-end`)}var Xt=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.1.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=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 i(e,t,n={once:!1}){r.addEventListener(e,(e=>t(e.detail)),n)}n("core/pubsubhub",{sub:i});const a=["githubToken","githubUser"];const s=document.documentElement;s?.hasAttribute("lang")||(s.lang="en",s.hasAttribute("dir")||(s.dir="ltr"));const c={},l=s?.lang??"en";var d=Object.freeze({__proto__:null,l10n:c,lang:l,name:"core/l10n",run:function(e){e.l10n=c[l]||c.en}});const u=(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(x(this),t),$(this.request)}:function(...t){return $(e.apply(x(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",i),e.removeEventListener("abort",i)},o=()=>{t(),r()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)}));h.set(e,t)}(e),u(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",o),e.removeEventListener("error",i)},o=()=>{t($(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)}));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 k=["get","getKey","getAll","getAllKeys","count"],E=["put","add","delete","clear"],A=new Map;function _(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(A.get(t))return A.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=E.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!k.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let a=i.store;return r&&(a=a.index(t.shift())),(await Promise.all([a[n](...t),o&&i.done]))[0]};return A.set(t,i),i}y((e=>({...e,get:(t,n,r)=>_(t,n)||e.get(t,n,r),has:(t,n)=>!!_(t,n)||e.has(t,n)})));const S=["continue","continuePrimaryKey","advance"],C={},T=new WeakMap,L=new WeakMap,R={get(e,t){if(!S.includes(t))return e[t];let n=C[t];return n||(n=C[t]=function(...e){T.set(this,L.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(L.set(n,t),g.set(n,x(t));t;)yield n,t=await(T.get(n)||t.continue()),T.delete(n)}function I(e,t){return t===Symbol.asyncIterator&&u(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&u(e,[IDBIndex,IDBObjectStore])}y((e=>({...e,get:(t,n,r)=>I(t,n)?N:e.get(t,n,r),has:(t,n)=>I(t,n)||e.has(t,n)})));var O=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:o,terminated:i}={}){const a=indexedDB.open(e,t),s=$(a);return r&&a.addEventListener("upgradeneeded",(e=>{r($(a.result),e.oldVersion,e.newVersion,$(a.transaction),e)})),n&&a.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),s.then((e=>{i&&e.addEventListener("close",(()=>i())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),s},unwrap:x,wrap:$});const P=/^[!#$%&'*+-.^`|~\w]+$/,j=/[\u000A\u000D\u0009\u0020]/u,D=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function M(e,t,n){(t&&""!==t&&!e.has(t)&&D.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function z(){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 U=/[&<>"']/,B=new RegExp(U.source,"g"),H=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,W=new RegExp(H.source,"g"),V={"&":"&","<":"<",">":">",'"':""","'":"'"},Y=e=>V[e];function K(e,t){if(t){if(U.test(e))return e.replace(B,Y)}else if(H.test(e))return e.replace(W,Y);return e}const X=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function G(e){return e.replace(X,((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 J(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 Q(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 i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let a="",s="",c=!1;for(;e;){let n=!1;if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),l=e.split("\n",1)[0],d=0;this.options.pedantic?(d=2,s=r.trimStart()):(d=t[2].search(/[^ ]/),d=d>4?1:d,s=r.slice(d),d+=t[1].length);let u=!1;if(!r&&/^ *$/.test(l)&&(a+=l+"\n",e=e.substring(l.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,d-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,d-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,d-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,d-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(i.test(l))break;if(t.test(l))break;if(n.test(e))break;if(l.search(/[^ ]/)>=d||!l.trim())s+="\n"+l.slice(d);else{if(u)break;if(r.search(/[^ ]/)>=4)break;if(o.test(r))break;if(i.test(r))break;if(n.test(r))break;s+="\n"+l}u||l.trim()||(u=!0),a+=c+"\n",e=e.substring(c.length+1),r=l.slice(d)}}o.loose||(c?o.loose=!0:/\n *\n *$/.test(a)&&(c=!0));let p,f=null;this.options.gfm&&(f=/^\[[ xX]\] /.exec(s),f&&(p="[ ] "!==f[0],s=s.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:a,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),o.raw+=a}o.items[o.items.length-1].raw=a.trimEnd(),o.items[o.items.length-1].text=s.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"):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?i.align.push("right"):/^ *:-+: *$/.test(e)?i.align.push("center"):/^ *:-+ *$/.test(e)?i.align.push("left"):i.align.push(null);for(const e of n)i.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of o)i.rows.push(te(e,i.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return i}}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&&/^
    /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,i,a=n,s=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(i=[...o].length,r[3]||r[4]){a+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){s+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+s);const t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+i);if(Math.min(n,i)%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 ie=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ae=/(?:[*+-]|\d{1,9}[.)])/,se=J(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ae).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*\])(?:\\.|[^\[\]\\])+/,de=J(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",le).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ue=J(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ae).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=J("^ {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=J(ce).replace("hr",ie).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:J(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",me).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:de,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:ie,html:he,lheading:se,list:ue,newline:/^(?: *(?:\n|$))+/,paragraph:me,table:ee,text:/^[^\n]+/},be=J("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ie).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:J(ce).replace("hr",ie).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:J("^ *(?: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:J(ce).replace("hr",ie).replace("heading"," *#{1,6} *[^\n]").replace("lheading",se).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ve=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,$e=/^( {2,}|\\)\n(?!\s*$)/,xe="\\p{P}\\p{S}",ke=J(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,xe).getRegex(),Ee=J(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,xe).getRegex(),Ae=J("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,xe).getRegex(),_e=J("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,xe).getRegex(),Se=J(/\\([punct])/,"gu").replace(/punct/g,xe).getRegex(),Ce=J(/^<(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(),Te=J(fe).replace("(?:--\x3e|$)","--\x3e").getRegex(),Le=J("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Te).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Re=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ne=J(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Re).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ie=J(/^!?\[(label)\]\[(ref)\]/).replace("label",Re).replace("ref",le).getRegex(),Oe=J(/^!?\[(ref)\](?:\[\])?/).replace("ref",le).getRegex(),Pe={_backpedal:ee,anyPunctuation:Se,autolink:Ce,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:$e,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:ee,emStrongLDelim:Ee,emStrongRDelimAst:Ae,emStrongRDelimUnd:_e,escape:ve,link:Ne,nolink:Oe,punctuation:ke,reflink:Ie,reflinkSearch:J("reflink|nolink(?!\\()","g").replace("reflink",Ie).replace("nolink",Oe).getRegex(),tag:Le,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],i&&"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),i=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,i,a,s,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(c));)c=c.slice(0,i.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(s=""),a=!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,s))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)&&(s=n.raw.slice(-1)),a=!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 Ue{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:K(e,!0))+"
    \n":"
    "+(n?e:K(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=Q(e);if(null===r)return n;let o='
    ",o}image(e,t,n){const r=Q(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+" "}):s+=e+" "}s+=this.parse(n.tokens,i),a+=this.renderer.listitem(s,o,!!r)}n+=this.renderer.list(a,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 i=o,a=i.tokens?this.parseInline(i.tokens):i.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 Ue(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],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.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],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new We;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],i=t[r];We.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(o.call(t,e)).then((e=>i.call(t,e)));const n=o.call(t,e);return i.call(t,n)}:t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.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 He.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const o={...r},i={...this.defaults,...o};!0===this.defaults.async&&!1===o.async&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const a=this.#t(!!i.silent,!!i.async);if(null==n)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then((t=>e(t,i))).then((e=>i.hooks?i.hooks.processAllTokens(e):e)).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>t(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));let r=e(n,i);i.hooks&&(r=i.hooks.processAllTokens(r)),i.walkTokens&&this.walkTokens(r,i.walkTokens);let o=t(r,i);return i.hooks&&(o=i.hooks.postprocess(o)),o}catch(e){return a(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+K(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Ye(e,t){return Ve.parse(e,t)}Ye.options=Ye.setOptions=function(e){return Ve.setOptions(e),Ye.defaults=Ve.defaults,F(Ye.defaults),Ye},Ye.getDefaults=z,Ye.defaults=q,Ye.use=function(...e){return Ve.use(...e),Ye.defaults=Ve.defaults,F(Ye.defaults),Ye},Ye.walkTokens=function(e,t){return Ve.walkTokens(e,t)},Ye.parseInline=Ve.parseInline,Ye.Parser=He,Ye.parser=He.parse,Ye.Renderer=Ue,Ye.TextRenderer=Be,Ye.Lexer=Fe,Ye.lexer=Fe.lex,Ye.Tokenizer=oe,Ye.Hooks=We,Ye.parse=Ye,Ye.options,Ye.setOptions,Ye.use,Ye.walkTokens,Ye.parseInline,He.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 Xe,Ge={exports:{}};Xe=Ge,function(e,t){Xe.exports=t()}(0,(function(){var e=[],t=[],n={},r={},o={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function a(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 s(e,t){return e.replace(t[0],(function(n,r){var o,i,s=(o=t[1],i=arguments,o.replace(/\$(\d{1,2})/g,(function(e,t){return i[t]||""})));return a(""===n?e[r-1]:n,s)}))}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var i=r[o];if(i[0].test(t))return s(t,i)}return t}function l(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?a(r,o):e.hasOwnProperty(o)?a(r,e[o]):c(o,r,n)}}function d(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&c(o,o,n)===o}}function u(e,t,n){return(n?t+" ":"")+(1===t?u.singular(e):u.plural(e))}return u.plural=l(o,r,e),u.isPlural=d(o,r,e),u.singular=l(r,o,t),u.isSingular=d(r,o,t),u.addPluralRule=function(t,n){e.push([i(t),n])},u.addSingularRule=function(e,n){t.push([i(e),n])},u.addUncountableRule=function(e){"string"!=typeof e?(u.addPluralRule(e,"$0"),u.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},u.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 u.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 u.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 u.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(u.addUncountableRule),u}));var Ze=Ke(Ge.exports),Je=function(e){var t={};try{t.WeakMap=WeakMap}catch(d){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,o=i.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},i;function i(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(a,this)}function a(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(d){!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,i){for(var a=("selectedIndex"in t),s=a;r>>0;na;)--c;l=s+r-c;var y=Array(l),w=d[c];for(--n;w;){for(var v=w.newi,$=w.oldi;v"+e+"",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=M(_),n=M("div");return n.innerHTML=''+e+"",D(t,n.firstChild.childNodes),t}:C)(e)});function D(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function M(e){return e===_?A.createDocumentFragment():A.createElementNS("http://www.w3.org/1999/xhtml",e)}var z,q,F,U,B,H,W,V,Y,K=(q="appendChild",F="cloneNode",U="createTextNode",H=(B="importNode")in(z=e),(W=z.createDocumentFragment())[q](z[U]("g")),W[q](z[U]("")),(H?z[B](W,!0):W[F](!0)).childNodes.length<2?function e(t,n){for(var r=t[F](),o=t.childNodes||[],i=o.length,a=0;n&&a

    ',V.content.childNodes[0].getAttribute(Y)==G)||(G="_dt: "+G.slice(1,-1)+";",Z=!0)}catch(d){}var J="\x3c!--"+G+"--\x3e",Q=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",ie="[^"+oe+"\\/>\"'=]+",ae="["+oe+"]+"+ie,se="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",ce="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ie.replace("\\/","")+"))?)",le=new RegExp(se+ae+ce+"+)(["+oe+"]*/?>)","g"),de=new RegExp(se+ae+ce+"*)(["+oe+"]*/>)","g"),ue=new RegExp("("+ae+"\\s*=\\s*)(['\"]?)"+J+"\\2","gi");function pe(e,t,n,r){return"<"+t+n.replace(ue,fe)+r}function fe(e,t,n){return t+(n||'"')+G+(n||'"')}function he(e,t,n){return re.test(t)?e:"<"+t+n+">"}var me=Z?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 i=t.childNodes,a=i.length,s=0;s{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 dt=lt("conjunction"),ut=lt("disjunction");function pt(e,t){return dt(e,t).join("")}function ft(e,t){return ut(e,t).join("")}function ht(e){return e.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/{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)}function yt(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 wt(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 vt(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 $t(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(at);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 Et(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function At(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 St 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 Ct(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"),Tt(t),t}function Tt(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 Rt 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 Nt 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||vt(e,"respec-offender")}(t,e,n.title)))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:i,title:a,details:s}=this;return{message:e,name:t,plugin:r,hint:o,elements:i,title:a,details:s,stack:n}}}function It(e,t,n={}){const r={...n,isWarning:!1};o("error",new Nt(e,t,r))}function Ot(e,t,n={}){const r={...n,isWarning:!0};o("warn",new Nt(e,t,r))}function Pt(e){return{showError:(t,n)=>It(t,e,n),showWarning:(t,n)=>Ot(t,e,n)}}function jt(e){return e?`\`${e}\``:""}function Dt(e,{quotes:t}={quotes:!1}){return pt(e,t?e=>jt(Mt(e)):jt)}function Mt(e){return String(e)?`"${e}"`:""}function zt(e,...t){return qt(e.map(((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[o,i]=r.slice(1,-1).split("|");if(i){return`${e}[${o}](${new URL(i,"https://respec.org/docs/")})`}return`${e}[\`${o}\`](https://respec.org/docs/#${o})`})).join(""))}function qt(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 Ft=new Map([["text/html","html"],["application/xml","xml"]]);function Ut(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=Bt(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Bt(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;Tt(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),ct(r);const i=e.createDocumentFragment(),a=e.querySelector("meta[name='viewport']");a&&t.firstChild!==a&&i.appendChild(a);let s=e.querySelector("meta[charset], meta[content*='charset=']");s||(s=Qe``);i.appendChild(s);const c=`ReSpec ${window.respecVersion||"Developer Channel"}`,l=Qe` + + `;i.appendChild(l),t.prepend(i),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:Ut});class Ht{constructor(){this._respecDonePromise=new Promise((e=>{i("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],i("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),i("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return Bt("html",document)}}const Wt="core/post-process";const Vt="core/pre-process";const Yt="core/base-runner";async function Kt(e){!function(){const e=new Ht;Object.defineProperty(document,"respec",{value:e})}(),o("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),i("amend-user-config",n),i("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of a)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(`${Yt}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||It("Every item in `preProcess` must be a JS function.",Vt),t})).map((async(t,n)=>{const r=Pt(`${Vt}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){It(`Function ${t.name} threw an error during \`preProcess\`.`,Vt,{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 i=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(i),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||It("Every item in `postProcess` must be a JS function.",Wt),t})).map((async(t,n)=>{const r=Pt(`${Wt}/${t.name||`[${n}]`}`);try{return await t(e,document,r)}catch(e){It(`Function ${t.name} threw an error during \`postProcess\`.`,Wt,{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(`${Yt}-end`),performance.measure(Yt,`${Yt}-start`,`${Yt}-end`)}var Xt=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{background:#fff;height:2.5em;color:#787878;border:1px solid #ccc;box-shadow:1px 1px 8px 0 rgba(100,100,100,.5)} -.respec-info-button{border:none;opacity:.75;border-radius:2em;margin-right:1em;min-width:3.5em} +#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} .respec-info-button:focus,.respec-info-button:hover{opacity:1;transition:opacity .2s} -#respec-pill:disabled{font-size:2.8px;text-indent:-9999em;border-top:1.1em solid rgba(40,40,40,.2);border-right:1.1em solid rgba(40,40,40,.2);border-bottom:1.1em solid rgba(40,40,40,.2);border-left:1.1em solid #fff;transform:translateZ(0);animation:respec-spin .5s infinite linear;box-shadow:none} -#respec-pill:disabled,#respec-pill:disabled:after{border-radius:50%;width:10em;height:10em} +#respec-pill{width:4.8em} +#respec-pill:not(:disabled){animation:respec-fadein .6s ease-in-out} +@keyframes respec-fadein{ +from{margin-top:-1.2em;border-radius:50%;border:.2em solid rgba(100,100,100,.5);box-shadow:none;height:4.8em} +to{margin-top:0;border:1px solid #ccc;border-radius:0;box-shadow:1px 1px 8px 0 rgba(100,100,100,.5);height:2.4em} +} +#respec-pill:disabled{margin-top:-1.2em;position:relative;border:none;box-shadow:none;border-radius:50%;width:4.8em;height:4.8em;padding:0} +#respec-pill:disabled::after{position:absolute;content:'';inset:-.2em;border-radius:50%;border:.2em solid rgba(100,100,100,.5);border-left:.2em solid transparent;animation:respec-spin .5s infinite linear} +@media (prefers-reduced-motion){ +#respec-pill:not(:disabled){animation:none} +#respec-pill:disabled::after{animation:none;border-left:.2em solid rgba(100,100,100,.5)} +} @keyframes respec-spin{ 0%{transform:rotate(0)} 100%{transform:rotate(360deg)} @@ -15,79 +24,81 @@ window.respecVersion="26.16.1",function(){"use strict";const e=!!window.require; .respec-hidden{visibility:hidden;opacity:0;transition:visibility 0s .2s,opacity .2s linear} .respec-visible{visibility:visible;opacity:1;transition:opacity .2s linear} #respec-pill:focus,#respec-pill:hover{color:#000;background-color:#f5f5f5;transition:color .2s} -#respec-menu{position:absolute;margin:0;padding:0;font-family:sans-serif;background:#fff;box-shadow:1px 1px 8px 0 rgba(100,100,100,.5);width:200px;display:none;text-align:left;margin-top:32px;font-size:.8em} +#respec-menu{position:absolute;margin:0;padding:0;font-family:sans-serif;background:var(--bg,#fff);color:var(--text,#000);box-shadow:1px 1px 8px 0 rgba(100,100,100,.5);width:200px;display:none;text-align:left;margin-top:32px;font-size:.8em} #respec-menu:not([hidden]){display:block} #respec-menu li{list-style-type:none;margin:0;padding:0} .respec-save-buttons{display:grid;grid-template-columns:repeat(auto-fill,minmax(47%,2fr));grid-gap:.5cm;padding:.5cm} -.respec-save-button:link{padding-top:16px;color:#f0f0f0;background:#2a5aa8;justify-self:stretch;height:1cm;text-decoration:none;text-align:center;font-size:inherit;border:none;border-radius:.2cm} -.respec-save-button:link:hover{color:#fff;background:#2a5aa8;padding:0;margin:0;border:0;padding-top:16px} -.respec-save-button:link:focus{background:#193766} +.respec-save-button:link{padding-top:16px;color:var(--def-text,#fff);background:var(--def-bg,#2a5aa8);justify-self:stretch;height:1cm;text-decoration:none;text-align:center;font-size:inherit;border:none;border-radius:.2cm} +.respec-save-button:link:hover{color:var(--def-text,#fff);background:var(--defrow-border,#2a5aa8);padding:0;margin:0;border:0;padding-top:16px} +.respec-save-button:link:focus{background:var(--tocnav-active-bg,#193766);color:var(--tocnav-active-text,#000)} #respec-pill:focus,#respec-ui button:focus,.respec-option:focus{outline:0;outline-style:none} #respec-pill-error{background-color:red;color:#fff} #respec-pill-warning{background-color:orange;color:#fff} -.respec-error-list,.respec-warning-list{margin:0;padding:0;list-style:none;font-family:sans-serif;background-color:#fffbe6;font-size:.85em} -.respec-error-list>li,.respec-warning-list>li{padding:.4em .7em} -.respec-warning-list>li::before{content:"⚠️";padding-right:.5em} -.respec-error-list p,.respec-warning-list p{padding:0;margin:0} -.respec-warning-list li{color:#5c3b00;border-bottom:thin solid #fff5c2} +.respec-error-list,.respec-warning-list{margin:0;padding:0;font-family:sans-serif;font-size:.85em} +.respec-warning-list{background-color:#fffbe6} +:is(.respec-warning-list,.respec-error-list)>li{list-style-type:none;margin:0;padding:.5em 0;padding-left:2em;padding-right:.5em} +:is(.respec-warning-list,.respec-error-list)>li+li{margin-top:.5rem} +:is(.respec-warning-list,.respec-error-list)>li:before{position:absolute;left:.4em} +:is(.respec-warning-list,.respec-error-list) p{padding:0;margin:0} +.respec-warning-list>li{color:#5c3b00;border-bottom:thin solid #fff5c2} .respec-error-list,.respec-error-list li{background-color:#fff0f0} -.respec-error-list li::before{content:"💥";padding-right:.5em} -.respec-error-list li{padding:.4em .7em;color:#5c3b00;border-bottom:thin solid #ffd7d7} -.respec-error-list li>p{margin:0;padding:0;display:inline-block} -.respec-error-list li>p:first-child,.respec-warning-list li>p:first-child{display:inline} -.respec-error-list>li li,.respec-warning-list>li li{margin:0;list-style:disc} +.respec-warning-list>li::before{content:"⚠️"} +.respec-error-list>li::before{content:"💥"} +.respec-error-list>li{color:#5c3b00;border-bottom:thin solid #ffd7d7} +:is(.respec-warning-list,.respec-error-list)>li li{list-style:disc} #respec-overlay{display:block;position:fixed;z-index:10000;top:0;left:0;height:100%;width:100%;background:#000} .respec-show-overlay{transition:opacity .2s linear;opacity:.5} .respec-hide-overlay{transition:opacity .2s linear;opacity:0} -.respec-modal{display:block;position:fixed;z-index:11000;margin:auto;top:10%;background:#fff;border:5px solid #666;min-width:20%;width:79%;padding:0;max-height:80%;overflow-y:auto;margin:0 -.5cm} -@media screen and (min-width:78em){ -.respec-modal{width:62%} -} -.respec-modal h3{margin:0;padding:.2em;text-align:center;color:#000;background:linear-gradient(to bottom,#eee 0,#eee 50%,#ccc 100%);font-size:1em} -.respec-modal .inside div p{padding-left:1cm} -#respec-menu button.respec-option{background:#fff;padding:0 .2cm;border:none;width:100%;text-align:left;font-size:inherit;padding:1.2em 1.2em} -#respec-menu button.respec-option:hover,#respec-menu button:focus{background-color:#eee} +.respec-modal{display:block;position:fixed;z-index:11000;top:10%;background:var(--bg,#fff);color:var(--text,#000);border:5px solid #666;border-color:var(--tocsidebar-shadow,#666);min-width:20%;padding:0;max-height:80%;overflow-y:auto;margin:0 -.5cm;left:20%;max-width:75%;min-width:60%} +.respec-modal h3{margin:0;padding:.2em;left:0!important;text-align:center;background:var(--tocsidebar-shadow,#ddd);color:var(--text,#000);font-size:1em} +#respec-menu button.respec-option{background:var(--bg,#fff);color:var(--text,#000);border:none;width:100%;text-align:left;font-size:inherit;padding:1.2em 1.2em} +#respec-menu button.respec-option:hover{background-color:var(--tocnav-hover-bg,#eee);color:var(--tocnav-hover-text,#000)} .respec-cmd-icon{padding-right:.5em} -#respec-ui button.respec-option:last-child{border:none;border-radius:inherit} +#respec-ui button.respec-option:first-child{margin-top:0} +#respec-ui button.respec-option:last-child{border:none;border-radius:inherit;margin-bottom:0} .respec-button-copy-paste{position:absolute;height:28px;width:40px;cursor:pointer;background-image:linear-gradient(#fcfcfc,#eee);border:1px solid #90b8de;border-left:0;border-radius:0 0 3px 0;-webkit-user-select:none;user-select:none;-webkit-appearance:none;top:0;left:127px} @media print{ #respec-ui{display:none} } .respec-iframe{width:100%;min-height:550px;height:100%;overflow:hidden;padding:0;margin:0;border:0} .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}`;function Kt(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")}var Jt=Object.freeze({__proto__:null,name:"core/reindent",reindent:Kt,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Kt(e.innerHTML)}});const Qt=/>/gm,en=/&/gm;class tn extends et.Renderer{code(e,t,n){const{language:r,...o}=tn.parseInfoString(t);if(/(^webidl$)/i.test(r))return`
    ${e}
    `;const i=super.code(e,r,n),{example:a,illegalExample:s}=o;if(!a&&!s)return i;const c=a||s,l=`${r} ${a?"example":"illegal-example"}`;return i.replace("
    ",`
    `)}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,r){const o=/(.+)\s+{#([\w-]+)}$/;if(o.test(e)){const[,n,r]=e.match(o);return`${n}`}return super.heading(e,t,n,r)}}function nn(e){const t=Kt(e).replace(Qt,">").replace(en,"&");return et(t,{sanitize:!1,gfm:!0,headerIds:!1,langPrefix:"",renderer:new tn})}function rn(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=nn(e.innerHTML)}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,t){const n=this.findHeader(e),r=n?this.findPosition(n):1,o=this.findParent(r);n&&e.removeChild(n),e.appendChild(t(e)),n&&e.prepend(n),o.appendChild(e),this.current=o}addElement(e){this.current.appendChild(e)}}function an(e,t){return function e(n){const r=new on(t);for(;n.firstChild;){const t=n.firstChild;if(t.nodeType===Node.ELEMENT_NODE)switch(t.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":r.addHeader(t);break;case"section":r.addSection(t,e);break;default:r.addElement(t)}else n.removeChild(t)}return r.root}(e)}function sn(e){const t=an(e,e.ownerDocument);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}const cn=(ln="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(ln);return t.forEach(rn),Array.from(t)});var ln;var dn=Object.freeze({__proto__:null,name:"core/markdown",markdownToHtml:nn,restructure:sn,run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n){for(const e of cn(document.body))sn(e);return}const r=document.getElementById("respec-ui");r.remove();const o=document.body.cloneNode(!0);var i;!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"),rn(o),i=o.querySelectorAll(".nolinks a[href]"),Array.from(i).forEach((e=>{e.replaceWith(e.textContent)}));const a=an(o,document);o.append(r,a),document.body.replaceWith(o)}});function un(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=Xt,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const pn=Qe``,fn=Qe`
      ${e}
    `;const i=super.code(e,r,n).replace('class="language-','class="'),{example:a,illegalExample:s}=o;if(!a&&!s)return i;const c=a||s,l=`${r} ${a?"example":"illegal-example"}`;return i.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 Jt};function en(e,t={inline:!1}){const n=qt(e).replace(Gt,">").replace(Zt,"&");return t.inline?tt.parseInline(n,Qt):tt.parse(n,Qt)}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);var i;!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),i=o.querySelectorAll(".nolinks a[href]"),Array.from(i).forEach((e=>{e.replaceWith(e.textContent)})),o.append(r),document.body.replaceWith(o)}});function an(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=Xt,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const sn=Qe``,cn=Qe``,hn=Qe``;let mn,gn;window.addEventListener("load",(()=>xn(fn)));const bn=[],yn=[],wn={};qt("start-all",(()=>document.body.prepend(pn)),{once:!0}),qt("end-all",(()=>document.body.prepend(pn)),{once:!0});const vn=Qe``;function $n(){fn.classList.toggle("respec-hidden"),fn.classList.toggle("respec-visible"),fn.hidden=!fn.hidden}function xn(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()))}))}pn.appendChild(vn),vn.addEventListener("click",(e=>{e.stopPropagation(),vn.setAttribute("aria-expanded",String(fn.hidden)),$n(),fn.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{fn.hidden||$n()})),pn.appendChild(fn),fn.addEventListener("keydown",(e=>{"Escape"!==e.key||fn.hidden||(vn.setAttribute("aria-expanded",String(fn.hidden)),$n(),vn.focus())}));const kn=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function En(e,t,n,r){t.push(e),wn.hasOwnProperty(n)||(wn[n]=function(e,t,n){const r=Qe``;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()))}))}sn.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()})),sn.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``;r.addEventListener("click",(()=>{r.setAttribute("aria-expanded","true");const o=Qe`
      `;for(const e of t){const t=document.createRange().createContextualFragment(An(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),o.appendChild(n)}_n.freshModal(n,o,r)}));const o=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return un(r,o),r}(n,t,r),pn.appendChild(wn[n]));const o=wn[n];o.textContent=t.length;const i=1===t.length?tt.singular(r):r;un(o,new Map([["label",`${t.length} ${i}`]]))}un(vn,kn);const _n={show(){try{pn.hidden=!1}catch(e){console.error(e)}},hide(){pn.hidden=!0},enable(){vn.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,i=Qe``;o.addEventListener("click",(()=>{o.setAttribute("aria-expanded","true");const r=Qe`
        `;for(const e of t){const t=document.createRange().createContextualFragment($n(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 i=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return an(o,i),o}(n,t,r),sn.appendChild(hn[n]));const o=hn[n];o.textContent=t.length;const i=1===t.length?rt.singular(r):r;an(o,new Map([["label",`${t.length} ${i}`]]))}an(mn,yn);const vn={show(){try{sn.hidden=!1}catch(e){console.error(e)}},hide(){sn.hidden=!0},enable(){mn.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,i=Qe``,a=Qe`
      1. ${i}
      2. `;return a.addEventListener("click",t),fn.appendChild(a),i},error(e){En(e,bn,"error","ReSpec Errors")},warning(e){En(e,yn,"warning","ReSpec Warnings")},closeModal(e){gn&&(gn.classList.remove("respec-show-overlay"),gn.classList.add("respec-hide-overlay"),gn.addEventListener("transitionend",(()=>{gn.remove(),gn=null}))),e&&e.setAttribute("aria-expanded","false"),mn&&(mn.remove(),mn=null,vn.focus())},freshModal(e,t,n){mn&&mn.remove(),gn&&gn.remove(),gn=Qe`
        `;const r=`${n.id}-modal`,o=`${r}-heading`;mn=Qe`
        `,a=Qe`
      3. ${i}
      4. `;return a.addEventListener("click",t),cn.appendChild(a),i},error(e){wn(e,pn,"error","ReSpec Errors")},warning(e){wn(e,fn,"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"),dn&&(dn.remove(),dn=null,mn.focus())},freshModal(e,t,n){dn&&dn.remove(),un&&un.remove(),un=Qe`
        `;const r=`${n.id}-modal`,o=`${r}-heading`;dn=Qe``;const i=new Map([["labelledby",o]]);un(mn,i),document.body.append(gn,mn),gn.addEventListener("click",(()=>this.closeModal(n))),gn.classList.toggle("respec-show-overlay"),mn.hidden=!1,xn(mn)}};function An(e){if("string"==typeof e)return e;const t=e.plugin?` (Plugin: "${e.plugin}").`:"",n=e.hint?` ${e.hint}`:"",r=Array.isArray(e.elements)?` Occurred at: ${ut(e.elements.map(Sn))}.`:"",o=e.details?`\n\n
        \n${e.details}\n
        \n`:"";return nn(`${e.message}${n}${r}${t}${o}`)}function Sn(e,t){return`[${t+1}](#${e.id})`}async function Cn(e){try{_n.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await Gt(e)}finally{_n.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&_n.closeModal()})),window.respecUI=_n,qt("error",(e=>_n.error(e))),qt("warn",(e=>_n.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const Tn=[Promise.resolve().then((function(){return Ln})),Promise.resolve().then((function(){return i})),Promise.resolve().then((function(){return In})),Promise.resolve().then((function(){return jn})),Promise.resolve().then((function(){return Mn})),Promise.resolve().then((function(){return Un})),Promise.resolve().then((function(){return Bn})),Promise.resolve().then((function(){return Vn})),Promise.resolve().then((function(){return Jn})),Promise.resolve().then((function(){return tr})),Promise.resolve().then((function(){return Ir})),Promise.resolve().then((function(){return zr})),Promise.resolve().then((function(){return dn})),Promise.resolve().then((function(){return Mr})),Promise.resolve().then((function(){return Jt})),Promise.resolve().then((function(){return Vr})),Promise.resolve().then((function(){return Yr})),Promise.resolve().then((function(){return Gr})),Promise.resolve().then((function(){return Xr})),Promise.resolve().then((function(){return Qr})),Promise.resolve().then((function(){return to})),Promise.resolve().then((function(){return ui})),Promise.resolve().then((function(){return hi})),Promise.resolve().then((function(){return _i})),Promise.resolve().then((function(){return Ai})),Promise.resolve().then((function(){return Li})),Promise.resolve().then((function(){return Pi})),Promise.resolve().then((function(){return ji})),Promise.resolve().then((function(){return Fi})),Promise.resolve().then((function(){return Hi})),Promise.resolve().then((function(){return Wi})),Promise.resolve().then((function(){return Ro})),Promise.resolve().then((function(){return da})),Promise.resolve().then((function(){return Ea})),Promise.resolve().then((function(){return ta})),Promise.resolve().then((function(){return Bo})),Promise.resolve().then((function(){return Da})),Promise.resolve().then((function(){return za})),Promise.resolve().then((function(){return Ma})),Promise.resolve().then((function(){return Ya})),Promise.resolve().then((function(){return Ga})),Promise.resolve().then((function(){return Yr})),Promise.resolve().then((function(){return es})),Promise.resolve().then((function(){return cs})),Promise.resolve().then((function(){return gs})),Promise.resolve().then((function(){return vs})),Promise.resolve().then((function(){return _s})),Promise.resolve().then((function(){return Ns})),Promise.resolve().then((function(){return Rs})),Promise.resolve().then((function(){return Is})),Promise.resolve().then((function(){return qs})),Promise.resolve().then((function(){return Ys})),Promise.resolve().then((function(){return Js})),Promise.resolve().then((function(){return oc})),Promise.resolve().then((function(){return sc})),Promise.resolve().then((function(){return lc})),Promise.resolve().then((function(){return uc})),Promise.resolve().then((function(){return yc})),Promise.resolve().then((function(){return kc})),Promise.resolve().then((function(){return Ec})),Promise.resolve().then((function(){return _c})),Promise.resolve().then((function(){return Ac})),Promise.resolve().then((function(){return Sc})),Promise.resolve().then((function(){return Cc})),Promise.resolve().then((function(){return Nc})),Promise.resolve().then((function(){return Pc})),Promise.resolve().then((function(){return zc})),Promise.resolve().then((function(){return Uc})),Promise.resolve().then((function(){return Vc})),Promise.resolve().then((function(){return Gc})),Promise.resolve().then((function(){return Jc})),Promise.resolve().then((function(){return tl})),Promise.resolve().then((function(){return ol})),Promise.resolve().then((function(){return cl}))];Promise.all(Tn).then((e=>Cn(e))).catch((e=>console.error(e)));var Ln=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){location.hash&&document.respec.ready.then((()=>{let e=decodeURIComponent(location.hash).substr(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)}location.hash=`#${e}`}))}});const Nn={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},Rn={};var In=Object.freeze({__proto__:null,name:"1edtech/defaults",run:function(e){const t=!1!==e.lint&&{...Nn.lint,...Rn.lint,...e.lint};Object.assign(e,{...Nn,...Rn,...e,lint:t})}});var On=String.raw`@keyframes pop{ +
        `;const i=new Map([["labelledby",o]]);an(dn,i),document.body.append(un,dn),un.addEventListener("click",(()=>this.closeModal(n))),un.classList.toggle("respec-show-overlay"),dn.hidden=!1,bn(dn)}};function $n(e){if("string"==typeof e)return e;const t=e.plugin?`

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

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

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

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

        \n ${en(e.elements.map(xn).join("\n"))}`:"",o=e.details?`\n\n
        \n${e.details}\n
        \n`:"";return`${en(`**${ht(e.message)}**`,{inline:!0})}${n}${r}${o}${t}`}function xn(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function kn(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,i("error",(e=>vn.error(e))),i("warn",(e=>vn.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const En=[Promise.resolve().then((function(){return An})),Promise.resolve().then((function(){return d})),Promise.resolve().then((function(){return Cn})),Promise.resolve().then((function(){return Rn})),Promise.resolve().then((function(){return On})),Promise.resolve().then((function(){return Dn})),Promise.resolve().then((function(){return Mn})),Promise.resolve().then((function(){return Fn})),Promise.resolve().then((function(){return Yn})),Promise.resolve().then((function(){return Qn})),Promise.resolve().then((function(){return zr})),Promise.resolve().then((function(){return Hr})),Promise.resolve().then((function(){return on})),Promise.resolve().then((function(){return Wr})),Promise.resolve().then((function(){return Vr})),Promise.resolve().then((function(){return eo})),Promise.resolve().then((function(){return no})),Promise.resolve().then((function(){return oo})),Promise.resolve().then((function(){return io})),Promise.resolve().then((function(){return co})),Promise.resolve().then((function(){return uo})),Promise.resolve().then((function(){return vi})),Promise.resolve().then((function(){return Ei})),Promise.resolve().then((function(){return Oi})),Promise.resolve().then((function(){return Pi})),Promise.resolve().then((function(){return zi})),Promise.resolve().then((function(){return Hi})),Promise.resolve().then((function(){return Wi})),Promise.resolve().then((function(){return Gi})),Promise.resolve().then((function(){return Qi})),Promise.resolve().then((function(){return ta})),Promise.resolve().then((function(){return Fo})),Promise.resolve().then((function(){return va})),Promise.resolve().then((function(){return Pa})),Promise.resolve().then((function(){return ua})),Promise.resolve().then((function(){return Jo})),Promise.resolve().then((function(){return Ka})),Promise.resolve().then((function(){return Xa})),Promise.resolve().then((function(){return Ga})),Promise.resolve().then((function(){return os})),Promise.resolve().then((function(){return as})),Promise.resolve().then((function(){return no})),Promise.resolve().then((function(){return ps})),Promise.resolve().then((function(){return $s})),Promise.resolve().then((function(){return Ts})),Promise.resolve().then((function(){return Is})),Promise.resolve().then((function(){return Ds})),Promise.resolve().then((function(){return Bs})),Promise.resolve().then((function(){return Hs})),Promise.resolve().then((function(){return Ws})),Promise.resolve().then((function(){return Js})),Promise.resolve().then((function(){return ic})),Promise.resolve().then((function(){return dc})),Promise.resolve().then((function(){return gc})),Promise.resolve().then((function(){return wc})),Promise.resolve().then((function(){return $c})),Promise.resolve().then((function(){return kc})),Promise.resolve().then((function(){return Rc})),Promise.resolve().then((function(){return jc})),Promise.resolve().then((function(){return Dc})),Promise.resolve().then((function(){return Mc})),Promise.resolve().then((function(){return zc})),Promise.resolve().then((function(){return qc})),Promise.resolve().then((function(){return Fc})),Promise.resolve().then((function(){return Hc})),Promise.resolve().then((function(){return Kc})),Promise.resolve().then((function(){return Zc})),Promise.resolve().then((function(){return tl})),Promise.resolve().then((function(){return ol})),Promise.resolve().then((function(){return sl})),Promise.resolve().then((function(){return dl})),Promise.resolve().then((function(){return fl})),Promise.resolve().then((function(){return gl})),Promise.resolve().then((function(){return vl}))];Promise.all(En).then((e=>kn(e))).catch((e=>console.error(e)));var An=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},Sn={};var Cn=Object.freeze({__proto__:null,name:"1edtech/defaults",run:function(e){const t=!1!==e.lint&&{..._n.lint,...Sn.lint,...e.lint};Object.assign(e,{..._n,...Sn,...e,lint:t})}});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)} } -.hljs{background:0 0!important} -:is(h1,h2,h3,h4,h5,h6,a) abbr{border:none} -dfn{font-weight:700} a.internalDFN{color:inherit;border-bottom:1px solid #99c;text-decoration:none} a.externalDFN{color:inherit;border-bottom:1px dotted #ccc;text-decoration:none} a.bibref{text-decoration:none} @@ -99,24 +110,10 @@ a.bibref{text-decoration:none} } #references :target{background:#eaf3ff;animation:pop .4s ease-in-out 0s 1} cite .bibref{font-style:normal} -code{color:#c63501} -th code{color:inherit} a[href].orcid{padding-left:4px;padding-right:4px} a[href].orcid>svg{margin-bottom:-2px} -.toc a,.tof a{text-decoration:none} -a .figno,a .secno{color:#000} ol.tof,ul.tof{list-style:none outside none} .caption{margin-top:.5em;font-style:italic} -table.simple{border-spacing:0;border-collapse:collapse;border-bottom:3px solid #005a9c} -.simple th{background:#005a9c;color:#fff;padding:3px 5px;text-align:left} -.simple th a{color:#fff;padding:3px 5px;text-align:left} -.simple th[scope=row]{background:inherit;color:inherit;border-top:1px solid #ddd} -.simple td{padding:3px 10px;border-top:1px solid #ddd} -.simple tr:nth-child(even){background:#f0f6ff} -.section dd>p:first-child{margin-top:0} -.section dd>p:last-child{margin-bottom:0} -.section dd{margin-bottom:1em} -.section dl.attrs dd,.section dl.eldef dd{margin-bottom:0} #issue-summary>ul{column-count:2} #issue-summary li{list-style:none;display:inline-block} details.respec-tests-details{margin-left:1em;display:inline-block;vertical-align:top} @@ -125,20 +122,22 @@ details.respec-tests-details[open]{z-index:999999;position:absolute;border:thin details.respec-tests-details[open]>summary{border-bottom:thin solid #cad3e2;padding-left:1em;margin-bottom:1em;line-height:2em} details.respec-tests-details>ul{width:100%;margin-top:-.3em} details.respec-tests-details>li{padding-left:1em} -a[href].self-link:hover{opacity:1;text-decoration:none;background-color:transparent} -h2,h3,h4,h5,h6{position:relative} +.self-link:hover{opacity:1;text-decoration:none;background-color:transparent} aside.example .marker>a.self-link{color:inherit} -:is(h2,h3,h4,h5,h6)>a.self-link{border:none;color:inherit;font-size:83%;height:2em;left:-1.6em;opacity:.5;position:absolute;text-align:center;text-decoration:none;top:0;transition:opacity .2s;width:2em} -:is(h2,h3,h4,h5,h6)>a.self-link::before{content:"§";display:block} +.header-wrapper{display:flex;align-items:baseline} +:is(h2,h3,h4,h5,h6):not(#toc>h2,#abstract>h2,#sotd>h2,.head>h2){position:relative;left:-.5em} +:is(h2,h3,h4,h5,h6):not(#toch2)+a.self-link{color:inherit;order:-1;position:relative;left:-1.1em;font-size:1rem;opacity:.5} +:is(h2,h3,h4,h5,h6)+a.self-link::before{content:"§";text-decoration:none;color:var(--heading-text)} +:is(h2,h3)+a.self-link{top:-.2em} +:is(h4,h5,h6)+a.self-link::before{color:#000} @media (max-width:767px){ dd{margin-left:0} -:is(h2,h3,h4,h5,h6)>a.self-link{left:auto;top:auto} } @media print{ .removeOnSave{display:none} -}`;const Pn=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=On,document.head.appendChild(e),e}();var jn=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Pn.remove()}});var Dn=String.raw`@charset "UTF-8"; +}`;const Ln=function(){const e=document.createElement("style");return e.id="respec-mainstyle",e.textContent=Tn,document.head.appendChild(e),e}();var Rn=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Ln.remove()}});var Nn=String.raw`@charset "UTF-8"; @import url(https://fonts.googleapis.com/css?family=Roboto|Roboto+Condensed|Source+Code+Pro); -:root{--fgclr1:rgba(0, 0, 0, 1);--fgclr2:rgba(0, 90, 156, 1);--fgclr3:rgba(70, 130, 180, 1);--fgclr4:rgba(40, 100, 150, 1);--gray:rgba(200, 200, 200, 0.9);--lightgray:rgba(240, 240, 240, 0.9);--lightestgray:rgba(250, 250, 250, 0.8);--darkgray:rgba(180, 180, 180, 1)} +:root{--fgclr1:rgba(0, 0, 0, 1);--fgclr2:rgba(0, 90, 156, 1);--fgclr3:rgba(70, 130, 180, 1);--fgclr4:rgba(40, 100, 150, 1);--gray:rgba(200, 200, 200, 0.9);--lightgray:rgba(240, 240, 240, 1);--lightestgray:rgba(250, 250, 250, 0.8);--darkgray:rgba(180, 180, 180, 1)} body{font-family:Roboto,Arial,Helvetica,sans-serif} code,pre,samp{font-family:'Source Code Pro',monospace} header{border-bottom:2px solid var(--gray);padding-bottom:2em} @@ -170,7 +169,7 @@ div#endWarranty p{margin-top:.3em;margin-bottom:.3em} div#endWarranty{margin-top:6em;padding-top:3em;border-top:2px solid var(--gray);text-align:center} table{border-collapse:collapse;word-wrap:normal;overflow-wrap:normal;-webkit-hyphens:manual;-ms-hyphens:manual;hyphens:manual;width:100%;margin-top:1.5em;margin-bottom:1.5em;max-width:50em;border:1px solid var(--gray)} td,th{padding-left:1em;padding-right:1em;padding-left:1em;padding-right:1em;text-align:left;text-align:start;vertical-align:top;border:1px solid var(--gray)} -th{font-weight:700;background-color:var(--fgclr3);color:#fff;padding:.6em} +th{font-weight:700;background-color:var(--fgclr3);color:var(--lightgray);padding:.6em} td{padding:.8em} th>*{padding:0;margin:0} table#no-cell-borders,table#version-table{border:1px solid var(--gray)} @@ -198,17 +197,18 @@ a[href].hidden-reveal,a[href].hidden-reveal:visited{text-decoration:none;border- body{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;color:var(--fgclr1)} .figure,.sidefigure,figure{text-align:left} .figure img,.figure pre,.sidefigure img,.sidefigure pre,figure img,figure pre{display:unset} -.caption,caption,figcaption{display:block;padding:.5em 0 .5em .5em}`;function zn(){const e=document.createElement("meta");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,""),document.head.insertBefore(e,document.head.firstChild)}var Mn=Object.freeze({__proto__:null,name:"1edtech/style",run:async function(e){if(zn(),mt(document,"https://www.w3.org/StyleSheets/TR/2016/base.css"),e.overrideCSSLocation){const t=e.overrideCSSLocation;mt(document,t)}else{const e=document.createElement("style");e.textContent=Dn,document.head.appendChild(e)}}});const qn="1edtech/config";function Fn(e){return null!=e&&e.trim().length>0}var Un=Object.freeze({__proto__:null,name:qn,run:async function(e){if(Fn(e.specTitle)||(Nt("head config must have the specTitle property set: title of the document, excluding version",qn),e.specTitle="@@@FIXME (conf.specTitle)"),Fn(e.docVersion)||(Nt("head config must have the docVersion property set, e.g. 'June 28, 2019'",qn),e.docVersion="@@@FIXME (conf.docVersion)"),Fn(e.specDate)||("Base Document"===e.specStatus?e.specDate=function(e=new Date,t=document.documentElement.lang||"en"){e instanceof Date||(e=new Date(e));const n=[t,"en"];return`${e.toLocaleString(n,{day:"2-digit",timeZone:"UTC"})} ${e.toLocaleString(n,{month:"long",timeZone:"UTC"})} ${e.toLocaleString(n,{year:"numeric",timeZone:"UTC"})}`}():(Nt("head config must have the specDate property set, e.g. 'June 28, 2019'",qn),e.specDate="@@@FIXME(conf.specDate)")),Fn(e.specNature)||(Nt("head config must have the specNature property set: one of 'normative' or 'informative'",qn),e.specNature="informative"),Fn(e.specType)||(Nt("head config must have the specType property set: One of 'spec', 'cert', 'impl', 'errata', 'doc' ",qn),e.specType="spec"),"doc"===e.specType||"proposal"===e.specType)return;Fn(e.shortName)||(Nt("head config must have the shortName property set: list at urls-names.md#shortnames",qn),e.shortName="FIXME"),Fn(e.specStatus)||(Nt("head config must have the specStatus property set to one of 'Base Document', 'Candidate Final', Candidate Final Public', or 'Final Release'",qn),e.specStatus="@@@FIXME(conf.specStatus)"),-1==["Base Document","Candidate Final","Candidate Final Public","Final Release","Proposal"].indexOf(e.specStatus)&&Nt("head config must have the specStatus property set to one of 'Base Document', 'Candidate Final', 'Candidate Final Public', 'Final Release', or 'Proposal'",qn),Fn(e.specVersion)||(Nt("head config must have the specVersion property set, e.g. '1.1'",qn),e.specVersion="@@@FIXME(conf.specVersion)")}});var Bn=Object.freeze({__proto__:null,name:"1edtech/compute",run:async function(e){const t=`https://www.imsglobal.org/spec/${e.shortName}/`;e.versionURL=`v${e.specVersion}`.replace(".","p"),e.thisURL=`${t}${e.versionURL}/`,e.errataURL=`${e.thisURL}errata/`,"spec"!==e.specType&&(e.thisURL=`${e.thisURL}${e.specType}/`),e.latestURI=`${t}latest/`,"spec"!==e.specType&&(e.latestURI=`${e.latestURI}${e.specType}/`),e.mainSpecURL=`${t}${e.versionURL}/`}});function Hn(e){const t=document.createElement("div");return t.innerHTML=e,t.childNodes}function Wn(e){const t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]}var Vn=Object.freeze({__proto__:null,name:"1edtech/transclude",run:async function(){let e=document.querySelector("script.transclude");for(;null!==e;){if(!e.hasAttribute("data-id")){Mt("error","transclude script element without data-id attribute");break}const t=window[e.getAttribute("data-id")];if(void 0===t||"string"!=typeof t){Mt("error",`no transclude variable named '${t}' found in global scope`);break}const n=Hn(t);for(let t=0;t{Zn=e,Gn=e=>{Nt(e,Yn),t(new Error(e))}})),Kn=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 Jn=Object.freeze({__proto__:null,name:Yn,github:Xn,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void Zn(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=jt`Config option ${"[github]"} is missing property \`repoURL\`.`;return void Gn(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=jt`${"[github]"} configuration option is not a valid URL? (${n}).`;return void Gn(e)}if("https://github.com"!==t.origin){const e=jt`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void Gn(e)}const[r,o]=t.pathname.split("/").filter((e=>e));if(!r||!o){const e=jt`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void Gn(e)}const i=e.github.branch||"gh-pages",a=new URL("./issues/",t).href,s=new URL(`./commits/${e.github.branch??""}`,t.href),c={edDraftURI:`https://${r.toLowerCase()}.github.io/${o}/`,githubToken:void 0,githubUser:void 0,issueBase:a,atRiskBase:a,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.",Yn)}if(!e.excludeGithubLinks){const n={key:Kn.participate,data:[{value:`GitHub ${r}/${o}`,href:t},{value:Kn.file_a_bug,href:c.issueBase},{value:Kn.commit_history,href:s.href},{value:"Pull requests",href:c.pullBase}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(n)}const d={branch:i,repoURL:t.href,apiBase:l,fullName:`${r}/${o}`,issuesURL:a,pullsURL:c.pullBase,newIssuesURL:new URL("./new/choose",a).href,commitHistoryURL:s.href};Zn(d);const u={...c,...e,github:d,githubAPI:l};Object.assign(e,u)}});const Qn="core/data-include";function er(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=gt(e,r.dataset.oninclude,n),i="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let o=t;"markdown"===r&&(o=nn(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&sn(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:i}),i||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}var tr=Object.freeze({__proto__:null,name:Qn,run:async function(){const e=document.querySelectorAll("[data-include]"),t=Array.from(e).map((async e=>{const t=e.dataset.include;if(!t)return;const n=`include-${String(Math.random()).substr(2)}`;e.dataset.includeId=n;try{const e=await fetch(t);er(await e.text(),n,t)}catch(n){const r=`\`data-include\` failed: \`${t}\` (${n.message}).`;console.error(r,e,n),Nt(r,Qn,{elements:[e]})}}));await Promise.all(t)}});function nr(e){return Number.isInteger(e)&&e<=2147483647&&e>=-2147483648}function rr(e){return Number.isInteger(e)}function or(){return!0}function ir(e){return Qe`
        `}function ar(e){return Qe`
        ${e}
        `}function sr(e){const t=`${e.parentClass.name}.${e.name}`.toLowerCase();return Qe` +.caption,caption,figcaption{display:block;padding:.5em 0 .5em .5em}`;function In(){const e=document.createElement("meta");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,""),document.head.insertBefore(e,document.head.firstChild)}var On=Object.freeze({__proto__:null,name:"1edtech/style",run:async function(e){if(In(),bt(document,"https://www.w3.org/StyleSheets/TR/2016/base.css"),e.overrideCSSLocation){const t=e.overrideCSSLocation;bt(document,t)}else{const e=document.createElement("style");e.textContent=Nn,document.head.appendChild(e)}}});const Pn="1edtech/config";function jn(e){return null!=e&&e.trim().length>0}var Dn=Object.freeze({__proto__:null,name:Pn,run:async function(e){if(jn(e.specTitle)||(It("head config must have the specTitle property set: title of the document, excluding version",Pn),e.specTitle="@@@FIXME (conf.specTitle)"),jn(e.docVersion)||(It("head config must have the docVersion property set, e.g. 'June 28, 2019'",Pn),e.docVersion="@@@FIXME (conf.docVersion)"),jn(e.specDate)||("Base Document"===e.specStatus?e.specDate=it.format(new Date):(It("head config must have the specDate property set, e.g. 'June 28, 2019'",Pn),e.specDate="@@@FIXME(conf.specDate)")),jn(e.specNature)||(It("head config must have the specNature property set: one of 'normative' or 'informative'",Pn),e.specNature="informative"),jn(e.specType)||(It("head config must have the specType property set: One of 'spec', 'cert', 'impl', 'errata', 'doc' ",Pn),e.specType="spec"),"doc"===e.specType||"proposal"===e.specType)return;jn(e.shortName)||(It("head config must have the shortName property set: list at urls-names.md#shortnames",Pn),e.shortName="FIXME"),jn(e.specStatus)||(It("head config must have the specStatus property set to one of 'Base Document', 'Candidate Final', Candidate Final Public', or 'Final Release'",Pn),e.specStatus="@@@FIXME(conf.specStatus)"),-1==["Base Document","Candidate Final","Candidate Final Public","Final Release","Proposal"].indexOf(e.specStatus)&&It("head config must have the specStatus property set to one of 'Base Document', 'Candidate Final', 'Candidate Final Public', 'Final Release', or 'Proposal'",Pn),jn(e.specVersion)||(It("head config must have the specVersion property set, e.g. '1.1'",Pn),e.specVersion="@@@FIXME(conf.specVersion)")}});var Mn=Object.freeze({__proto__:null,name:"1edtech/compute",run:async function(e){const t=`https://www.imsglobal.org/spec/${e.shortName}/`;e.versionURL=`v${e.specVersion}`.replace(".","p"),e.thisURL=`${t}${e.versionURL}/`,e.errataURL=`${e.thisURL}errata/`,"spec"!==e.specType&&(e.thisURL=`${e.thisURL}${e.specType}/`),e.latestURI=`${t}latest/`,"spec"!==e.specType&&(e.latestURI=`${e.latestURI}${e.specType}/`),e.mainSpecURL=`${t}${e.versionURL}/`}});function zn(e){const t=document.createElement("div");return t.innerHTML=e,t.childNodes}function qn(e){const t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]}var Fn=Object.freeze({__proto__:null,name:"1edtech/transclude",run:async function(){let e=document.querySelector("script.transclude");for(;null!==e;){if(!e.hasAttribute("data-id")){o("error","transclude script element without data-id attribute");break}const t=window[e.getAttribute("data-id")];if(void 0===t||"string"!=typeof t){o("error",`no transclude variable named '${t}' found in global scope`);break}const n=zn(t);for(let t=0;t{Bn=e,Hn=e=>{It(e,Un),t(new Error(e))}})),Vn=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:"}});var Yn=Object.freeze({__proto__:null,github:Wn,name:Un,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void Bn(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=zt`Config option ${"[github]"} is missing property \`repoURL\`.`;return void Hn(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=zt`${"[github]"} configuration option is not a valid URL? (${n}).`;return void Hn(e)}if("https://github.com"!==t.origin){const e=zt`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void Hn(e)}const[r,o]=t.pathname.split("/").filter((e=>e));if(!r||!o){const e=zt`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void Hn(e)}const i=e.github.branch||"gh-pages",a=new URL("./issues/",t).href,s=new URL(`./commits/${e.github.branch??""}`,t.href),c={edDraftURI:`https://${r.toLowerCase()}.github.io/${o}/`,githubToken:void 0,githubUser:void 0,issueBase:a,atRiskBase:a,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{Ot("The `githubAPI` configuration option is private and should not be added manually.",Un)}if(!e.excludeGithubLinks){const n={key:Vn.participate,data:[{value:`GitHub ${r}/${o}`,href:t},{value:Vn.file_a_bug,href:c.issueBase},{value:Vn.commit_history,href:s.href},{value:"Pull requests",href:c.pullBase}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(n)}const d={branch:i,repoURL:t.href,apiBase:l,fullName:`${r}/${o}`,issuesURL:a,pullsURL:c.pullBase,newIssuesURL:new URL("./new/choose",a).href,commitHistoryURL:s.href};Bn(d);const u={...c,...e,github:d,githubAPI:l};Object.assign(e,u)}});class Kn{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(Xn(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function Xn(e){const t=new Kn(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}const Gn="core/data-include";function Zn(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&&function(e){const t=Xn(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)}(e),n&&e.replaceWith(...e.childNodes)}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);!function(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),o=yt(e,r.dataset.oninclude,n),i="string"==typeof r.dataset.includeReplace;Zn(r,o,{replace:i}),i||function(e){["data-include","data-include-format","data-include-replace","data-include-id","oninclude"].forEach((t=>e.removeAttribute(t)))}(r)}(await o.text(),r,n),t<3&&await Jn(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),It(r,Gn,{elements:[e]})}}));await Promise.all(r)}var Qn=Object.freeze({__proto__:null,name:Gn,run:async function(){await Jn(document,1)}});const er=-(2**31),tr=2**31-1;function nr(e){return Number.isInteger(e)&&e<=tr&&e>=er}function rr(e){return Number.isInteger(e)}function or(){return!0}var ir=async(e,t,n)=>{const{default:r}=await import("https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs");r.initialize({startOnLoad:!1});const{svg:o}=await r.render(`class-diagram-${e}`,t),i=o.trim().replace(/height="[0-9]*"/,"");return Qe`

        ${n}

        + ${i}`};function ar(e){return Qe`
        `}function sr(e){return Qe`
        ${e}
        `}function cr(e){const t=`${e.parentClass.name}.${e.name}`.toLowerCase();return Qe` ${e.name} ${e.documentation.description} - ${e.documentation.issues.map(ir)} - ${e.documentation.notes.map(ar)} + ${e.documentation.issues.map(ar)} + ${e.documentation.notes.map(sr)} - `}function cr(e){let t=e.name;return"Enumeration"!==e.stereoType&&"EnumExt"!==e.stereoType||(t+=" Enumeration"),t=Qe`
        ${t}`,t}var lr=(e,t,n)=>{if(t&&t.properties)return n=n??`${t.name}`,Qe`

        ${n}

        + `}function lr(e){let t=e.name;return"Enumeration"!==e.stereoType&&"EnumExt"!==e.stereoType||(t+=" Enumeration"),t=Qe`${t}`,t}var dr=(e,t,n)=>{if(t&&t.properties)return n=n??`${t.name}`,Qe`

        ${n}

        ${t.documentation.description}

        - ${t.documentation.issues.map(ir)} - ${t.documentation.notes.map(ar)} + ${t.documentation.issues.map(ar)} + ${t.documentation.notes.map(sr)} @@ -222,11 +222,11 @@ body{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;color:var(--fgclr1)} ${t.properties.map((t=>function(e,t){return Qe` - + @@ -242,12 +242,45 @@ body{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;color:var(--fgclr1)} `:Qe``}(e,t)} -
        ${t.name}${cr(t.type)}${lr(t.type)} ${t.documentation.description} - ${t.documentation.issues.map(ir)} - ${t.documentation.notes.map(ar)} + ${t.documentation.issues.map(ar)} + ${t.documentation.notes.map(sr)} ${function(e,t){if(e.showPrivacyAnnotations&&t)return Qe`
        Privacy implication: ${t}
        `}(e,t.documentation.privacyDoc)}
        ${function(e){switch(e.cardinality.value){case"ONE":return"[1]";case"ZERO_OR_ONE":return"[0..1]";case"ZERO_OR_MANY":return"[0..*]";case"ONE_OR_MANY":return"[1..*]";case"TWO":return"[2]"}}(t)}
        `};var dr=(e,t,n)=>{if(e)return t=t??`${e.name} Data Model`,n=(n??e.id).replace(/\./g,"-"),Qe`

        ${t}

        - ${e.documentation.issues.map(ir)} - ${e.documentation.notes.map(ar)}`},ur=(e,t,n,r)=>{if(n)return r=r??`${n.name}`,Qe`

        ${r}

        + `};var ur=(e,t,n)=>{if(e)return t=t??`${e.name} Data Model`,n=(n??e.id).replace(/\./g,"-"),Qe`

        ${t}

        + ${e.documentation.issues.map(ar)} + ${e.documentation.notes.map(sr)}`},pr=(e,t)=>{if(e&&e.properties){const n="Vocabulary"===e.stereoType?"Vocabulary":"Enumeration";return t=t??`${e.name} ${n}`,Qe`

        ${t}

        +

        ${e.documentation.description}

        + ${e.documentation.issues.map(ar)} + ${e.documentation.notes.map(sr)} + + + + + + + + + ${e.properties.map(cr)} + ${"EnumExt"===e.stereoType?Qe` + + `:Qe``} + +
        TermDescription
        + This enumeration can be extended with new, proprietary terms. + The new terms must start with the substring 'ext:'. +
        `}},fr=(e,t,n)=>{if(e&&e.operations)return t=t??`${e.name}`,n=(n??e.id).replace(/\./g,"-"),Qe`

        ${t}

        +

        ${e.documentation?.description}

        + ${e.documentation?.issues.map(ar)} + ${e.documentation?.notes.map(sr)}`},hr=(e,t,n)=>{if(e)return n=n??`${e.name}`,Qe`

        ${n}

        +

        ${e.documentation.description}

        + ${e.documentation.issues.map(ar)} + ${e.documentation.notes.map(sr)} +
        ${JSON.stringify(t,null,2)}
        `},mr=(e,t,n)=>{if(e)return t=t??`${e.name} JSON Schema`,n=(n??e.id).replace(/\./g,"-"),Qe`

        ${t}

        + ${e.documentation.issues.map(ar)} + ${e.documentation.notes.map(sr)}`},gr=(e,t,n)=>{if(e)return n=n??`${e.name}`,Qe`

        ${n}

        +

        ${e.documentation.description}

        + ${e.documentation.issues.map(ar)} + ${e.documentation.notes.map(sr)} +
        ${t}
        `},br=(e,t,n,r)=>{if(n)return r=r??`${n.name}`,Qe`

        ${r}

        ${n.documentation.description}

        - ${n.documentation.issues.map(ir)} - ${n.documentation.notes.map(ar)} + ${n.documentation.issues.map(ar)} + ${n.documentation.notes.map(sr)} ${function(e,t,n){return Qe`
        Request
        ${function(e,t){let n=`${t.method} ${e}${t.request.path}`;const r=t.request.parameters.filter((e=>"QUERY"===e.type));if(r)for(let e=0;e${n}

        `}(t,n)} ${function(e,t){if(Array.from(t.request.parameters).length>0)return Qe` @@ -273,11 +306,11 @@ body{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;color:var(--fgclr1)} ${function(e){let t=e.value.name;e.cardinality.value.includes("MANY")&&(t+="[]");"Enumeration"!==e.value.stereoType&&"EnumExt"!==e.value.stereoType||(t+=" Enumeration");return t=Qe`${t}`,t}(t)} ${t.documentation.description} - ${t.documentation.issues.map(ir)} - ${t.documentation.notes.map(ar)} + ${t.documentation.issues.map(ar)} + ${t.documentation.notes.map(sr)} - ${fr(t)} - ${e.showPrivacyAnnotations?hr(t):null} + ${wr(t)} + ${e.showPrivacyAnnotations?vr(t):null} `}(e,t)))} @@ -299,19 +332,19 @@ body{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;color:var(--fgclr1)} ${t.request.bodies.map((t=>function(e,t){return Qe` ${t.contentType} - ${mr(t)} + ${$r(t)} ${t.documentation?.description} - ${t.documentation?.issues.map(ir)} - ${t.documentation?.notes.map(ar)} + ${t.documentation?.issues.map(ar)} + ${t.documentation?.notes.map(sr)} - ${fr(t)} - ${e.showPrivacyAnnotations?hr(t):null} + ${wr(t)} + ${e.showPrivacyAnnotations?vr(t):null} `}(e,t)))} `}(e,n)}`}(e,t,n)} - ${function(e,t){const n=t.responses.flatMap(pr);return Qe`
        Responses
        + ${function(e,t){const n=t.responses.flatMap(yr);return Qe`
        Responses
        - + - - ${e.showPrivacyAnnotations?hr(t.body):null} + + ${e.showPrivacyAnnotations?vr(t.body):null} `}(e,t)))} -
        Allowed response codes and content types @@ -330,59 +363,44 @@ body{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;color:var(--fgclr1)} ${n.map((t=>function(e,t){return Qe`
        ${t.statusCode} ${t.body?.contentType}${mr(t.body)}${$r(t.body)} ${t.documentation?.description} ${t.body?.documentation?.description} - ${t.body?.documentation?.issues.map(ir)} - ${t.body?.documentation?.notes.map(ar)} + ${t.body?.documentation?.issues.map(ar)} + ${t.body?.documentation?.notes.map(sr)} ${fr(t.body)}${wr(t.body)}
        `}(e,n)}`};function pr(e){const t=Array.from(e.bodies);if(0==t.length)return e;{const n=new Array;for(let r=0;r + `}(e,n)}`};function yr(e){const t=Array.from(e.bodies);if(0==t.length)return e;{const n=new Array;for(let r=0;r ${function(e){if(e?.confidentiality)return e.confidentiality.label}(e)} - `}function mr(e){if(e?.type){let t=e.type.name;return e.cardinality.value.includes("MANY")&&(t+="[]"),"Enumeration"!==e.type.stereoType&&"EnumExt"!==e.type.stereoType||(t+=" Enumeration"),t=Qe`${t}`,t}}function gr(e){return Qe` + `}function $r(e){if(e?.type){let t=e.type.name;return e.cardinality.value.includes("MANY")&&(t+="[]"),"Enumeration"!==e.type.stereoType&&"EnumExt"!==e.type.stereoType||(t+=" Enumeration"),t=Qe`${t}`,t}}var xr=(e,t,n)=>{if(e)return t=t??`${e.name} Service Model`,n=(n??e.id).replace(/\./g,"-"),Qe`

        ${t}

        + ${e.documentation.issues.map(ar)} + ${e.documentation.notes.map(sr)}`},kr=(e,t)=>{const n=e.classes.filter((e=>e.stereoType===t)).sort(((e,t)=>{const n=e.name.toUpperCase(),r=t.name.toUpperCase();return nr?1:0}));if(n.length>0)return Qe` + + + + + + + + ${n.map(Er)} + +
        TypeDescription
        `};function Er(e){return Qe` ${e.name} ${e.documentation.description} - ${e.documentation.issues.map(ir)} - ${e.documentation.notes.map(ar)} + ${e.documentation.issues.map(ar)} + ${e.documentation.notes.map(sr)} - `}function br(e){return Qe` - ${cr(e)} - - ${e.documentation.description} - ${e.documentation.issues.map(ir)} - ${e.documentation.notes.map(ar)} - - `}const yr="1edtech/mps";function wr(e){if(e.mps.apiKey)return e.mps.apiKey;throw"No MPS API KEY found"}function vr(e){if(e.mps.serverUrl)return e.mps.serverUrl;throw"No MPS server URL found"}async function $r(e,t,n=!0){try{const r=await fetch(`${vr(e)}/jsonschema/${t}?allowAdditionalProperties=${n}`,{method:"GET",headers:{"Content-Type":"application/json","X-Api-Key":wr(e)}});if(!r.ok)return Nt(`Could not get the schema for ${t}: ${r.status}`,yr),null;return await r.json()}catch(e){return Nt(`Could not get the schema for ${t}: ${e}`,yr),null}}async function xr(e,t,n){const r=`${t}-${n}`,o=sessionStorage.getItem(r);if(o)return JSON.parse(o);const i=JSON.stringify({query:`\n {\n modelByID(id: "${n}", source: ${t??"CORE"}) {\n id\n id\n name\n documentation {\n description\n notes\n issues\n }\n classes {\n id\n name\n stereoType\n documentation {\n description\n notes\n issues\n packageName\n }\n properties {\n name\n type {\n id\n name\n stereoType\n }\n cardinality {\n value\n }\n documentation {\n description\n notes\n issues\n privacyDoc\n }\n privacyImplications {\n label\n value\n }\n parentClass {\n id\n name\n }\n\n }\n isExtensible\n generalizations {\n id\n name\n documentation {\n description\n notes\n issues\n }\n }\n }\n services {\n ... on RestService {\n id\n type\n documentation {\n description\n notes\n issues\n }\n rootPath\n interfaces {\n id\n name\n documentation {\n description\n notes\n issues\n }\n operations {\n id\n name\n documentation {\n description\n notes\n issues\n }\n method\n request {\n id\n documentation {\n description\n notes\n issues\n }\n path\n bodies {\n documentation {\n description\n notes\n issues\n }\n type {\n id\n name\n }\n cardinality {\n value\n }\n confidentiality {\n label\n value\n }\n contentType\n }\n parameters {\n id\n name\n documentation {\n description\n notes\n issues\n }\n type\n cardinality {\n value\n }\n confidentiality {\n label\n value\n }\n value {\n id\n name\n stereoType\n }\n }\n }\n responses {\n id\n documentation {\n description\n notes\n issues\n }\n statusCode\n bodies {\n documentation {\n description\n notes\n issues\n }\n type {\n id\n name\n stereoType\n }\n confidentiality {\n label\n value\n }\n cardinality {\n value\n }\n contentType\n }\n parameters {\n id\n name\n documentation {\n description\n notes\n issues\n }\n type\n cardinality {\n value\n }\n value {\n id\n name\n stereoType\n }\n }\n }\n }\n }\n }\n }\n }\n }\n `});try{const t=await fetch(`${vr(e)}/graphql`,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":wr(e)},body:i});if(!t.ok)return Nt(`Could not get MPS model for ${n}. Please see the developer console for details.`,yr),null;const o=(await t.json()).data.modelByID;return o?(sessionStorage.setItem(r,JSON.stringify(o)),o):(Nt(`Unknown model ${n} at ${vr(e)}, source: ${e.mps.source??"CORE"}`,yr),null)}catch(e){return Nt(`Could not get MPS model for ${n}: ${e}`,yr),null}}async function kr(e,t,n){t.setAttribute("id",n.id);const r=t.getAttribute("title");let o;switch(n.stereoType){case"Enum":case"EnumeratedList":case"Enumeration":case"EnumExt":case"Vocabulary":o=((e,t)=>{if(e&&e.properties){const n="Vocabulary"===e.stereoType?"Vocabulary":"Enumeration";return t=t??`${e.name} ${n}`,Qe`

        ${t}

        -

        ${e.documentation.description}

        - ${e.documentation.issues.map(ir)} - ${e.documentation.notes.map(ar)} - - - - - - - - - ${e.properties.map(sr)} - ${"EnumExt"===e.stereoType?Qe` - - `:Qe``} - -
        TermDescription
        - This enumeration can be extended with new, proprietary terms. - The new terms must start with the substring 'ext:'. -
        `}})(n,r);break;case"EmbeddedSelection":o=((e,t)=>{if(e&&e.generalizations)return t=t??`${e.name}`,Qe`

        ${t}

        + `}var Ar=(e,t)=>{if(e&&e.generalizations)return t=t??`${e.name}`,Qe`

        ${t}

        ${e.documentation.description}

        - ${e.documentation.issues.map(ir)} - ${e.documentation.notes.map(ar)} + ${e.documentation.issues.map(ar)} + ${e.documentation.notes.map(sr)}

        The ultimate representation of this class is a choice of exactly one of the classes in the following set:

        @@ -392,77 +410,58 @@ body{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;color:var(--fgclr1)} - ${e.generalizations.map(br)} + ${e.generalizations.map(_r)} -
        `})(n,r);break;default:o=lr(e,n,r)}if(o){let e=null;Array.from(o.childNodes).forEach((n=>{if("#comment"!==n.nodeName){let r=n;"#text"===n.nodeName&&(r=document.createElement("text"),r.innerHTML=n.nodeValue),e?e.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),e=r}}))}}async function Er(e,t,n){const r=t.getAttribute("id");t.setAttribute("id",n.id);const o=t.getAttribute("title"),i=((e,t,n)=>{if(e&&e.operations)return t=t??`${e.name}`,n=(n??e.id).replace(/\./g,"-"),Qe`

        ${t}

        -

        ${e.documentation?.description}

        - ${e.documentation?.issues.map(ir)} - ${e.documentation?.notes.map(ar)}`})(n,o,r);if(i){let r=null;Array.from(i.childNodes).forEach((e=>{if("#comment"!==e.nodeName){let n=e;"#text"===e.nodeName&&(n=document.createElement("text"),n.innerHTML=e.nodeValue),r?r.insertAdjacentElement("afterend",n):t.insertAdjacentElement("afterbegin",n),r=n}}));Array.from(n.operations).forEach((async r=>{let o=t.querySelector(`section[data-operation="${r.id}"]`);o?Cr(e,o,n.rootPath,r):(o=Qe`
        `};function _r(e){return Qe` + ${lr(e)} + + ${e.documentation.description} + ${e.documentation.issues.map(ar)} + ${e.documentation.notes.map(sr)} + + `}const Sr="1edtech/mps";function Cr(e){if(e.mps.apiKey)return e.mps.apiKey;throw"No MPS API KEY found"}function Tr(e){if(e.mps.serverUrl)return e.mps.serverUrl;throw"No MPS server URL found"}async function Lr(e,t,n=!0){try{const r=await fetch(`${Tr(e)}/jsonschema/${t}?allowAdditionalProperties=${n}`,{method:"GET",headers:{"Content-Type":"application/json","X-Api-Key":Cr(e)}});if(!r.ok)return It(`Could not get the schema for ${t}: ${r.status}`,Sr),null;return await r.json()}catch(e){return It(`Could not get the schema for ${t}: ${e}`,Sr),null}}async function Rr(e,t,n){const r=`${t}-${n}`,o=sessionStorage.getItem(r);if(o)return JSON.parse(o);const i=JSON.stringify({query:`\n {\n modelByID(id: "${n}", source: ${t??"CORE"}) {\n id\n id\n name\n documentation {\n description\n notes\n issues\n }\n classes {\n id\n name\n stereoType\n documentation {\n description\n notes\n issues\n packageName\n }\n properties {\n name\n type {\n id\n name\n stereoType\n }\n cardinality {\n value\n }\n documentation {\n description\n notes\n issues\n privacyDoc\n }\n privacyImplications {\n label\n value\n }\n parentClass {\n id\n name\n }\n\n }\n isExtensible\n generalizations {\n id\n name\n documentation {\n description\n notes\n issues\n }\n }\n }\n services {\n ... on RestService {\n id\n type\n documentation {\n description\n notes\n issues\n }\n rootPath\n interfaces {\n id\n name\n documentation {\n description\n notes\n issues\n }\n operations {\n id\n name\n documentation {\n description\n notes\n issues\n }\n method\n request {\n id\n documentation {\n description\n notes\n issues\n }\n path\n bodies {\n documentation {\n description\n notes\n issues\n }\n type {\n id\n name\n }\n cardinality {\n value\n }\n confidentiality {\n label\n value\n }\n contentType\n }\n parameters {\n id\n name\n documentation {\n description\n notes\n issues\n }\n type\n cardinality {\n value\n }\n confidentiality {\n label\n value\n }\n value {\n id\n name\n stereoType\n }\n }\n }\n responses {\n id\n documentation {\n description\n notes\n issues\n }\n statusCode\n bodies {\n documentation {\n description\n notes\n issues\n }\n type {\n id\n name\n stereoType\n }\n confidentiality {\n label\n value\n }\n cardinality {\n value\n }\n contentType\n }\n parameters {\n id\n name\n documentation {\n description\n notes\n issues\n }\n type\n cardinality {\n value\n }\n value {\n id\n name\n stereoType\n }\n }\n }\n }\n }\n }\n }\n }\n }\n `});try{const t=await fetch(`${Tr(e)}/graphql`,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":Cr(e)},body:i});if(!t.ok)return It(`Could not get MPS model for ${n}. Please see the developer console for details.`,Sr),null;const o=(await t.json()).data.modelByID;return o?(sessionStorage.setItem(r,JSON.stringify(o)),o):(It(`Unknown model ${n} at ${Tr(e)}, source: ${e.mps.source??"CORE"}`,Sr),null)}catch(e){return It(`Could not get MPS model for ${n}: ${e}`,Sr),null}}async function Nr(e,t,n){t.setAttribute("id",n.id);const r=t.getAttribute("title");let o;switch(n.stereoType){case"Enum":case"EnumeratedList":case"Enumeration":case"EnumExt":case"Vocabulary":o=pr(n,r);break;case"EmbeddedSelection":o=Ar(n,r);break;default:o=dr(e,n,r)}if(o){let e=null;Array.from(o.childNodes).forEach((n=>{if("#comment"!==n.nodeName){let r=n;"#text"===n.nodeName&&(r=document.createElement("text"),r.innerHTML=n.nodeValue),e?e.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),e=r}}))}}async function Ir(e,t,n){const r=t.getAttribute("id");t.setAttribute("id",n.id);const o=t.getAttribute("title"),i=fr(n,o,r);if(i){let r=null;Array.from(i.childNodes).forEach((e=>{if("#comment"!==e.nodeName){let n=e;"#text"===e.nodeName&&(n=document.createElement("text"),n.innerHTML=e.nodeValue),r?r.insertAdjacentElement("afterend",n):t.insertAdjacentElement("afterbegin",n),r=n}}));Array.from(n.operations).forEach((async r=>{let o=t.querySelector(`section[data-operation="${r.id}"]`);o?jr(e,o,n.rootPath,r):(o=Qe`
        `,Cr(e,o,n.rootPath,r),t.insertAdjacentElement("beforeend",o))}))}}async function _r(e,t,n){t.setAttribute("id",`${n.id}-schema`);const r=t.getAttribute("title"),o=await $r(e,n.id),i=((e,t,n)=>{if(e)return n=n??`${e.name}`,Qe`

        ${n}

        -

        ${e.documentation.description}

        - ${e.documentation.issues.map(ir)} - ${e.documentation.notes.map(ar)} -
        ${JSON.stringify(t,null,2)}
        `})(n,o,r);if(o&&i){let e=null;Array.from(i.childNodes).forEach((n=>{if("#comment"!==n.nodeName){let r=n;"#text"===n.nodeName&&(r=document.createElement("text"),r.innerHTML=n.nodeValue),e?e.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),e=r}}))}}async function Ar(e,t,n){const r=t.getAttribute("data-source")??e.mps.source;if("CORE"!==r&&"SANDBOX"!==r)return void Nt(`Invalid source ${r} for model ${n}`);const o=t.getAttribute("title"),i=t.getAttribute("id"),a=t.getAttribute("data-package")??"",s=await xr(e,r,n);if(s){const n=((e,t,n)=>{if(e)return t=t??`${e.name} JSON Schema`,n=(n??e.id).replace(/\./g,"-"),Qe`

        ${t}

        - ${e.documentation.issues.map(ir)} - ${e.documentation.notes.map(ar)}`})(s,o,i);if(n){let e=null;Array.from(n.childNodes).forEach((n=>{if("#comment"!==n.nodeName){let r=n;"#text"===n.nodeName&&(r=document.createElement("text"),r.innerHTML=n.nodeValue),e?e.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),e=r}}))}let r=Array.from(s.classes).filter((e=>"PrimitiveType"!==e.stereoType&&"DerivedType"!==e.stereoType));""!==a&&(r=r.filter((e=>e.documentation.packageName===a))),r.forEach((async n=>{let r=t.querySelector(`section[data-class="${n.id}"]`);r?_r(e,r,n):(r=Qe`
        `,_r(e,r,n),t.insertAdjacentElement("beforeend",r))}))}else t.insertAdjacentElement("afterbegin",Qe`

        ${n}

        `)}async function Sr(e,t,n){const r=t.getAttribute("data-source")??e.mps.source;if("CORE"!==r&&"SANDBOX"!==r)return void Nt(`Invalid source ${r} for model ${n}`);const o=t.getAttribute("title");t.getAttribute("id");const i=t.getAttribute("data-binding"),a=await xr(e,r,n),s=await async function(e,t,n){n=n??"yaml";try{const r=await fetch(`${vr(e)}/openapischema/${t}?binding=${n.toLowerCase()}`,{method:"GET",headers:{"Content-Type":"application/json","X-Api-Key":wr(e)}});return r.ok?await r.text():(Nt(`Could not get the OpenAPI schema for ${t}: ${r.status}`,yr),null)}catch(e){return Nt(`Could not get the OpenAPI schema for ${t}: ${e}`,yr),null}}(e,n,i);if(a&&s){const e=((e,t,n)=>{if(e)return n=n??`${e.name}`,Qe`

        ${n}

        -

        ${e.documentation.description}

        - ${e.documentation.issues.map(ir)} - ${e.documentation.notes.map(ar)} -
        ${t}
        `})(a,s,o);if(e){let n=null;Array.from(e.childNodes).forEach((e=>{if("#comment"!==e.nodeName){let r=e;"#text"===e.nodeName&&(r=document.createElement("text"),r.innerHTML=e.nodeValue),n?n.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),n=r}}))}}else t.insertAdjacentElement("afterbegin",Qe`

        ${n}

        `)}async function Cr(e,t,n,r){t.setAttribute("id",r.id);const o=t.getAttribute("title"),i=ur(e,n,r,o);if(i){let e=null;Array.from(i.childNodes).forEach((n=>{if("#comment"!==n.nodeName){let r=n;"#text"===n.nodeName&&(r=document.createElement("text"),r.innerHTML=n.nodeValue),e?e.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),e=r}}))}}async function Tr(e,t){const n=t.getAttribute("data-sample");if(""===n)return void Nt("Example is missing a schema id",yr);const r=t.getAttribute("id")??`example-${n}`;t.setAttribute("id",r),t.removeAttribute("data-sample");const o=t.getAttribute("data-include-optional-fields")??"false",i=await async function(e,t,n=!1){try{const r=await fetch(`${vr(e)}/sample/${t}?includeOptionalFields=${n}`,{method:"GET",headers:{"Content-Type":"application/json","X-Api-Key":wr(e)}});return r.ok?await r.json():(Nt(`Could not get sampledata for ${t}: ${r.status}`,yr),null)}catch(e){return Nt(`Could not get sample data for ${t}: ${e}`,yr),null}}(e,n,o);if(i){const e=Qe` + >
        `,jr(e,o,n.rootPath,r),t.insertAdjacentElement("beforeend",o))}))}}async function Or(e,t,n){t.setAttribute("id",`${n.id}-schema`);const r=t.getAttribute("title"),o=await Lr(e,n.id),i=hr(n,o,r);if(o&&i){let e=null;Array.from(i.childNodes).forEach((n=>{if("#comment"!==n.nodeName){let r=n;"#text"===n.nodeName&&(r=document.createElement("text"),r.innerHTML=n.nodeValue),e?e.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),e=r}}))}}async function Pr(e,t,n){const r=t.getAttribute("data-source")??e.mps.source;if("CORE"!==r&&"SANDBOX"!==r)return void It(`Invalid source ${r} for model ${n}`);const o=t.getAttribute("title");t.getAttribute("id");const i=t.getAttribute("data-binding"),a=await Rr(e,r,n),s=await async function(e,t,n){n=n??"yaml";try{const r=await fetch(`${Tr(e)}/openapischema/${t}?binding=${n.toLowerCase()}`,{method:"GET",headers:{"Content-Type":"application/json","X-Api-Key":Cr(e)}});return r.ok?await r.text():(It(`Could not get the OpenAPI schema for ${t}: ${r.status}`,Sr),null)}catch(e){return It(`Could not get the OpenAPI schema for ${t}: ${e}`,Sr),null}}(e,n,i);if(a&&s){const e=gr(a,s,o);if(e){let n=null;Array.from(e.childNodes).forEach((e=>{if("#comment"!==e.nodeName){let r=e;"#text"===e.nodeName&&(r=document.createElement("text"),r.innerHTML=e.nodeValue),n?n.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),n=r}}))}}else t.insertAdjacentElement("afterbegin",Qe`

        ${n}

        `)}async function jr(e,t,n,r){t.setAttribute("id",r.id);const o=t.getAttribute("title"),i=br(e,n,r,o);if(i){let e=null;Array.from(i.childNodes).forEach((n=>{if("#comment"!==n.nodeName){let r=n;"#text"===n.nodeName&&(r=document.createElement("text"),r.innerHTML=n.nodeValue),e?e.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),e=r}}))}}async function Dr(e,t){const n=t.getAttribute("data-sample");if(""===n)return void It("Example is missing a schema id",Sr);const r=t.getAttribute("id")??`example-${n}`;t.setAttribute("id",r),t.removeAttribute("data-sample");const o=t.getAttribute("data-include-optional-fields")??"false",i=await async function(e,t,n=!1){try{const r=await fetch(`${Tr(e)}/sample/${t}?includeOptionalFields=${n}`,{method:"GET",headers:{"Content-Type":"application/json","X-Api-Key":Cr(e)}});return r.ok?await r.json():(It(`Could not get sampledata for ${t}: ${r.status}`,Sr),null)}catch(e){return It(`Could not get sample data for ${t}: ${e}`,Sr),null}}(e,n,o);if(i){const e=Qe`
         ${JSON.stringify(i,null,2)}
        -
        `;t.append(e)}else t.append(Qe`

        Could not get sample data. See developer console for details.

        `)}async function Lr(e,t,n){const r=t.getAttribute("data-model"),o=t.getAttribute("data-service-model"),i=t.getAttribute("data-source")??e.mps.source;if("CORE"!==i&&"SANDBOX"!==i)return void Nt(`Invalid source ${i} for model ${r}`);const a=t.getAttribute("title"),s=(await xr(e,i,r)).services.find((e=>e.id===o));if(s){const r=((e,t,n)=>{if(e)return t=t??`${e.name} Service Model`,n=(n??e.id).replace(/\./g,"-"),Qe`

        ${t}

        - ${e.documentation.issues.map(ir)} - ${e.documentation.notes.map(ar)}`})(s,a,n);if(r){let e=null;Array.from(r.childNodes).forEach((n=>{if("#comment"!==n.nodeName){let r=n;"#text"===n.nodeName&&(r=document.createElement("text"),r.innerHTML=n.nodeValue),e?e.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),e=r}}))}let o=[];s.interfaces.forEach((e=>{e.rootPath=s.rootPath,o.push(e)}));const i=t.getAttribute("data-interface-filter")??"";""!==i&&(o=o.filter((e=>e.id===i))),o.forEach((async n=>{let r=t.querySelector(`section[data-interface="${n.id}"]`);r?Er(e,r,n):(r=Qe` +
        `;t.append(e)}else t.append(Qe`

        Could not get sample data. See developer console for details.

        `)}async function Mr(e,t,n,r){t.setAttribute("id",`${n}-class-diagram`);const o=t.getAttribute("title"),i=t.getAttribute("data-package"),a=t.getAttribute("data-classes"),s=t.hasAttribute("data-class-diagram-omit-properties"),c=t.hasAttribute("data-class-diagram-hide-title"),l=await async function(e,t,n=!1,r=!1,o=null,i=null,a=null){try{let s=`?omitProperties=${n}&hideTitle=${r}`;o&&(s+=`&title=${o}`),i&&(s+=`&packageNames=${i}`),a&&(s+=`&classNames=${a}`);const c=await fetch(`${Tr(e)}/classdiagram/${t}${s}`,{method:"GET",headers:{"Content-Type":"text/markdown","X-Api-Key":Cr(e)}});return c.ok?await c.text():(It(`Could not get the class diagram for ${t}: ${c.status}`,Sr),null)}catch(e){return It(`Could not get the class diagram for ${t}: ${e}`,Sr),null}}(e,n,s,c,o,i,a),d=await ir(r,l,o);if(l&&d){let e=null;Array.from(d.childNodes).forEach((n=>{if("#comment"!==n.nodeName){let r=n;"#text"===n.nodeName&&(r=document.createElement("text"),r.innerHTML=n.nodeValue),e?e.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),e=r}}))}}var zr=Object.freeze({__proto__:null,name:Sr,run:async function(e){let t=new Array,n=0;const r=Array.from(document.querySelectorAll("section[data-model]"));if(0===r.length)return;const o=r.map((t=>{const n=t.getAttribute("data-model");return`${t.getAttribute("data-source")??e.mps.source}-${n}`})).filter(((e,t,n)=>n.indexOf(e)===t));t.push(...Array.from(o.map((t=>{const n=t.split("-");return Rr(e,n[0],n[1])})))),await Promise.all(t),t=new Array;const a=r.filter((e=>!(e.getAttribute("data-service-model")||e.getAttribute("data-stereotype")||e.getAttribute("data-schema-format")||e.hasAttribute("data-class-diagram")))),s=r.filter((e=>e.getAttribute("data-stereotype"))),c=r.filter((e=>e.getAttribute("data-service-model"))),l=r.filter((e=>e.getAttribute("data-schema-format"))),d=r.filter((e=>e.hasAttribute("data-class-diagram")));a.length>0&&t.push(...Array.from(a).map((async t=>{const r=t.getAttribute("data-model")??"";if(""===r)t.insertAdjacentElement("afterbegin",Qe`

        Missing Model id

        `),It("Cannot process DataModel sections without the Model id",Sr,{elements:[t]});else{t.setAttribute("id",`${r}.${n}`),n++;try{await async function(e,t,n){const r=t.getAttribute("data-source")??e.mps.source;if("CORE"!==r&&"SANDBOX"!==r)return void It(`Invalid source ${r} for model ${n}`);const o=t.getAttribute("title"),i=t.getAttribute("id"),a=t.getAttribute("data-package")??"",s=await Rr(e,r,n);if(s){const n=ur(s,o,i);if(n){let e=null;Array.from(n.childNodes).forEach((n=>{if("#comment"!==n.nodeName){let r=n;"#text"===n.nodeName&&(r=document.createElement("text"),r.innerHTML=n.nodeValue),e?e.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),e=r}}))}let r=Array.from(s.classes).filter((e=>"PrimitiveType"!==e.stereoType&&"DerivedType"!==e.stereoType));""!==a&&(r=r.filter((e=>e.documentation.packageName===a))),r.forEach((async n=>{let r=t.querySelector(`section[data-class="${n.id}"]`);r?Nr(e,r,n):(r=Qe`
        `,Nr(e,r,n),t.insertAdjacentElement("beforeend",r))}))}else t.insertAdjacentElement("afterbegin",Qe`

        ${n}

        `)}(e,t,r)}catch(e){It(`Cannot process DataModel ${r}: ${e}`,Sr)}}}))),s.length>0&&t.push(...Array.from(s).map((async t=>{const r=t.getAttribute("data-model")??"",o=t.getAttribute("data-stereotype")??"";if(""===r)t.insertAdjacentElement("afterbegin",Qe`

        Missing Model id

        `),It("Cannot process SteroType sections without the Model id",Sr,{elements:[t]});else if(""===o)t.insertAdjacentElement("afterbegin",Qe`

        Missing StereoType

        `),It("Cannot process SteroType sections without the StereoType",Sr,{elements:[t]});else{t.setAttribute("id",`${r}.${n}`),n++;try{await async function(e,t,n,r){const o=t.getAttribute("data-source")??e.mps.source;if("CORE"!==o&&"SANDBOX"!==o)return void It(`Invalid source ${o} for model ${n}`);const i=t.getAttribute("title"),a=t.getAttribute("id"),s=await Rr(e,o,n);if(s){const e=ur(s,i,a);if(e){let n=null;Array.from(e.childNodes).forEach((e=>{if("#comment"!==e.nodeName){let r=e;"#text"===e.nodeName&&(r=document.createElement("text"),r.innerHTML=e.nodeValue),n?n.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),n=r}}))}const n=kr(s,r);n&&t.insertAdjacentElement("beforeend",n)}else t.insertAdjacentElement("afterbegin",Qe`

        ${n}

        `)}(e,t,r,o)}catch(e){It(`Cannot process StereoType ${r} ${o}: ${e}`,Sr)}}}))),l.length>0&&t.push(...Array.from(l).map((async t=>{const r=t.getAttribute("data-model")??"",o=t.getAttribute("data-schema-format")?.toLowerCase()??"";if(""===r)t.insertAdjacentElement("afterbegin",Qe`

        Missing Model id

        `),It("Cannot process Schema sections without the Model id",Sr,{elements:[t]});else{t.setAttribute("id",`${r}.${n}`),n++;try{""===o||"json"===o?await async function(e,t,n){const r=t.getAttribute("data-source")??e.mps.source;if("CORE"!==r&&"SANDBOX"!==r)return void It(`Invalid source ${r} for model ${n}`);const o=t.getAttribute("title"),i=t.getAttribute("id"),a=t.getAttribute("data-package")??"",s=await Rr(e,r,n);if(s){const n=mr(s,o,i);if(n){let e=null;Array.from(n.childNodes).forEach((n=>{if("#comment"!==n.nodeName){let r=n;"#text"===n.nodeName&&(r=document.createElement("text"),r.innerHTML=n.nodeValue),e?e.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),e=r}}))}let r=Array.from(s.classes).filter((e=>"PrimitiveType"!==e.stereoType&&"DerivedType"!==e.stereoType));""!==a&&(r=r.filter((e=>e.documentation.packageName===a))),r.forEach((async n=>{let r=t.querySelector(`section[data-class="${n.id}"]`);r?Or(e,r,n):(r=Qe`
        `,Or(e,r,n),t.insertAdjacentElement("beforeend",r))}))}else t.insertAdjacentElement("afterbegin",Qe`

        ${n}

        `)}(e,t,r):await Pr(e,t,r)}catch(e){It(`Cannot process Schema for ${r}: ${e}`,Sr)}}}))),c.length>0&&t.push(...Array.from(c).map((async t=>{const r=t.getAttribute("data-model")??"",o=t.getAttribute("data-service-model")??"";if(""===r)t.insertAdjacentElement("afterbegin",Qe`

        Missing Model id

        `),It("Cannot process ServiceModel section without the Model id",Sr,{elements:[t]});else if(""===o)t.insertAdjacentElement("afterbegin",Qe`

        Missing ServiceModel id

        `),It("Cannot process ServiceModel section without the ServiceModel id",Sr,{elements:[t]});else{const o=t.getAttribute("id");t.setAttribute("id",`${r}.${n}`),n++;try{await async function(e,t,n){const r=t.getAttribute("data-model"),o=t.getAttribute("data-service-model"),i=t.getAttribute("data-source")??e.mps.source;if("CORE"!==i&&"SANDBOX"!==i)return void It(`Invalid source ${i} for model ${r}`);const a=t.getAttribute("title"),s=(await Rr(e,i,r)).services.find((e=>e.id===o));if(s){const r=xr(s,a,n);if(r){let e=null;Array.from(r.childNodes).forEach((n=>{if("#comment"!==n.nodeName){let r=n;"#text"===n.nodeName&&(r=document.createElement("text"),r.innerHTML=n.nodeValue),e?e.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),e=r}}))}let o=[];s.interfaces.forEach((e=>{e.rootPath=s.rootPath,o.push(e)}));const i=t.getAttribute("data-interface-filter")??"";""!==i&&(o=o.filter((e=>e.id===i))),o.forEach((async n=>{let r=t.querySelector(`section[data-interface="${n.id}"]`);r?Ir(e,r,n):(r=Qe`
        - `,Er(e,r,n),t.insertAdjacentElement("beforeend",r))}))}else t.insertAdjacentElement("afterbegin",Qe`

        ${r}

        `)}async function Nr(e,t,n,r){const o=t.getAttribute("data-source")??e.mps.source;if("CORE"!==o&&"SANDBOX"!==o)return void Nt(`Invalid source ${o} for model ${n}`);const i=t.getAttribute("title"),a=t.getAttribute("id"),s=await xr(e,o,n);if(s){const e=dr(s,i,a);if(e){let n=null;Array.from(e.childNodes).forEach((e=>{if("#comment"!==e.nodeName){let r=e;"#text"===e.nodeName&&(r=document.createElement("text"),r.innerHTML=e.nodeValue),n?n.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),n=r}}))}const n=((e,t)=>{const n=e.classes.filter((e=>e.stereoType===t)).sort(((e,t)=>{const n=e.name.toUpperCase(),r=t.name.toUpperCase();return nr?1:0}));if(n.length>0)return Qe` - - - - - - - - ${n.map(gr)} - -
        TypeDescription
        `})(s,r);n&&t.insertAdjacentElement("beforeend",n)}else t.insertAdjacentElement("afterbegin",Qe`

        ${n}

        `)}async function Rr(e,t,n,r){t.setAttribute("id",`${n}-class-diagram`);const o=t.getAttribute("title"),i=t.getAttribute("data-package"),a=t.getAttribute("data-classes"),s=t.hasAttribute("data-class-diagram-omit-properties"),c=t.hasAttribute("data-class-diagram-hide-title"),l=await async function(e,t,n=!1,r=!1,o=null,i=null,a=null){try{let s=`?omitProperties=${n}&hideTitle=${r}`;o&&(s+=`&title=${o}`),i&&(s+=`&packageNames=${i}`),a&&(s+=`&classNames=${a}`);const c=await fetch(`${vr(e)}/classdiagram/${t}${s}`,{method:"GET",headers:{"Content-Type":"text/markdown","X-Api-Key":wr(e)}});return c.ok?await c.text():(Nt(`Could not get the class diagram for ${t}: ${c.status}`,yr),null)}catch(e){return Nt(`Could not get the class diagram for ${t}: ${e}`,yr),null}}(e,n,s,c,o,i,a),d=await(async(e,t,n)=>{const{default:r}=await import("https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs");r.initialize({startOnLoad:!1});const{svg:o}=await r.render(`class-diagram-${e}`,t),i=o.trim().replace(/height="[0-9]*"/,"");return Qe`

        ${n}

        - ${i}`})(r,l,o);if(l&&d){let e=null;Array.from(d.childNodes).forEach((n=>{if("#comment"!==n.nodeName){let r=n;"#text"===n.nodeName&&(r=document.createElement("text"),r.innerHTML=n.nodeValue),e?e.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),e=r}}))}}var Ir=Object.freeze({__proto__:null,name:yr,run:async function(e){let t=new Array,n=0;const r=Array.from(document.querySelectorAll("section[data-model]"));if(0===r.length)return;const o=r.map((t=>{const n=t.getAttribute("data-model");return`${t.getAttribute("data-source")??e.mps.source}-${n}`})).filter(((e,t,n)=>n.indexOf(e)===t));t.push(...Array.from(o.map((t=>{const n=t.split("-");return xr(e,n[0],n[1])})))),await Promise.all(t),t=new Array;const i=r.filter((e=>!(e.getAttribute("data-service-model")||e.getAttribute("data-stereotype")||e.getAttribute("data-schema-format")||e.hasAttribute("data-class-diagram")))),a=r.filter((e=>e.getAttribute("data-stereotype"))),s=r.filter((e=>e.getAttribute("data-service-model"))),c=r.filter((e=>e.getAttribute("data-schema-format"))),l=r.filter((e=>e.hasAttribute("data-class-diagram")));i.length>0&&t.push(...Array.from(i).map((async t=>{const r=t.getAttribute("data-model")??"";if(""===r)t.insertAdjacentElement("afterbegin",Qe`

        Missing Model id

        `),Nt("Cannot process DataModel sections without the Model id",yr,{elements:[t]});else{t.setAttribute("id",`${r}.${n}`),n++;try{await async function(e,t,n){const r=t.getAttribute("data-source")??e.mps.source;if("CORE"!==r&&"SANDBOX"!==r)return void Nt(`Invalid source ${r} for model ${n}`);const o=t.getAttribute("title"),i=t.getAttribute("id"),a=t.getAttribute("data-package")??"",s=await xr(e,r,n);if(s){const n=dr(s,o,i);if(n){let e=null;Array.from(n.childNodes).forEach((n=>{if("#comment"!==n.nodeName){let r=n;"#text"===n.nodeName&&(r=document.createElement("text"),r.innerHTML=n.nodeValue),e?e.insertAdjacentElement("afterend",r):t.insertAdjacentElement("afterbegin",r),e=r}}))}let r=Array.from(s.classes).filter((e=>"PrimitiveType"!==e.stereoType&&"DerivedType"!==e.stereoType));""!==a&&(r=r.filter((e=>e.documentation.packageName===a))),r.forEach((async n=>{let r=t.querySelector(`section[data-class="${n.id}"]`);r?kr(e,r,n):(r=Qe`
        `,kr(e,r,n),t.insertAdjacentElement("beforeend",r))}))}else t.insertAdjacentElement("afterbegin",Qe`

        ${n}

        `)}(e,t,r)}catch(e){Nt(`Cannot process DataModel ${r}: ${e}`,yr)}}}))),a.length>0&&t.push(...Array.from(a).map((async t=>{const r=t.getAttribute("data-model")??"",o=t.getAttribute("data-stereotype")??"";if(""===r)t.insertAdjacentElement("afterbegin",Qe`

        Missing Model id

        `),Nt("Cannot process SteroType sections without the Model id",yr,{elements:[t]});else if(""===o)t.insertAdjacentElement("afterbegin",Qe`

        Missing StereoType

        `),Nt("Cannot process SteroType sections without the StereoType",yr,{elements:[t]});else{t.setAttribute("id",`${r}.${n}`),n++;try{await Nr(e,t,r,o)}catch(e){Nt(`Cannot process StereoType ${r} ${o}: ${e}`,yr)}}}))),c.length>0&&t.push(...Array.from(c).map((async t=>{const r=t.getAttribute("data-model")??"",o=t.getAttribute("data-schema-format")?.toLowerCase()??"";if(""===r)t.insertAdjacentElement("afterbegin",Qe`

        Missing Model id

        `),Nt("Cannot process Schema sections without the Model id",yr,{elements:[t]});else{t.setAttribute("id",`${r}.${n}`),n++;try{""===o||"json"===o?await Ar(e,t,r):await Sr(e,t,r)}catch(e){Nt(`Cannot process Schema for ${r}: ${e}`,yr)}}}))),s.length>0&&t.push(...Array.from(s).map((async t=>{const r=t.getAttribute("data-model")??"",o=t.getAttribute("data-service-model")??"";if(""===r)t.insertAdjacentElement("afterbegin",Qe`

        Missing Model id

        `),Nt("Cannot process ServiceModel section without the Model id",yr,{elements:[t]});else if(""===o)t.insertAdjacentElement("afterbegin",Qe`

        Missing ServiceModel id

        `),Nt("Cannot process ServiceModel section without the ServiceModel id",yr,{elements:[t]});else{const o=t.getAttribute("id");t.setAttribute("id",`${r}.${n}`),n++;try{await Lr(e,t,o)}catch(e){Nt(`Cannot process ServiceModel ${r}: ${e}`,yr)}}}))),l.length>0&&t.push(...Array.from(l).map((async t=>{const r=t.getAttribute("data-model")??"";if(""===r)t.insertAdjacentElement("afterbegin",Qe`

        Missing Model id

        `),Nt("Cannot process ClassDiagram section without the Model id",yr,{elements:[t]});else{t.setAttribute("id",`${r}.${n}`),n++;try{await Rr(e,t,r,n)}catch(e){Nt(`Cannot process ClassDiagram ${r}: ${e}`,yr)}}})));const d=document.querySelectorAll("[data-sample]");if(d&&t.push(...Array.from(d).map((async t=>{const n=t.getAttribute("data-sample");try{await Tr(e,t)}catch(e){Nt(`Cannot generate sample ${n}: ${e}`,yr)}}))),"function"==typeof window.ajv2019){const n=new window.ajv2019({allErrors:!0});!function(e){e.addFormat("byte",nr),e.addFormat("double",or),e.addFormat("float",or),e.addFormat("int32",nr),e.addFormat("int64",rr),e.addFormat("date",/^\d\d\d\d-[0-1]\d-[0-3]\d$/),e.addFormat("date-time",/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i),e.addFormat("uri",/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i),e.addFormat("uuid",/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i)}(n);const r=document.querySelectorAll("pre[data-schema]");r&&t.push(...Array.from(r).map((async t=>{const r=t.getAttribute("data-schema");try{await async function(e,t,n){const r=n.getAttribute("data-schema"),o=n.getAttribute("data-allowAdditionalProperties")??!0;if(""===r)return void Nt("Example is missing a schema id",yr);const i=await $r(e,r,o);if(null!==i)try{let e=n.innerText;e=e.replace(/\/\/ .*$/gm,"");const o=JSON.parse(e);void 0===t.refs[i.$id]&&t.compile(i);const a=t.refs[i.$id].validate;a(o)||(n.insertAdjacentElement("beforebegin",Qe`
        + `,Ir(e,r,n),t.insertAdjacentElement("beforeend",r))}))}else t.insertAdjacentElement("afterbegin",Qe`

        ${r}

        `)}(e,t,o)}catch(e){It(`Cannot process ServiceModel ${r}: ${e}`,Sr)}}}))),d.length>0&&t.push(...Array.from(d).map((async t=>{const r=t.getAttribute("data-model")??"";if(""===r)t.insertAdjacentElement("afterbegin",Qe`

        Missing Model id

        `),It("Cannot process ClassDiagram section without the Model id",Sr,{elements:[t]});else{t.setAttribute("id",`${r}.${n}`),n++;try{await Mr(e,t,r,n)}catch(e){It(`Cannot process ClassDiagram ${r}: ${e}`,Sr)}}})));const u=document.querySelectorAll("[data-sample]");if(u&&t.push(...Array.from(u).map((async t=>{const n=t.getAttribute("data-sample");try{await Dr(e,t)}catch(e){It(`Cannot generate sample ${n}: ${e}`,Sr)}}))),"function"==typeof window.ajv2019){const n=new window.ajv2019({allErrors:!0});!function(e){e.addFormat("byte",nr),e.addFormat("double",or),e.addFormat("float",or),e.addFormat("int32",nr),e.addFormat("int64",rr),e.addFormat("date",/^\d\d\d\d-[0-1]\d-[0-3]\d$/),e.addFormat("date-time",/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i),e.addFormat("uri",/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i),e.addFormat("uuid",/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i)}(n);const r=document.querySelectorAll("pre[data-schema]");r&&t.push(...Array.from(r).map((async t=>{const r=t.getAttribute("data-schema");try{await async function(e,t,n){const r=n.getAttribute("data-schema"),o=n.getAttribute("data-allowAdditionalProperties")??!0;if(""===r)return void It("Example is missing a schema id",Sr);const i=await Lr(e,r,o);if(null!==i)try{let e=n.innerText;e=e.replace(/\/\/ .*$/gm,"");const o=JSON.parse(e);void 0===t.refs[i.$id]&&t.compile(i);const a=t.refs[i.$id].validate;a(o)||(n.insertAdjacentElement("beforebegin",Qe`

        NOTE: This example contains invalid JSON for ${r}.

          ${a.errors.map((e=>{""===e.instancePath&&(e.instancePath="class");let t=`${e.instancePath}: ${e.message}`;return"additionalProperties"===e.keyword&&(t+=` (additional property: "${e.params.additionalProperty})"`),`
        • ${t}
        • `}))}
        -
        `),Nt(`Invalid example JSON for ${r}.`,yr))}catch(e){return void Nt(`Cannot parse example JSON for ${r}: ${e}`,yr)}}(e,n,t)}catch(e){Nt(`Cannot validate example ${r}: ${e}`,yr)}})))}await Promise.all(t),Array.from(document.querySelectorAll("section[data-model]")).map((t=>`${e.mps.source}-${t.getAttribute("data-model")}`)).forEach((e=>{sessionStorage.removeItem(e)})),qt("end-all",(()=>{const e=document.getElementById("initialUserConfig"),t=JSON.parse(e.innerHTML);"mps"in t&&(delete t.mdm,e.innerHTML=JSON.stringify(t,null,2))}))}});const Or=ht({en:{privacy_section_header:"Privacy",privacy_implications:"Privacy Implications",privacy_implications_paragraph:"All of the privacy implications contained within this Information Model are described in this Section. All of the corresponding concepts and methods for these privacy annotations are defined in the Privacy Framework.",confidentiality_level:"Confidentiality Level",confidentiality_level_paragram:"All of the privacy classification of the exchanged payloads are described in this Section.",ACCESSIBILITY_label:"Accessibility",ACCESSIBILITY_def:"denotes information about the accessibility personal needs and preferences of the user",ANALYTICS_label:"Analytics",ANALYTICS_def:"denotes information that will be used to support the creation of learning analytics",CONTAINER_label:"Container",CONTAINER_def:"denotes that the child attributes have privacy-sensitive information",CREDENTIALS_label:"Credentials",CREDENTIALS_def:"denotes access control information for the use e.g. password, private key, etc.",CREDENTIALSIDREF_label:"CredentialsIdRef",CREDENTIALSIDREF_def:"denotes reference to/use of an identifier to credentials information for the user",DEMOGRAPHICS_label:"Demographics",DEMOGRAPHICS_def:"denotes information about the demographics of the user e.g. ethnicity, gender, etc.",EXTENSION_label:"Extension",EXTENSION_def:"denotes that proprietary information can be included and so this MAY contain privacy-sensitive information",FINANCIAL_label:"Financial",FINANCIAL_def:"denotes that the information is of a financial nature e.g. bank account, financial aid status, etc.",IDENTIFIER_label:"Identifier",IDENTIFIER_def:"denotes a unique identifier that has been assigned, by some third party, to the user e.g. passport number, social security number, etc.",IDENTIFIERREF_label:"IdentifierRef",IDENTIFIERREF_def:"denotes reference to/use of a unique identifier that has been assigned, by some third party, to the user",INSURANCE_label:"Insurance/Assurance",INSURANCE_def:"denotes that the information is about the insurance life-assurance nature, e.g. type of insurance, etc.",LEGAL_label:"Legal",LEGAL_def:"denotes that the information is of a legal or judicial nature e.g. Will, prison record, etc.",MEDICAL_label:"Medical/Healthcare",MEDICAL_def:"denotes that the information is of a medical, or healthcare-related nature e.g. allergies, blood-type, mobility needs, etc.",NA_label:"N/A",NA_def:"denotes that there are NO PRIVACY IMPLICATIONS for this attribute (this is the default setting)",OTHER_label:"Other",OTHER_def:"denotes privacy sensitive information that is NOT covered by one of the other categories",QUALIFICATION_label:"Qualification/Certification",QUALIFICATION_def:"denotes that the information is about education qualifications, skill-set certifications, microcredentials, etc.",PERSONAL_label:"Personal",PERSONAL_def:"denotes personal information about the user e.g. name, address, etc.",SOURCEDID_label:"SourcedId",SOURCEDID_def:"denotes the interoperability unique identifier that has been assigned and MUST be present for the correct usage of the corresponding 1EdTech specification",SOURCEDIDREF_label:"SourcedIdRef",SOURCEDIDREF_def:"denotes reference to/use of the interoperability unique identifier, sourcedId, to link/point to an associated 1EdTech object",UNRESTRICTED_label:"unrestricted",UNRESTRICTED_def:"there are no privacy concerns (this is the default value).",NORMAL_label:"normal",NORMAL_def:"denotes that privacy sensitive data could be included and so all best practices to secure this data should be used.",RESTRICTED_label:"restricted",RESTRICTED_def:"denotes that some of the data is more sensitive than usual or that many attributes information that when used together create increased vulnerability for identification of the associated individual or group.",VERYRESTRICTED_label:"veryrestricted",VERYRESTRICTED_def:"denotes that the request could contain very sensitive privacy data. Depending on the capabilities of the Provider this very sensitive data may be obfuscated or may not even be present."}}),Pr=["ACCESSIBILITY","ANALYTICS","CONTAINER","CREDENTIALS","CREDENTIALSIDREF","DEMOGRAPHICS","EXTENSION","FINANCIAL","IDENTIFIER","IDENTIFIERREF","INSURANCE","LEGAL","MEDICAL","NA","OTHER","QUALIFICATION","PERSONAL","SOURCEDID","SOURCEDIDREF"],jr=["UNRESTRICTED","NORMAL","RESTRICTED","VERYRESTRICTED"];function Dr(e,t){return Qe`
        +
        `),It(`Invalid example JSON for ${r}.`,Sr))}catch(e){return void It(`Cannot parse example JSON for ${r}: ${e}`,Sr)}}(e,n,t)}catch(e){It(`Cannot validate example ${r}: ${e}`,Sr)}})))}await Promise.all(t),Array.from(document.querySelectorAll("section[data-model]")).map((t=>`${e.mps.source}-${t.getAttribute("data-model")}`)).forEach((e=>{sessionStorage.removeItem(e)})),i("end-all",(()=>{const e=document.getElementById("initialUserConfig"),t=JSON.parse(e.innerHTML);"mps"in t&&(delete t.mdm,e.innerHTML=JSON.stringify(t,null,2))}))}});const qr=gt({en:{privacy_section_header:"Privacy",privacy_implications:"Privacy Implications",privacy_implications_paragraph:"All of the privacy implications contained within this Information Model are described in this Section. All of the corresponding concepts and methods for these privacy annotations are defined in the Privacy Framework.",confidentiality_level:"Confidentiality Level",confidentiality_level_paragram:"All of the privacy classification of the exchanged payloads are described in this Section.",ACCESSIBILITY_label:"Accessibility",ACCESSIBILITY_def:"denotes information about the accessibility personal needs and preferences of the user",ANALYTICS_label:"Analytics",ANALYTICS_def:"denotes information that will be used to support the creation of learning analytics",CONTAINER_label:"Container",CONTAINER_def:"denotes that the child attributes have privacy-sensitive information",CREDENTIALS_label:"Credentials",CREDENTIALS_def:"denotes access control information for the use e.g. password, private key, etc.",CREDENTIALSIDREF_label:"CredentialsIdRef",CREDENTIALSIDREF_def:"denotes reference to/use of an identifier to credentials information for the user",DEMOGRAPHICS_label:"Demographics",DEMOGRAPHICS_def:"denotes information about the demographics of the user e.g. ethnicity, gender, etc.",EXTENSION_label:"Extension",EXTENSION_def:"denotes that proprietary information can be included and so this MAY contain privacy-sensitive information",FINANCIAL_label:"Financial",FINANCIAL_def:"denotes that the information is of a financial nature e.g. bank account, financial aid status, etc.",IDENTIFIER_label:"Identifier",IDENTIFIER_def:"denotes a unique identifier that has been assigned, by some third party, to the user e.g. passport number, social security number, etc.",IDENTIFIERREF_label:"IdentifierRef",IDENTIFIERREF_def:"denotes reference to/use of a unique identifier that has been assigned, by some third party, to the user",INSURANCE_label:"Insurance/Assurance",INSURANCE_def:"denotes that the information is about the insurance life-assurance nature, e.g. type of insurance, etc.",LEGAL_label:"Legal",LEGAL_def:"denotes that the information is of a legal or judicial nature e.g. Will, prison record, etc.",MEDICAL_label:"Medical/Healthcare",MEDICAL_def:"denotes that the information is of a medical, or healthcare-related nature e.g. allergies, blood-type, mobility needs, etc.",NA_label:"N/A",NA_def:"denotes that there are NO PRIVACY IMPLICATIONS for this attribute (this is the default setting)",OTHER_label:"Other",OTHER_def:"denotes privacy sensitive information that is NOT covered by one of the other categories",QUALIFICATION_label:"Qualification/Certification",QUALIFICATION_def:"denotes that the information is about education qualifications, skill-set certifications, microcredentials, etc.",PERSONAL_label:"Personal",PERSONAL_def:"denotes personal information about the user e.g. name, address, etc.",SOURCEDID_label:"SourcedId",SOURCEDID_def:"denotes the interoperability unique identifier that has been assigned and MUST be present for the correct usage of the corresponding 1EdTech specification",SOURCEDIDREF_label:"SourcedIdRef",SOURCEDIDREF_def:"denotes reference to/use of the interoperability unique identifier, sourcedId, to link/point to an associated 1EdTech object",UNRESTRICTED_label:"unrestricted",UNRESTRICTED_def:"there are no privacy concerns (this is the default value).",NORMAL_label:"normal",NORMAL_def:"denotes that privacy sensitive data could be included and so all best practices to secure this data should be used.",RESTRICTED_label:"restricted",RESTRICTED_def:"denotes that some of the data is more sensitive than usual or that many attributes information that when used together create increased vulnerability for identification of the associated individual or group.",VERYRESTRICTED_label:"veryrestricted",VERYRESTRICTED_def:"denotes that the request could contain very sensitive privacy data. Depending on the capabilities of the Provider this very sensitive data may be obfuscated or may not even be present."}}),Fr=["ACCESSIBILITY","ANALYTICS","CONTAINER","CREDENTIALS","CREDENTIALSIDREF","DEMOGRAPHICS","EXTENSION","FINANCIAL","IDENTIFIER","IDENTIFIERREF","INSURANCE","LEGAL","MEDICAL","NA","OTHER","QUALIFICATION","PERSONAL","SOURCEDID","SOURCEDIDREF"],Ur=["UNRESTRICTED","NORMAL","RESTRICTED","VERYRESTRICTED"];function Br(e,t){return Qe`

        ${e}

        ${t}

        -
        `}var zr=Object.freeze({__proto__:null,name:"1edtech/privacy",run:async function(e){if(!e.showPrivacyAnnotations)return;const t=document.querySelector("section#privacy-appendix")||Qe`
        `;document.querySelector("section#privacy-appendix > h2")||t.prepend(Qe`

        ${Or.privacy_section_header}

        `),t.classList.add("appendix");const n=Dr(Or.privacy_implications,Or.privacy_implications_paragraph);var r;n.appendChild((r=Or,Qe`
        - ${Pr.map((e=>Qe`
        + `}var Hr=Object.freeze({__proto__:null,name:"1edtech/privacy",run:async function(e){if(!e.showPrivacyAnnotations)return;const t=document.querySelector("section#privacy-appendix")||Qe`
        `;document.querySelector("section#privacy-appendix > h2")||t.prepend(Qe`

        ${qr.privacy_section_header}

        `),t.classList.add("appendix");const n=Br(qr.privacy_implications,qr.privacy_implications_paragraph);var r;n.appendChild((r=qr,Qe`
        + ${Fr.map((e=>Qe`
        ${r[e+"_label"]}
        ${r[e+"_def"]}
        `))} -
        `)),t.appendChild(n);const o=Dr(Or.confidentiality_level,Or.confidentiality_level_paragram);o.appendChild(((e,t)=>Qe`
        +
        `)),t.appendChild(n);const o=Br(qr.confidentiality_level,qr.confidentiality_level_paragram);o.appendChild(((e,t)=>Qe`
        ${e.map((e=>Qe`
        ${t[e+"_label"]}
        ${t[e+"_def"]}
        `))} -
        `)(jr,Or)),t.appendChild(o),document.body.appendChild(t)}});var Mr=Object.freeze({__proto__:null,name:"1edtech/post-markdown",run:async function(e){if("markdown"!==e.format)return;const t=document.body.querySelectorAll("md-only");for(let e=0;especStatus: "${e.specStatus}"`}}function Fr(e){if(e.key)return Qe` +
        `)(Ur,qr)),t.appendChild(o),document.body.appendChild(t)}});var Wr=Object.freeze({__proto__:null,name:"1edtech/post-markdown",run:async function(e){if("markdown"!==e.format)return;const t=document.body.querySelectorAll("md-only");for(let e=0;especStatus: "${e.specStatus}"`}}function Xr(e){if(e.key)return Qe` ${e.key} - ${e.data?e.data.map(Ur):Ur(e)} + ${e.data?e.data.map(Gr):Gr(e)}
        - `;Rt("Found a link without `key` attribute in the configuration. See dev console.","1edtech/templates/headers")}function Ur(e){return Qe` + `;Ot("Found a link without `key` attribute in the configuration. See dev console.",Yr)}function Gr(e){return Qe` ${e.href?Qe`${e.value||e.href}`:e.value} - `}function Br(e){return Qe`
        + `}function Zr(e){return Qe`

        IPR and Distribution Notice

        Recipients of this document are requested to submit, with their @@ -499,14 +498,14 @@ ${JSON.stringify(i,null,2)} - ${e.iprs.map(Hr)} + ${e.iprs.map(Jr)} - `}(e)}`}function Hr(e){return Qe` + `}(e)}`}function Jr(e){return Qe` ${e.company} ${e.electionDate} ${e.necessaryClaims} ${e.type} - `}var Wr=e=>Qe`

        + `}var Qr=e=>Qe`

        ${e.specTitle}

        ${e.errataURL} `:null} - ${e.otherLinks?e.otherLinks.map(Fr):""} + ${e.otherLinks?e.otherLinks.map(Xr):""} `:Qe` - + -
        Status:${qr(e)}${Kr(e)}
        `}(e)} ${Br(e)} ${function(e){return"proposal"===e.specType?Qe`
        + `}(e)} ${Zr(e)} ${function(e){return"proposal"===e.specType?Qe`

        Proposals

        Proposals are made available for the purposes of Project Group / Task @@ -621,74 +620,82 @@ ${JSON.stringify(i,null,2)}

        `} -
        `;var Vr=Object.freeze({__proto__:null,name:"1edtech/headers",run:async function(e){document.title=`${e.specTitle} ${e.specVersion??""} \n ${e.specStatus??""}`;const t=document.body,n=Wr(e);t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)}});var Yr=Object.freeze({__proto__:null,name:"core/id-headers",run:function(e){const t=document.querySelectorAll("section:not(.head):not(.introductory) h2, h3, h4, h5, h6");for(const n of t){let t=n.id;t||(yt(n),t=n.parentElement.id||n.id),e.addSectionLinks&&n.appendChild(Qe` - - `)}}});const Zr="1edtech/abstract";var Gr=Object.freeze({__proto__:null,name:Zr,run:async function(){let e=document.getElementById("abstract");if(!e){Rt('Document should have one element with `id="abstract"',Zr),e=Qe`
        +
        `;var eo=Object.freeze({__proto__:null,name:"1edtech/headers",run:async function(e){document.title=`${e.specTitle} ${e.specVersion??""} \n ${e.specStatus??""}`;const t=document.body,n=Qr(e);t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)}});const to=gt({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${mt(t.textContent)}`),n}}});var no=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||(vt(n),t=n.parentElement.id||n.id),!e.addSectionLinks)continue;const r=to.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=Qe`
        `;n.replaceWith(o);const i=Qe``;o.append(n,i)}}});const ro="1edtech/abstract";var oo=Object.freeze({__proto__:null,name:ro,run:async function(){let e=document.getElementById("abstract");e||(Ot("Document should have one element with 'abstract'",ro),e=Qe`

        To be removed

        -
        `,document.body.prepend(e)}e.tagName.startsWith("H")&&(e.removeAttribute("id"),e=e.parentElement,e.id="abstract"),"SECTION"===e.tagName&&(e.classList.contains("introductory")||e.classList.add("introductory"));let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent="Abstract",e.prepend(t))}});var Xr=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=gt(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const Kr="core/dfn-abbr";function Jr(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",` (${t})`);const o=e.dataset.lt||"";e.dataset.lt=o.split("|").filter((e=>e.trim())).concat(t).join("|")}var Qr=Object.freeze({__proto__:null,name:Kr,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)Jr(t);else{Nt(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,Kr,{elements:[t],title:"Error: unsupported."})}}}});function eo(e){const t=e.querySelectorAll(":scope > section");for(const e of t){if(!e.children.length)continue;if(!e.id){const t=e.children[0].textContent;if("conformance"==t.toLowerCase()||"conformance statements"==t.toLowerCase())return yt(e,null,"conformance"),e}const t=eo(e);if(t)return t}return null}var to=Object.freeze({__proto__:null,name:"1edtech/inlines",run:async function(e){if("errata"==e.specType)return;let t=document.querySelector("section#conformance");t||(t=eo(document.body))}});const no=/^[a-z]+(\s+[a-z]+)+\??$/,ro=/\B"([^"]*)"\B/,oo=/(\w+)\((.*)\)$/,io=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,ao=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,so=/^(?:\w+)\??$/,co=/^(\w+)\["([\w- ]*)"\]$/,lo=/\.?(\w+\(.*\)$)/,uo=/\/(.+)/,po=/\[\[.+\]\]/;function fo(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Qe``,document.body.prepend(e)),e.tagName.startsWith("H")&&(e.removeAttribute("id"),e=e.parentElement,e.id="abstract"),"SECTION"===e.tagName&&(e.classList.contains("introductory")||e.classList.add("introductory"));let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent="Abstract",e.prepend(t))}});var io=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=yt(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const ao="core/dfn-abbr";function so(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",` (${t})`);const o=e.dataset.lt||"";e.dataset.lt=o.split("|").filter((e=>e.trim())).concat(t).join("|")}var co=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)so(t);else{It(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,ao,{elements:[t],title:"Error: unsupported."})}}}});function lo(e){const t=e.querySelectorAll(":scope > section");for(const e of t){if(!e.children.length)continue;if(!e.id){const t=e.children[0].textContent;if("conformance"==t.toLowerCase()||"conformance statements"==t.toLowerCase())return vt(e,null,"conformance"),e}const t=lo(e);if(t)return t}return null}var uo=Object.freeze({__proto__:null,name:"1edtech/inlines",run:async function(e){if("errata"==e.specType)return;let t=document.querySelector("section#conformance");t||(t=lo(document.body))}});const po=/^[a-z]+(\s+[a-z]+)+\??$/,fo=/\B"([^"]*)"\B/,ho=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,mo=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,go=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,bo=/^(?:\w+)\??$/,yo=/^(\w+)\["([\w- ]*)"\]$/,wo=/\.?(\w+\(.*\)$)/,vo=/\/(.+)/,$o=/\[\[.+\]\]/;function xo(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Qe`${t+(r?"?":"")}`}function ho(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:i}=e,{identifier:a}=n||{},s="method"===r,c=s?Qe`(${bt(i,mo)})`:null,l=s?`(${i.join(", ")})`:"";return Qe`${n&&o?".":""}`}function ko(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:i}=e,{identifier:a}=n||{},s="method"===r,c=s?Qe`(${wt(i,Eo)})`:null,l=s?`(${i.join(", ")})`:"";return Qe`${n&&o?".":""}[[${t}]]${c}`}function mo(e,t,n){if(t${e}`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,i=o?r[2]:r[0];return Qe`${o?"...":null}${i}`}function go(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return Qe`${r?".":""}`}function Eo(e,t,n){if(t${e}`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,i=o?r[2]:r[0];return Qe`${o?"...":null}${i}`}function Ao(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return Qe`${r?".":""}${n}`}function bo(e){const{args:t,identifier:n,type:r,parent:o,renderParent:i}=e,{identifier:a}=o||{},s=bt(t,mo),c=`${n}(${t.join(", ")})`;return Qe`${o&&i?".":""}`}function _o(e){const{args:t,identifier:n,type:r,parent:o,renderParent:i}=e,{renderText:a,renderArgs:s}=e,{identifier:c}=o||{},l=wt(s||t,Eo),d=`${n}(${t.join(", ")})`;return Qe`${o&&i?".":""}${n}(${s})`}function yo(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return Qe`"${a||n}${!a||s?Qe`(${l})`:""}`}function So(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return Qe`"${n}"`}function wo(e){const{identifier:t}=e;return Qe`""`}function Co(e){const{identifier:t}=e;return Qe`"${t}"`}function vo(e){const{identifier:t,nullable:n}=e;return Qe`"`}function To(e){const{identifier:t,nullable:n}=e;return Qe`${t+(n?"?":"")}`}function $o(e){let t;try{t=function(e){const t=po.test(e),n=t?uo:lo,[r,o]=e.split(n);if(t&&r&&!o)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const i=r.split(/[./]/).concat(o).filter((e=>e&&e.trim())).map((e=>e.trim())),a=!e.includes("/"),s=[];for(;i.length;){const t=i.pop();if(oo.test(t)){const[,e,n]=t.match(oo),r=n.split(/,\s*/).filter((e=>e));s.push({type:"method",identifier:e,args:r,renderParent:a})}else if(co.test(t)){const[,e,n]=t.match(co);s.push({type:"enum",identifier:e,enumValue:n,renderParent:a})}else if(ro.test(t)){const[,e]=t.match(ro);a?s.push({type:"exception",identifier:e}):s.push({type:"enum",enumValue:e,renderParent:a})}else if(io.test(t)){const[,e,n]=t.match(io),r=n?"method":"attribute",o=n?.slice(1,-1).split(/,\s*/).filter((e=>e));s.push({type:"internal-slot",slotType:r,identifier:e,args:o,renderParent:a})}else if(ao.test(t)&&i.length){const[,e]=t.match(ao);s.push({type:"attribute",identifier:e,renderParent:a})}else if(no.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;s.push({type:"idl-primitive",identifier:n,renderParent:a,nullable:e})}else{if(!so.test(t)||0!==i.length)throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``);{const e=t.endsWith("?"),n=e?t.slice(0,-1):t;s.push({type:"base",identifier:n,renderParent:a,nullable:e})}}}return s.forEach(((e,t,n)=>{e.parent=n[t+1]||null})),s.reverse()}(e)}catch(t){const n=Qe`{{ ${e} }}`,r="Error: Invalid inline IDL string.";return Nt(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=fo(e);t&&r.push(t);break}case"attribute":r.push(go(e));break;case"internal-slot":r.push(ho(e));break;case"method":r.push(bo(e));break;case"enum":r.push(yo(e));break;case"exception":r.push(wo(e));break;case"idl-primitive":r.push(vo(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const xo=new Set(["alias","reference"]),ko=async function(){const e=await Je.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,o=IDBKeyRange.lowerBound(t);let i=await r.openCursor(o);for(;i?.value;){const e=i.value;(void 0===e.expires||e.expiresn[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){if((await this.get(e,t.id))?.expiresn.objectStore(e).clear()));await Promise.all(r)}},_o={},Ao=new URL("https://api.specref.org/bibrefs?refs="),So=at({hint:"dns-prefetch",href:Ao.origin});let Co;document.head.appendChild(So);const To=new Promise((e=>{Co=e}));async function Lo(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(Ao.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(),i=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),i):i;await Eo.addAll(o,e)}catch(e){console.error(e)}return o}async function No(e){const t=await To;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await No(n.aliasOf):n}var Ro=Object.freeze({__proto__:null,biblio:_o,name:"core/biblio",updateFromNetwork:Lo,resolveRef:No,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=_o;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 Eo.ready;const n=e.map((async e=>({id:e,data:await Eo.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=>{_o[e.id]=e.data}));const i=o.noData.map((e=>e.id));if(i.length){const e=await Lo(i,{forceUpdate:!0});Object.assign(_o,e)}Object.assign(_o,this.conf.localBiblio),(()=>{Co(this.conf.biblio)})()}}});const Io="core/render-biblio",Oo=ht({en:{info_references:"Informative references",norm_references:"Normative references",references:"References"},ko:{references:"참조"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias"},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:"参考文献"}}),Po=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["FPWD","W3C First Public Working Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Note"],["PER","W3C Proposed Edited Recommendation"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"],["WG-NOTE","W3C Working Group Note"]]),jo=(Do=".",e=>{const t=e.trim();return!t||t.endsWith(Do)?t:t+Do});var Do;function zo(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(Mo)),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),i=o.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),a=Qe`
        + >`}function Lo(e){let t;try{t=function(e){const t=$o.test(e),n=t?vo:wo,[r,o]=e.split(n);if(t&&r&&!o)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const i=r.split(/[./]/).concat(o).filter((e=>e&&e.trim())).map((e=>e.trim())),a=!e.includes("/"),s=[];for(;i.length;){const t=i.pop();if(ho.test(t)){const[,e,n,r,o]=t.match(ho),i=n.split(/,\s*/).filter((e=>e)),c=r?.trim(),l=o?.split(/,\s*/).filter((e=>e));s.push({type:"method",identifier:e,args:i,renderParent:a,renderText:c,renderArgs:l})}else if(yo.test(t)){const[,e,n]=t.match(yo);s.push({type:"enum",identifier:e,enumValue:n,renderParent:a})}else if(fo.test(t)){const[,e]=t.match(fo);a?s.push({type:"exception",identifier:e}):s.push({type:"enum",enumValue:e,renderParent:a})}else if(mo.test(t)){const[,e,n]=t.match(mo),r=n?"method":"attribute",o=n?.slice(1,-1).split(/,\s*/).filter((e=>e));s.push({type:"internal-slot",slotType:r,identifier:e,args:o,renderParent:a})}else if(go.test(t)&&i.length){const[,e]=t.match(go);s.push({type:"attribute",identifier:e,renderParent:a})}else if(po.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;s.push({type:"idl-primitive",identifier:n,renderParent:a,nullable:e})}else{if(!bo.test(t)||0!==i.length)throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``);{const e=t.endsWith("?"),n=e?t.slice(0,-1):t;s.push({type:"base",identifier:n,renderParent:a,nullable:e})}}}return s.forEach(((e,t,n)=>{e.parent=n[t+1]||null})),s.reverse()}(e)}catch(t){const n=Qe`{{ ${e} }}`,r="Error: Invalid inline IDL string.";return It(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=xo(e);t&&r.push(t);break}case"attribute":r.push(Ao(e));break;case"internal-slot":r.push(ko(e));break;case"method":r.push(_o(e));break;case"enum":r.push(So(e));break;case"exception":r.push(Co(e));break;case"idl-primitive":r.push(To(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Ro=new Set(["alias","reference"]),No=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[...Ro]){const r=e.transaction(n,"readwrite").store,o=IDBKeyRange.lowerBound(t);let i=await r.openCursor(o);for(;i?.value;){const e=i.value;(void 0===e.expires||e.expiresn[e].map((t=>this.add(e,t)))));await Promise.all(r)},async add(e,t){if(!Ro.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?.expiresn.objectStore(e).clear()));await Promise.all(r)}},Oo={},Po=new URL("https://api.specref.org/bibrefs?refs="),jo=st({hint:"dns-prefetch",href:Po.origin});let Do;document.head.appendChild(jo);const Mo=new Promise((e=>{Do=e}));async function zo(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(Po.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(),i=Date.now()+36e5;try{const e=r.headers.has("Expires")?Math.min(Date.parse(r.headers.get("Expires")),i):i;await Io.addAll(o,e)}catch(e){console.error(e)}return o}async function qo(e){const t=await Mo;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await qo(n.aliasOf):n}var Fo=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=Oo;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 Io.ready;const n=e.map((async e=>({id:e,data:await Io.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=>{Oo[e.id]=e.data}));const i=o.noData.map((e=>e.id));if(i.length){const e=await zo(i,{forceUpdate:!0});Object.assign(Oo,e)}Object.assign(Oo,this.conf.localBiblio),(()=>{Do(this.conf.biblio)})()}},biblio:Oo,name:"core/biblio",resolveRef:qo,updateFromNetwork:zo});const Uo="core/render-biblio",Bo=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:"参考文献"}}),Ho=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"]]),Wo=(Vo=".",e=>{const t=e.trim();return!t||t.endsWith(Vo)?t:t+Vo});var Vo;function Yo(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(Ko)),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),i=o.concat(r).sort(((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase()))),a=Qe`

        ${t}

        -
        ${i.map(Fo)}
        -
        `;yt(a,"",t);const s=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,s),function(e){e.forEach((({ref:e})=>{const t=[...document.querySelectorAll(`a.bibref[href="#bib-${e.toLowerCase()}"]`)].filter((({textContent:t})=>t.toLowerCase()===e.toLowerCase()));Nt(`Bad reference: [\`${e}\`] (appears ${t.length} times)`,Io),console.warn("Bad references: ",t)}))}(r),a}function Mo(e){let t=_o[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}\`].`,Io)}else n=t.aliasOf,t=_o[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function qo(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,o=Qe`${i.map(Go)} +
        `;vt(a,"",t);const s=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,s),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()));It(`Reference "[${t}]" not found.`,Uo,{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),a}function Ko(e){let t=Oo[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;It(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,Uo)}else n=t.aliasOf,t=Oo[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function Xo(e,t){const n=e.replace(/^(!|\?)/,""),r=`#bib-${n.toLowerCase()}`,o=Qe`${t||n}`;return t?o:Qe`[${o}]`}function Fo({ref:e,refcontent:t}){const n=`bib-${e.toLowerCase()}`;return t?Qe` -
        [${e}]
        -
        ${{html:Uo(t)}}
        - `:Qe` -
        [${e}]
        -
        Reference not found.
        - `}function Uo(e){if("string"==typeof e)return e;let t=`${e.title}`;return t=e.href?`${t}. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${jo(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${Po.get(e.status)||e.status}. `),e.href&&(t+=`URL: ${e.href}`),t}var Bo=Object.freeze({__proto__:null,name:Io,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`
        `;if(document.querySelector("section#references > h2")||r.prepend(Qe`

        ${Oo.references}

        `),r.classList.add("appendix"),n.length){const e=zo(n,Oo.norm_references);r.appendChild(e)}if(t.length){const e=zo(t,Oo.info_references);r.appendChild(e)}document.body.appendChild(r)},renderInlineCitation:qo});const Ho="core/inlines",Wo={},Vo=e=>new RegExp(e.map((e=>e.source)).join("|")),Yo=ht({en:{rfc2119Keywords:()=>Vo([/\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:()=>Vo([/\bMUSS\b/,/\bERFORDERLICH\b/,/\b(?:NICHT\s+)?NÖTIG\b/,/\bDARF(?:\s+NICHT)?\b/,/\bVERBOTEN\b/,/\bSOLL(?:\s+NICHT)?\b/,/\b(?:NICHT\s+)?EMPFOHLEN\b/,/\bKANN\b/,/\bOPTIONAL\b/])}}),Zo=/(?:`[^`]+`)(?!`)/,Go=/(?:{{[^}]+\?*}})/,Xo=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,Ko=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,Jo=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Qo=/(?:\[=[^=]+=\])/,ei=/(?:\[\^[^^]+\^\])/;function ti(e){const t=e.slice(2,-2).trim(),[n,r,o]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[i,a,s]=t.startsWith("/")?["element-attr",null,n]:o?["attr-value",`${n}/${r}`,o]:r?["element-attr",n,r]:["element",null,n];return Qe``;return t?o:Qe`[${o}]`}function Go(e){const{ref:t,refcontent:n}=e,r=`bib-${t.toLowerCase()}`;return Qe` +
        [${t}]
        +
        + ${n?{html:Zo(n)}:Qe`${Bo.reference_not_found}`} +
        + `}function Zo(e){if("string"==typeof e)return e;let t=`${e.title}`;return t=e.href?`
        ${t}. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${Wo(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${Ho.get(e.status)||e.status}. `),e.href&&(t+=`URL: ${e.href}`),t}var Jo=Object.freeze({__proto__:null,name:Uo,renderInlineCitation:Xo,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`
        `;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(Qe`

        ${Bo.references}

        `),r.classList.add("appendix"),n.length){const e=Yo(n,Bo.norm_references);r.appendChild(e)}if(t.length){const e=Yo(t,Bo.info_references);r.appendChild(e)}document.body.appendChild(r)}});const Qo="core/inlines",ei={},ti=e=>new RegExp(e.map((e=>e.source)).join("|")),ni=gt({en:{rfc2119Keywords:()=>ti([/\bMUST(?:\s+NOT)?\b/,/\bSHOULD(?:\s+NOT)?\b/,/\bSHALL(?:\s+NOT)?\b/,/\bMAY\b/,/\b(?:NOT\s+)?REQUIRED\b/,/\b(?:NOT\s+)?RECOMMENDED\b/,/\bOPTIONAL\b/])},de:{rfc2119Keywords:()=>ti([/\bMUSS\b/,/\bMÜSSEN\b/,/\bERFORDERLICH\b/,/\b(?:NICHT\s+)?NÖTIG\b/,/\bDARF(?:\s+NICHT)?\b/,/\bDÜRFEN(?:\s+NICHT)?\b/,/\bVERBOTEN\b/,/\bSOLL(?:\s+NICHT)?\b/,/\bSOLLEN(?:\s+NICHT)?\b/,/\b(?:NICHT\s+)?EMPFOHLEN\b/,/\bKANN\b/,/\bKÖNNEN\b/,/\bOPTIONAL\b/])}}),ri=/(?:`[^`]+`)(?!`)/,oi=/(?:{{[^}]+\?*}})/,ii=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,ai=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,si=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,ci=/(?:\[=[^=]+=\])/,li=/(?:\[\^[^^]+\^\])/;function di(e){const t=e.slice(2,-2).trim(),[n,r,o]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[i,a,s]=t.startsWith("/")?["element-attr",null,n]:o?["attr-value",`${n}/${r}`,o]:r?["element-attr",n,r]:["element",null,n];return Qe`${s}`}function ni(e){const t=ft(e),n=Qe`${t}`;return Wo[t]=!0,n}function ri(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?Qe``:Qe``}function oi(e,t){const n=ft(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=$o(n);return!!t.parentElement.closest("dfn")?li(`\`${r.textContent}\``):r}function ii(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,i]=r.split("|").map(ft),{type:a,illegal:s}=$t(o,t.parentElement),c=qo(o,i),l=o.replace(/^(!|\?)/,"");if(s&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;Rt("Normative references in informative sections are not allowed. ",Ho,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==a||s?n.normativeReferences.add(l):n.informativeReferences.add(l),c.childNodes[1]?c.childNodes:[c]}function ai(e,t,n){return"ABBR"===t.parentElement.tagName?e:Qe`${e}`}function si(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return Qe`${n}`}function ci(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),i=n.substring(r+1,n.length);return[t(o),t(i)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[o,i]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],a=di(i),s=n?ft(n):null;return Qe``}function ui(e){const t=mt(e),n=Qe`${t}`;return ei[t]=!0,n}function pi(e){const t=e.slice(3,-3).trim();return t.startsWith("#")?Qe``:Qe``}function fi(e,t){const n=mt(e.slice(2,-2));if(n.startsWith("\\"))return e.replace("\\","");const r=Lo(n);return!!t.parentElement.closest("dfn")?yi(`\`${r.textContent}\``):r}function hi(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,i]=r.split("|").map(mt),{type:a,illegal:s}=kt(o,t.parentElement),c=Xo(o,i),l=o.replace(/^(!|\?)/,"");if(s&&!n.normativeReferences.has(l)){const e=c.childNodes[1]||c;Ot("Normative references in informative sections are not allowed. ",Qo,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==a||s?n.normativeReferences.add(l):n.informativeReferences.add(l),c.childNodes[1]?c.childNodes:[c]}function mi(e,t,n){return"ABBR"===t.parentElement.tagName?e:Qe`${e}`}function gi(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map((e=>e.trim()));return Qe`${n}`}function bi(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),i=n.substring(r+1,n.length);return[t(o),t(i)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[o,i]=r.includes("|")?r.split("|",2).map((e=>e.trim())):[null,r],a=wi(i),s=n?mt(n):null;return Qe`${a}`}function li(e){const t=e.slice(1,-1);return Qe`${t}`}function di(e){return Zo.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?li(e):di(e))):document.createTextNode(e)}var ui=Object.freeze({__proto__:null,name:Ho,rfc2119Usage:Wo,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=Wo);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)),i=[];let a;for(;a=o.nextNode();)i.push(a);return i}(document.body,["#respec-ui",".head","pre"],{wsNodes:!1}),i=Yo.rfc2119Keywords(),a=new RegExp(`(${Vo([i,Go,Xo,Ko,Jo,Qo,Zo,ei,...r?[r]:[]]).source})`);for(const n of o){const r=n.data.split(a);if(1===r.length)continue;const o=document.createDocumentFragment();let s=!0;for(const a of r)if(s=!s,s)switch(!0){case a.startsWith("{{"):o.append(oi(a,n));break;case a.startsWith("[[["):o.append(ri(a));break;case a.startsWith("[["):o.append(...ii(a,n,e));break;case a.startsWith("|"):o.append(si(a));break;case a.startsWith("[="):o.append(ci(a));break;case a.startsWith("`"):o.append(li(a));break;case a.startsWith("[^"):o.append(ti(a));break;case t.has(a):o.append(ai(a,n,t));break;case i.test(a):o.append(ni(a))}else o.append(a);n.replaceWith(o)}}});function pi(e){Wo.MUST=!0,Wo["MUST NOT"]=!0,Wo.REQUIRED=!0,Wo.SHALL=!0,Wo["SHALL NOT"]=!0,Wo.SHOULD=!0,Wo["SHOULD NOT"]=!0,Wo.RECOMMENDED=!0,Wo.MAY=!0,Wo.OPTIONAL=!0;const t=[...Object.keys(Wo)],n=(r=t.sort(),[].concat(lt(r,(e=>Qe`${e}`))).map((e=>"string"==typeof e?Qe`${e}`:e)));var r;const o=t.length>1,i=Qe`

        + >`}function yi(e){const t=e.slice(1,-1);return Qe`${t}`}function wi(e){return ri.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?yi(e):wi(e))):document.createTextNode(e)}var vi=Object.freeze({__proto__:null,name:Qo,rfc2119Usage:ei,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new St,e.informativeReferences=new St,e.respecRFC2119||(e.respecRFC2119=ei);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)),i=[];let a;for(;a=o.nextNode();)i.push(a);return i}(document.body,["#respec-ui",".head","pre","svg"],{wsNodes:!1}),i=ni.rfc2119Keywords(),a=new RegExp(`(${ti([i,oi,ii,ai,si,ci,ri,li,...r?[r]:[]]).source})`);for(const n of o){const r=n.data.split(a);if(1===r.length)continue;const o=document.createDocumentFragment();let s=!0;for(const a of r)if(s=!s,s)switch(!0){case a.startsWith("{{"):o.append(fi(a,n));break;case a.startsWith("[[["):o.append(pi(a));break;case a.startsWith("[["):o.append(...hi(a,n,e));break;case a.startsWith("|"):o.append(gi(a));break;case a.startsWith("[="):o.append(bi(a));break;case a.startsWith("`"):o.append(yi(a));break;case a.startsWith("[^"):o.append(di(a));break;case t.has(a):o.append(mi(a,n,t));break;case i.test(a):o.append(ui(a))}else o.append(a);n.replaceWith(o)}}});const $i="1edtech/conformance";function xi(e){ei.MUST=!0,ei["MUST NOT"]=!0,ei.REQUIRED=!0,ei.SHALL=!0,ei["SHALL NOT"]=!0,ei.SHOULD=!0,ei["SHOULD NOT"]=!0,ei.RECOMMENDED=!0,ei.MAY=!0,ei.OPTIONAL=!0;const t=[...Object.keys(ei)],n=(r=t.sort(),[].concat(dt(r,(e=>Qe`${e}`))).map((e=>"string"==typeof e?Qe`${e}`:e)));var r;const o=t.length>1,i=Qe`

        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. @@ -697,7 +704,7 @@ ${JSON.stringify(i,null,2)}

        The key word${o?"s":""} ${[n]} in this document ${o?"are":"is"} to be interpreted as described in - ${qo("RFC2119")}. + ${Xo("RFC2119")}.

        `:null}

        @@ -713,52 +720,51 @@ ${JSON.stringify(i,null,2)} The Conformance and Certification Guide for this specification may introduce greater normative constraints than those defined here for specific service or implementation categories. -

        `}function fi(e,t){let n;t.normativeReferences.add("RFC2119"),"normative"===t.specNature?n=pi(t):"informative"===t.specNature&&(n=function(e){return e.mainSpecTitle||Rt("warn","No mainSpecTitle property found in config')"),e.mainSpecBiblioKey||Rt("warn","No mainSpecBiblioKey property found in config')"),Qe`

        +

        `}function ki(e,t){let n;t.normativeReferences.add("RFC2119"),"normative"===t.specNature?n=xi(t):"informative"===t.specNature&&(n=function(e){return e.mainSpecTitle||Ot("No mainSpecTitle property found in config')",$i),e.mainSpecBiblioKey||Ot("No mainSpecBiblioKey property found in config')",$i),Qe`

        This document is an informative resource in the Document Set of the ${e.mainSpecTitle?e.mainSpecTitle:""} specification - ${e.mainSpecBiblioKey?qo(e.mainSpecBiblioKey):""}. + ${e.mainSpecBiblioKey?Xo(e.mainSpecBiblioKey):""}. As such, it does not include any normative requirements. Occurrences in this document of terms such as MAY, MUST, MUST NOT, SHOULD or RECOMMENDED have no impact on the conformance criteria for implementors of this specification. -

        `}(t)),"SECTION"===e.tagName?e.prepend(...n.childNodes):e.parentNode.append(...n.childNodes)}var hi=Object.freeze({__proto__:null,name:"1edtech/conformance",run:function(e){if("errata"===e.specType)return;let t=document.querySelector("section#conformance");if(t||(t=document.querySelector("section#conformance-0")),t){if(e.specNature||Nt("error","Document must have config.specNature set"),"SECTION"===t.tagName){const e=t.querySelector("h1, h2, h3, h4, h5, h6");e?t=e:Rt("warn","No heading found in the conformance section")}fi(t,e)}else{if("doc"===e.specType)return;Nt("error","No section found with id 'conformance'")}}});function mi(e,t,n,r){try{switch(t){case"attribute":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 gi(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 bi=new Tt;function yi(e,t){for(const n of t)bi.has(n)||bi.set(n,new Set),bi.get(n).add(e)}const wi="core/dfn",vi=new Map([["abstract-op",{requiresFor:!1}],["attribute",{requiresFor:!1,validator:mi}],["attr-value",{requiresFor:!0,associateWith:"an HTML attribute",validator:gi}],["element",{requiresFor:!1,validator:mi}],["element-state",{requiresFor:!0,associateWith:"an HTML attribute",validator:gi}],["event",{requiresFor:!1,validator:gi}],["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:gi}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?gi(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)}}]]),$i=[...vi.keys()];function xi(e,t){let n="";switch(!0){case $i.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>vi.has(e))),function(e,t,n){const r=vi.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=jt`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,i=jt`Use a ${"[data-dfn-for]"} attribute to associate this with ${o}.`;Nt(e,wi,{hint:i,elements:[n]})}r.validator&&r.validator(e,t,n,wi)}(t,n,e);break;case io.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.`,wi,{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:i}=t.dataset;if(!o.includes(i)||r!==i){const n=jt`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,i=`The only allowed types are: ${function(e,{quotes:t}={quotes:!1}){return pt(e,t?e=>It(Pt(e)):It)}(o,{quotes:!0})}. The slot "${e}" seems to be a "${It(r)}"?`;return Nt(n,wi,{hint:i,elements:[t]}),"dfn"}return i}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){n=e.closest("[data-dfn-type]")?.dataset.dfnType}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function ki(e){switch(!0){case e.matches(".export.no-export"):Nt(jt`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,wi,{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.`,wi,{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=""}}function Ei(){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=""}var _i=Object.freeze({__proto__:null,name:wi,run:function(){for(const e of document.querySelectorAll("dfn")){const t=wt(e);if(yi(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;xi(e,n),ki(e),1===t.length&&n===ft(e.textContent)||(e.dataset.lt=t.join("|"))}qt("plugins-done",Ei)}});var Ai=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;return document.querySelectorAll("dfn:not([data-lt-noDefault])").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("|"),yi(e,n)}}))}});var Si=String.raw`span.example-title{text-transform:none} +

        `}(t)),"SECTION"===e.tagName?e.prepend(...n.childNodes):e.parentNode.parentNode.append(...n.childNodes)}var Ei=Object.freeze({__proto__:null,name:$i,run:function(e){if("errata"===e.specType)return;let t=document.querySelector("section#conformance");if(t||(t=document.querySelector("section#conformance-0")),t){if(e.specNature||It("Document must have config.specNature set",$i),"SECTION"===t.tagName){const e=t.querySelector("h1, h2, h3, h4, h5, h6");e?t=e:Ot("No heading found in the conformance section",$i)}ki(t,e)}else{if("doc"===e.specType)return;It("No section found with id 'conformance'",$i)}}});function Ai(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){It(`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 _i(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return It(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const Si=new Rt;function Ci(e,t){for(const n of t)Si.has(n)||Si.set(n,new Set),Si.get(n).add(e)}const Ti="core/dfn",Li=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:_i}],["element",{requiresFor:!1,validator:Ai}],["element-attr",{requiresFor:!1,validator:Ai}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:_i}],["event",{requiresFor:!1,validator:_i}],["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 It(`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:_i}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?_i(e.slice(1,-1),t,n,r):(It(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Ri=[...Li.keys()];function Ni(e,t){let n="";switch(!0){case Ri.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>Li.has(e))),function(e,t,n){const r=Li.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=zt`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,i=zt`Use a ${"[data-dfn-for]"} attribute to associate this with ${o}.`;It(e,Ti,{hint:i,elements:[n]})}r.validator&&r.validator(e,t,n,Ti)}(t,n,e);break;case mo.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.`;It(`Internal slot "${e}" must be associated with a WebIDL interface.`,Ti,{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:i}=t.dataset;if(!o.includes(i)||r!==i){const n=zt`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,i=`The only allowed types are: ${function(e,{quotes:t}={quotes:!1}){return ft(e,t?e=>jt(Mt(e)):jt)}(o,{quotes:!0})}. The slot "${e}" seems to be a "${jt(r)}"?`;return It(n,Ti,{hint:i,elements:[t]}),"dfn"}return i}(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 Ii(e){switch(!0){case e.matches(".export.no-export"):It(zt`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Ti,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){It(zt`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Ti,{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 Oi=Object.freeze({__proto__:null,name:Ti,run:function(){for(const e of document.querySelectorAll("dfn")){const t=$t(e);if(Ci(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;Ni(e,n),Ii(e),1===t.length&&n===mt(e.textContent)||(e.dataset.lt=t.join("|"))}}});var Pi=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("|"),Ci(e,n)}}))}});var ji=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} -:is(aside,div).example{border-left-width:.5em;border-left-style:solid;border-color:#e0cb52;background:#fcfaee} -aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff} -.example pre{background-color:rgba(0,0,0,.03)}`;const Ci=ht({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"}});function Ti(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?Qe`: ${n.title}`:"";return Qe`
        - ${Ci.example}${r}0?` ${t}`:"",o=n.title?Qe`: ${n.title}`:"";return Qe``}var Li=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``,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=Ti(e,t,r);e.prepend(n);const i=yt(e,"example",o||String(t));n.querySelector("a.self-link").href=`#${i}`,Mt("example",r)}else{const n=!!e.closest("aside");n||++t,r.content=e.innerHTML,e.classList.remove("example","illegal-example");const i=e.id?e.id:null;i&&e.removeAttribute("id");const a=Ti(e,n?0:t,r),s=Qe`
        +
        `}var zi=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``,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=Mi(e,t,r);e.prepend(n);const i=vt(e,"example",o||String(t));n.querySelector("a.self-link").href=`#${i}`}else{const n=!!e.closest("aside");n||++t,r.content=e.innerHTML,e.classList.remove("example","illegal-example");const i=e.id?e.id:null;i&&e.removeAttribute("id");const a=Mi(e,n?0:t,r),s=Qe`
        ${a} ${e.cloneNode(!0)} -
        `;yt(s,"example",o||String(t));s.querySelector("a.self-link").href=`#${s.id}`,e.replaceWith(s),n||Mt("example",r)}}))}});var Ni=String.raw`.issue-label{text-transform:initial} +
        `;vt(s,"example",o||String(t));s.querySelector("a.self-link").href=`#${s.id}`,e.replaceWith(s)}}))}});var qi=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} .issue.closed span.issue-number{text-decoration:line-through} -.warning{border-color:#f11;border-width:.2em;border-style:solid;background:#fbe9e9} +.issue.closed span.issue-number::after{content:" (Closed)";font-size:smaller} +.warning{border-color:#f11;border-color:var(--warning-border,#f11);border-width:.2em;border-style:solid;background:#fbe9e9;background:var(--warning-bg,#fbe9e9);color:#000;color:var(--text,#000)} .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 Ri="core/issues-notes",Ii=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 Oi(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:i,displayType:a,isFeatureAtRisk:s}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),o=e.classList.contains("atrisk"),i=t?"issue":n?"warning":r?"ednote":"note",a=t?o?Ii.feature_at_risk:Ii.issue:n?Ii.warning:r?Ii.editors_note:Ii.note;return{type:i,displayType:a,isFeatureAtRisk:o}}(e),c="issue"===i,l="span"===e.localName,{number:d}=e.dataset,u={type:i,inline:l,title:e.title,number:r(e)};if(!l){const r=Qe`
        `,l=document.createElement("span"),p=Qe`
        ${l}
        `;yt(p,"h",i);let f,h=a;if(e.id?(r.id=e.id,e.removeAttribute("id")):yt(r,"issue-container",u.number?`number-${u.number}`:""),c){if(void 0!==u.number&&(h+=` ${u.number}`),e.dataset.hasOwnProperty("number")){const e=function(e,t,{isFeatureAtRisk:n=!1}={}){if(!n&&t.issueBase)return Qe``;if(n&&t.atRiskBase)return Qe``}(d,n,{isFeatureAtRisk:s});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),f=t.get(d),!f){Rt(`Failed to fetch issue number ${d}.`,Ri)}f&&!u.title&&(u.title=f.title)}void 0!==u.number&&o.append(function(e,t,n){const r=`${e} ${t.number}`,o=t.title?Qe`: ${t.title}`:"";return Qe`
      5. ${r}${o}
      6. `}(Ii.issue,u,r.id))}if(l.textContent=h,u.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 i=(s=n,parseInt(s,16)>8388607.5?"#000":"#fff"),a=`GitHub label: ${r}`;var s;return Qe` {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:i,displayType:a,isFeatureAtRisk:s}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),o=e.classList.contains("atrisk"),i=t?"issue":n?"warning":r?"ednote":"note",a=t?o?Ui.feature_at_risk:Ui.issue:n?Ui.warning:r?Ui.editors_note:Ui.note;return{type:i,displayType:a,isFeatureAtRisk:o}}(e),c="issue"===i,l="span"===e.localName,{number:d}=e.dataset,u={type:i,inline:l,title:e.title,number:r(e)};if(!l){const r=Qe`
        `,l=document.createElement("span"),p=Qe`
        ${l}
        `;vt(p,"h",i);let f,h=a;if(e.id?(r.id=e.id,e.removeAttribute("id")):vt(r,"issue-container",u.number?`number-${u.number}`:""),c){if(void 0!==u.number&&(h+=` ${u.number}`),e.dataset.hasOwnProperty("number")){const e=function(e,t,{isFeatureAtRisk:n=!1}={}){if(!n&&t.issueBase)return Qe`
        `;if(n&&t.atRiskBase)return Qe``}(d,n,{isFeatureAtRisk:s});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),f=t.get(d),!f){Ot(`Failed to fetch issue number ${d}.`,Fi)}f&&!u.title&&(u.title=f.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?Qe`: ${t.title}`:"";return Qe`
      7. ${r}${o}
      8. `}(Ui.issue,u,r.id))}if(l.textContent=h,u.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 i=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[o,i,a]=[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*i+.0722*a>.179?"#000":"#fff"}(n),a=`background-color: #${n}; color: ${i}`,s=`GitHub label: ${r}`;return Qe` ${r}`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return Qe`: ${t}${r}`}(o,u.title,t))}let m=e;e.replaceWith(r),m.classList.remove(i),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)}Mt(u.type,u)})),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`

        ${Ii.no_issues_in_spec}

        `),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`

        ${Ii.issue_summary}

        `)}(o)}var Pi=Object.freeze({__proto__:null,name:Ri,run:async function(e){const t=document.querySelectorAll(".issue, .note, .warning, .ednote");if(!t.length)return;const n=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}).`,Ri),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github),{head:r}=document;r.insertBefore(Qe``,r.querySelector("link")),Oi(t,n,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});var ji=Object.freeze({__proto__:null,name:"1edtech/issues-notes",run:async function(e){document.body.querySelectorAll("aside.issue, div.aside.issue").length>0&&("Final Release"==e.specStatus?Mt("error","Issue asides must not be present when the status is 'Final Release'"):"Candidate Final"==e.specStatus&&Mt("warn","Issue asides should not be present when the status is 'Candidate Final'")),document.body.querySelectorAll("aside.note, aside.ednote, aside.warning, aside.issue, div.aside.note, div.aside.ednote div.aside.warning, div.aside.issue").forEach((e=>{const t=function(e){if(e.classList.contains("note"))return"note";if(e.classList.contains("warning"))return"warning";if(e.classList.contains("issue"))return"issue";return"info"}(e);e.setAttribute("role","note"),e.classList.add("admonition"),e.hasAttribute("id")||yt(e);const n=Wn(`
        ${t}
        `).parentElement.firstElementChild;n.classList.add(`${t}-title`),e.insertAdjacentElement("afterbegin",n)}))}});const Di="core/best-practices",zi={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},Mi=ht(zi),qi=o in zi?o:"en";var Fi=Object.freeze({__proto__:null,name:Di,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=yt(e,"bp"),o=Qe`${Mi.best_practice}${t+1}`;if(n){const t=Qe`
      9. ${o}: ${At(e)}
      10. `;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const a=Qe`${o.cloneNode(!0)}: ${e}`;i.prepend(...a.childNodes)})),e.length)t&&(t.appendChild(Qe`

        Best Practices Summary

        `),t.appendChild(n));else if(t){Rt("Using best practices summary (#bp-summary) but no best practices found.",Di),t.remove()}}});const Ui="core/figures",Bi=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 Hi=Object.freeze({__proto__:null,name:Ui,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)}));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;yt(e,"fig",r),xt(t,Qe``),t.prepend(Bi.fig,Qe`${n+1}`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{vt(e,"span").removeAttribute("href")})),Qe`
      11. + >`}(e,n)));r.length&&r.unshift(document.createTextNode(" "));return Qe`: ${t}${r}`}(o,u.title,t))}let m=e;e.replaceWith(r),m.classList.remove(i),m.removeAttribute("data-number"),f&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(f.bodyHTML)),r.append(p,m);const g=At(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`

        ${Ui.no_issues_in_spec}

        `),(!n||n&&n!==t.firstElementChild)&&t.insertAdjacentHTML("afterbegin",`

        ${Ui.issue_summary}

        `)}(o)}var Hi=Object.freeze({__proto__:null,name:Fi,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 It(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,Fi),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github),{head:o}=document;o.insertBefore(Qe``,o.querySelector("link")),Bi(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});var Wi=Object.freeze({__proto__:null,name:"1edtech/issues-notes",run:async function(e){document.body.querySelectorAll("aside.issue, div.aside.issue").length>0&&("Final Release"==e.specStatus?o("error","Issue asides must not be present when the status is 'Final Release'"):"Candidate Final"==e.specStatus&&o("warn","Issue asides should not be present when the status is 'Candidate Final'")),document.body.querySelectorAll("aside.note, aside.ednote, aside.warning, aside.issue, div.aside.note, div.aside.ednote div.aside.warning, div.aside.issue").forEach((e=>{const t=function(e){if(e.classList.contains("note"))return"note";if(e.classList.contains("warning"))return"warning";if(e.classList.contains("issue"))return"issue";return"info"}(e);e.setAttribute("role","note"),e.classList.add("admonition"),e.hasAttribute("id")||vt(e);const n=qn(`
        ${t}
        `).parentElement.firstElementChild;n.classList.add(`${t}-title`),e.insertAdjacentElement("afterbegin",n)}))}});const Vi="core/best-practices",Yi={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},Ki=gt(Yi),Xi=l in Yi?l:"en";var Gi=Object.freeze({__proto__:null,name:Vi,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=vt(e,"bp"),o=Qe`${Ki.best_practice}${t+1}`;if(n){const t=Qe`
      12. ${o}: ${Ct(e)}
      13. `;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const a=Qe`${o.cloneNode(!0)}: ${e}`;i.prepend(...a.childNodes)})),e.length)t&&(t.appendChild(Qe`

        Best Practices Summary

        `),t.appendChild(n));else if(t){Ot("Using best practices summary (#bp-summary) but no best practices found.",Vi),t.remove()}}});const Zi="core/figures",Ji=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 Qi=Object.freeze({__proto__:null,name:Zi,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;vt(e,"fig",r),Et(t,Qe``),t.prepend(Qe`${Ji.fig}${n+1}`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{xt(e,"span").removeAttribute("href")})),Qe`
      14. ${n.childNodes} -
      15. `}(t.id,r));else{Rt("Found a `
        ` without a `
        `.",Ui,{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`

        ${Bi.list_of_figures}

        `,Qe``))}});const ea="1edtech/biblio";var ta=Object.freeze({__proto__:null,name:ea,run:async function(e){let t="https://purl.imsglobal.org/spec/ims-biblio.json";if(e.overrideIMSbiblioLocation&&(t=e.overrideIMSbiblioLocation),!e.disableFetchIMSbiblio)try{const n=await fetch(t,{mode:"cors"});if(!n.ok)throw new Error(n.statusText);const r=await n.json();e.localBiblio=Object.assign(e.localBiblio||{},r)}catch(e){Ot("Failed to fetch IMS biblio data: "+e.toString(),ea)}}});const na="core/data-cite",ra="__SPEC__";async function oa(e){const{key:t,frag:n,path:r,href:o}=e;let i="",a="";if(t===ra)i=document.location.href;else{const e=await qo(t);if(!e)return null;i=e.href,a=e.title}if(o)i=o;else{if(r){const e=r.startsWith("/")?`.${r}`:r;i=new URL(e,i).href}n&&(i=new URL(n,i).href)}return{href:i,title:a}}function ia(e,t,n){const{href:r,title:o}=t,i=!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,i){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?Et(e,t):(t.textContent=o,e.append(t)),i){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){It("Exporting a linked external definition is not allowed.",na,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function aa(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const sa=aa("#"),ca=aa("/");function la(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:o,citeHref:i}=t;if(n.startsWith("#")&&!r){const r=e.parentElement.closest('[data-cite]:not([data-cite^="#"])'),{key:o,isNormative:i}=r?la(r):{key:ra,isNormative:!1};return t.cite=i?o:`?${o}`,t.citeFrag=n.replace("#",""),la(e)}const a=r?`#${r}`:sa(n),s=o||ca(n).split("#")[0],{type:c}=kt(n,e),l="normative"===c,d=/^[?|!]/.test(n);return{key:n.split(/[/|#]/)[0].substring(Number(d)),isNormative:l,frag:a,path:s,href:i}}function da(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 ua=Object.freeze({__proto__:null,THIS_SPEC:ra,name:na,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(la).map((async e=>({entry:e,result:await qo(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await zo(n);r&&Object.assign(Oo,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=la(t),r=await oa(n);if(r)ia(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),Ot(n,na,{elements:[t]})}}i("beforesave",da)},toCiteDetails:la});const pa="core/link-to-dfn",fa=[],ha=gt({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 ma(e){const t=new Map,n=[];for(const r of Si.get(e)){const{dfnType:o="dfn"}=r.dataset,i=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const a of i){if(t.has(a)&&t.get(a).has(o)){const e=t.get(a).get(o),i="dfn"===e.localName,s="dfn"===r.localName,c=o===(e.dataset.dfnType||"dfn"),l=!a&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(a);if(i&&s&&c&&l){n.push(r);continue}}t.has(a)||t.set(a,new Map),t.get(a).set(o,r),("idl"in r.dataset||"dfn"!==o)&&t.get(a).set("idl",r),vt(r,"dfn",e)}}return{result:t,duplicates:n}}function ga(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"";return $t(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 ba(e,t,n){let r=!1;const{linkFor:o}=e.dataset,{dfnFor:i}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(o&&!n.get(o)&&i&&!i.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=ya(e)&&ya(t,n);r&&!o||Et(e,document.createElement("code"))}(e,t),!r}function ya(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 wa(e){e.forEach((e=>{Ot(`Found linkless \`\` element with text "${e.textContent}" but no matching \`\``,pa,{title:"Linking error: not matching ``",elements:[e]})}))}var va=Object.freeze({__proto__:null,name:pa,possibleExternalLinks:fa,run:async function(e){const t=function(){const e=new Rt;for(const t of Si.keys()){const{result:n,duplicates:r}=ma(t);e.set(t,n),r.length>0&&It(ha.duplicateMsg(t),pa,{title:ha.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){fa.push(e);continue}const r=ga(e,t);if(r){ba(e,r,t)||fa.push(e)}else""===e.dataset.cite?n.push(e):fa.push(e)}wa(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${ra}$2`);const{key:r,isNormative:o}=la(t);r!==ra&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||wa(fa)}});const $a="xrefs",xa=3e5;async function ka(){return await et.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach((t=>e.deleteObjectStore(t)));e.createObjectStore($a,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function Ea(e){const t=new Map;if(await async function(){const e="XREF:LAST_VERSION_CHECK",t=parseInt(localStorage.getItem(e),10),n=Date.now();if(!t)return localStorage.setItem(e,n.toString()),!1;if(n-tt}())return await async function(){try{await ka().then((e=>e.clear($a)))}catch(e){console.error(e)}}(),t;const n=new Set(e.map((e=>e.id)));try{const e=await ka();let r=await e.transaction($a).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 Aa="core/xref",_a={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},Sa="https://respec.org/xref/",Ca=[];if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=st({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function Ta(e){const t="xrefType"in e.dataset;let n=La(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),o=function(e,t){if(t)return e.dataset.xrefType?e.dataset.xrefType.split("|"):["_IDL_"];return["_CONCEPT_"]}(e,t),i=function(e,t){if(e.dataset.xrefFor)return mt(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return mt(t.dataset.xrefFor)}return null}(e,t);return{id:"",term:n,types:o,...r.length&&{specs:r},..."string"==typeof i&&{for:i}}}function La(e){const{lt:t}=e.dataset;let n=t?t.split("|",1)[0]:e.textContent;return n=mt(n),"the-empty-string"===n?"":n}function Ra(e,t,n,r){const{term:o,specs:i=[]}=t,{uri:a,shortname:s,spec:c,normative:l,type:d,for:u}=n,p=i.flat().includes(c)?c:s,f=new URL(a,"https://partial"),{pathname:h}=f,m={cite:p,citePath:h,citeFrag:f.hash.slice(1),type:d};u&&(m.linkFor=u[0]),f.origin&&"https://partial"!==f.origin&&(m.citeHref=f.href),Object.assign(e.dataset,m),function(e,t,n,r,o){const i=function(e){const t=e.closest(".normative"),n=e.closest(at);return!n||e===t||t&&n&&n.contains(t)}(e);if(!i)return void(o.normativeReferences.has(t)||o.informativeReferences.add(t));if(n){const e=o.informativeReferences.has(t)?o.informativeReferences.getCanonicalKey(t):t;return o.normativeReferences.add(e),void o.informativeReferences.delete(e)}Ca.push({term:r,spec:t,element:e})}(e,p,l,o,r)}function Na(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(Ia)}function Ia(e){return[...new Uint8Array(e)].map((e=>e.toString(16).padStart(2,"0"))).join("")}function Oa(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 Pa=Object.freeze({__proto__:null,API_URL:Sa,getTermFromElement:La,informativeRefsInNormative:Ca,name:Aa,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:new URL("search/",Sa).href,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":e.toLowerCase()in _a?Object.assign(n,{specs:_a[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 _a){const r=(e.specs??[]).concat(_a[t]);Object.assign(n,{specs:r})}else r(e.profile)}break;default:It(`Invalid value for \`xref\` configuration option. Received: "${e}".`,Aa)}return n;function r(e){It(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${ft(Object.keys(_a),(e=>`"${e}"`))}.`,Aa)}}(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=fa.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=Ta(e);t.id=await Na(t),r.push(t)}const o=await async function(e,t){const n=new Set,r=e.filter((e=>!n.has(e.id)&&(n.add(e.id)&&!0))),o=await Ea(r),i=r.filter((e=>!o.get(e.id))),a=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),o=await r.json();return new Map(o.results.map((({id:e,result:t})=>[e,t])))}(i,t);a.size&&await async function(e,t){try{const n=(await ka()).transaction($a,"readwrite");for(const r of e){const e=t.get(r.id);n.objectStore($a).add({query:r,result:e})}await n.done}catch(e){console.error(e)}}(r,a);return new Map([...o,...a])}(r,t.url);!function(e,t,n,r){const o={ambiguous:new Map,notFound:new Map};for(let i=0,a=e.length;i{const r=new URL(Sa);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)=>zt`[See search matches for "${t}"](${e}) or ${"[Learn about this error|#error-term-not-found]"}.`;for(const{query:e,elems:o}of t.values()){const t=e.specs?[...new Set(e.specs.flat())].sort():[],i=La(o[0]),a=n(i,e),s=pt(t,(e=>`**[${e}]**`)),c=r(a,i);It(`Couldn't find "**${i}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${s}.`,Aa,{title:"No matching definition found.",elements:o,hint:c})}for(const{query:t,elems:o,results:i}of e.values()){const e=[...new Set(i.map((e=>e.shortname)))].sort(),a=pt(e,(e=>`**[${e}]**`)),s=La(o[0]),c=n(s,t,e),l=t.for?`, for **"${t.for}"**, `:"",d=r(c,s),u=zt`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification.`+String.raw` ${d}`;It(`The term "**${s}**"${l} is ambiguous because it's defined in ${a}.`,Aa,{title:"Definition is ambiguous.",elements:o,hint:u})}}(o)}(n,r,o,e),i("beforesave",Oa)}});var ja=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} @@ -766,65 +772,79 @@ ul.index code{color:inherit} #index-defined-here .print-only{display:none} @media print{ #index-defined-here .print-only{display:initial} -}`;const Aa=ht({en:{heading:"Index",headingExternal:"Terms defined by reference",headlingLocal:"Terms defined by this specification",dfnOf:"definition of"}}),Sa=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function Ca(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function Ta(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?t.dataset.dfnFor:""}function La(e,t,n=""){if(n.startsWith("[[")){return`internal slot for ${Ta(e)}`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for ${Ta(e)}`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for ${Ta(e)}`;default:return""}}function Na(){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 Qe`${t}`})(e.dataset.id))))}function Ra(){const e=new Set,t=new Map,n=document.querySelectorAll("a[data-cite]");for(const r of n){if(!r.dataset.cite)continue;const n=r.href;if(e.has(n))continue;const{type:o,linkFor:i}=r.dataset,a=wa(r);if(!a)continue;const s=Qi(r).key.toUpperCase();(t.get(s)||t.set(s,[]).get(s)).push({term:a,type:o,linkFor:i,elem:r}),e.add(n)}return t}function Ia(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let o=t;Sa.has(n)&&("extended-attribute"===n&&(o=`[${o}]`),o=`${o}`);const i=Pa.has(t)?"type":Oa.get(n);i&&(o+=` ${i}`);if(r){let e=r;/\s/.test(r)||(e=`${e}`),"element-attr"===n&&(e+=" element"),o+=` (for ${e})`}return o}(e);return Qe`
      16. +}`;const Da=gt({en:{heading:"Index",headingExternal:"Terms defined by reference",headlingLocal:"Terms defined by this specification",dfnOf:"definition of"}}),Ma=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function za(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function qa(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?t.dataset.dfnFor:""}function Fa(e,t,n=""){if(n.startsWith("[[")){return`internal slot for ${qa(e)}`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for ${qa(e)}`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for ${qa(e)}`;default:return""}}function Ua(){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 Qe`${t}`})(e.dataset.id))))}function Ba(){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:o,xrefType:i,linkType:a}=r.dataset;if(!(i||a||n.includes("#")||o))continue;const s=r.href;if(e.has(s))continue;const{type:c,linkFor:l}=r.dataset,d=La(r);if(!d)continue;const u=la(r).key.toUpperCase();(t.get(u)||t.set(u,[]).get(u)).push({term:d,type:c,linkFor:l,elem:r}),e.add(s)}return t}function Ha(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let o=ht(t);Ma.has(n)&&("extended-attribute"===n&&(o=`[${o}]`),o=`${o}`);const i=Va.has(t)?"type":Wa.get(n);i&&(o+=` ${i}`);if(r){let e=r;/\s/.test(r)||(e=`${e}`),"element-attr"===n&&(e+=" element"),o+=` (for ${e})`}return o}(e);return Qe`
      17. ${{html:n}} -
      18. `}const Oa=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),Pa=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 ja(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 Da=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return;const t=document.createElement("style");t.textContent=_a,document.head.appendChild(t),e.classList.add("appendix"),e.querySelector("h2")||e.prepend(Qe`

        ${Aa.heading}

        `);const n=Qe`
        -

        ${Aa.headlingLocal}

        - ${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=ft(n.textContent);(e.get(t)||e.set(t,[]).get(t)).push(n)}return[...e].sort((([e],[t])=>e.slice(e.search(/\w/)).localeCompare(t.slice(t.search(/\w/)))))}();return Qe`
        `;e.append(r);for(const e of r.querySelectorAll(".index-term"))vt(e,"index-term");i("toc",Ua,{once:!0}),i("beforesave",Ya)}});var Xa=Object.freeze({__proto__:null,name:"1edtech/contrib",run:async function(e){if(e.contributors&&"errata"!==e.specType){const t=function(e){let t=!1;return e.forEach((e=>{e.role&&e.role.trim().length>0&&(t=!0)})),t}(e.contributors),n=qn(`
        \n

        List of Contributors

        \n

        The following individuals contributed to the development of this document:

        \n \n \n \n \n ${t?"":""}\n \n \n ${function(e,t){let n="";return e.forEach((e=>{n+=``,n+="",t&&(n+=""),n+=""})),n}(e.contributors,t)}\n \n
        NameOrganizationRole
        ${e.name}",e.company&&(n+=e.company),n+="",e.role&&(n+=e.role),n+="
        \n
        `);document.body.appendChild(n)}}});var Ga=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 Za=["h2","h3","h4","h5","h6"],Ja="core/structure",Qa=gt({en:{toc:"Table of Contents"},zh:{toc:"内容大纲"},ko:{toc:"목차"},ja:{toc:"目次"},nl:{toc:"Inhoudsopgave"},es:{toc:"Tabla de Contenidos"},de:{toc:"Inhaltsverzeichnis"}});function es(e,t,{prefix:n=""}={}){let r=!1,o=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const a=Qe`
          `;for(const s of e){!s.isAppendix||n||r||(o=i,r=!0);let e=s.isIntro?"":r?ts(i-o+1):n+i;const c=e.split(".").length;if(1===c&&(e+=".",s.header.before(document.createComment("OddPage"))),s.isIntro||(i+=1,s.header.prepend(Qe`${e} `)),c<=t){const n=s.header.id||s.element.id,r=rs(s.header,n),o=es(s.subsections,t,{prefix:e});o&&r.append(o),a.append(r)}}return a}function ts(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(!Za.includes(r.localName))continue;const o=r.textContent;vt(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 rs(e,t){const n=Qe`
          `;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")})),Qe`
        1. ${n}
        2. `}var os=Object.freeze({__proto__:null,name:Ja,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(At(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)){It("`data-max-toc` must have a value between 0-6 (inclusive).",Ja,{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=es(ns(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=Qe``,n=Qe`

          ${Qa.toc}

          `;vt(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`
          `;document.body.append(o)}(t)}Mt("toc")}});const Za=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 Ga=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`

          ${Za.informative}

          `)}))}});var Xa=String.raw`.caniuse-stats{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:baseline} -button.caniuse-cell{margin:1px 1px 0 0;border:none} -.caniuse-browser{position:relative} -@media print{ -.caniuse-cell.y::before{content:"✔️";padding:.5em} -.caniuse-cell.n::before{content:"❌";padding:.5em} -.caniuse-cell:is(.a,.d,.p,.x)::before{content:"⚠️";padding:.5em} -} -.caniuse-browser ul{display:none;margin:0;padding:0;list-style:none;position:absolute;left:0;z-index:2;background:#fff;margin-top:1px} -.caniuse-stats a[href]{white-space:nowrap;align-self:center;margin-left:.5em} -.caniuse-cell{display:flex;font-size:90%;height:.8cm;margin-right:1px;margin-top:0;min-width:3cm;overflow:visible;justify-content:center;align-items:center;--supported:#2a8436;--no-support:#c44230;--no-support-alt:#b43b2b;--partial:#807301;--partial-alt:#746c00;color:#fff;background:repeating-linear-gradient(var(--caniuse-angle,45deg),var(--caniuse-bg) 0,var(--caniuse-bg-alt) 1px,var(--caniuse-bg-alt) .4em,var(--caniuse-bg) calc(.25em + 1px),var(--caniuse-bg) .75em)} -li.caniuse-cell{margin-bottom:1px} -.caniuse-cell:focus{outline:0} +

          `;document.body.append(o)}(t)}o("toc")}});const is=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 as=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`

          ${is.informative}

          `)}))}});var ss=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} +.caniuse-type span{background-color:var(--bg,#fff);padding:0 .4em} +.caniuse-cell{align-items:center;border-radius:1cm;color:#fff;display:flex;font-size:90%;min-width:1.5cm;padding:.3rem;justify-content:space-evenly;--supported:#2a8436dd;--no-support:#c44230dd;--no-support-alt:#b43b2bdd;--partial:#807301dd;--partial-alt:#746c00dd;--unknown:#757575;background:repeating-linear-gradient(var(--caniuse-angle,45deg),var(--caniuse-bg) 0,var(--caniuse-bg-alt) 1px,var(--caniuse-bg-alt) .4em,var(--caniuse-bg) calc(.25em + 1px),var(--caniuse-bg) .75em)} +img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0} +.caniuse-cell span.browser-version{margin-left:.4em;text-shadow:0 0 .1em #fff;font-weight:100;font-size:.9em} +.caniuse-stats a[href]{white-space:nowrap;align-self:flex-end} .caniuse-cell.y{background:var(--supported)} .caniuse-cell:is(.n,.d){--caniuse-angle:45deg;--caniuse-bg:var(--no-support);--caniuse-bg-alt:var(--no-support-alt)} +.caniuse-cell.u{background:var(--unknown)} .caniuse-cell.d{--caniuse-angle:180deg} .caniuse-cell:is(.a,.x,.p){--caniuse-angle:90deg;--caniuse-bg:var(--partial);--caniuse-bg-alt:var(--partial-alt)} -.caniuse-stats .caniuse-browser:hover>ul,.caniuse-stats button:focus+ul{display:block}`;const Ka="core/caniuse",Ja=new Set(["and_chr","and_ff","and_uc","android","bb","chrome","edge","firefox","ie","ios_saf","op_mini","op_mob","opera","safari","samsung"]);async function Qa(e,t){const{feature:n,versions:r,browsers:o}=t,i=new URLSearchParams;i.set("feature",n),i.set("versions",r),Array.isArray(o)&&i.set("browsers",o.join(",")),i.set("format","html");const a=`${e}?${i.toString()}`,s=await fetch(a);if(!s.ok){const{status:e,statusText:t}=s;throw new Error(`Failed to get caniuse data: (${e}) ${t}`)}return await s.text()}var es=Object.freeze({__proto__:null,name:Ka,prepare:function(e){if(!e.caniuse)return;const t=function(e){const t={versions:4,removeOnSave:!1};if("string"==typeof e.caniuse)return{feature:e.caniuse,...t};const n={...t,...e.caniuse},{browsers:r}=n;if(Array.isArray(r)){const e=r.filter((e=>!Ja.has(e)));if(e.length){Rt(jt`Invalid browser(s): (${Ot(e,{quotes:!0})}) in the \`browser\` property of ${"[caniuse]"}.`,Ka)}}return n}(e);if(e.caniuse=t,!t.feature)return;document.head.appendChild(Qe``);const n=t.apiURL||"https://respec.org/caniuse/";e.state[Ka]={fetchPromise:Qa(n,t)}},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"),o=(async()=>{try{const t=await e.state[Ka].fetchPromise;return Qe`${{html:t}}`}catch(e){const r=jt`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${"[caniuse]"}`;return Nt(`Couldn't find feature "${t.feature}" on caniuse.com.`,Ka,{hint:r}),console.error(e),Qe`caniuse.com`}})(),i=Qe`
          - Browser support (caniuse.com): -
          +@media print{ +.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 cs="core/caniuse",ls="https://respec.org/caniuse/",ds=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"}]]),us=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 ps=Object.freeze({__proto__:null,BROWSERS:ds,name:cs,prepare:function(e){if(!e.caniuse)return;!function(e){const t=new Set(ds.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=>!ds.has(e)));if(n.length){Ot(zt`Invalid browser(s): (${Dt(n,{quotes:!0})}) in the \`browser\` property of ${"[caniuse]"}.`,cs)}}(e);const t=e.caniuse;t.feature&&document.head.appendChild(Qe``)},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"),a=async function(e){const{feature:t,browsers:n,apiURL:r}=e,o=new URL(r||`./${t}`,ls);n.forEach((e=>o.searchParams.append("browsers",e)));const i=await fetch(o);if(!i.ok){const{status:e,statusText:t}=i;throw new Error(`Failed to get caniuse data: (${e}) ${t}`)}return i.json()}(e.caniuse).then((e=>async function(e,{feature:t}){const n=e.result,r=new Map([["desktop",[]],["mobile",[]]]),o=function(e){return(t,{browser:n,version:r,caniuse:o})=>{const{name:i,type:a}=ds.get(n),s=`${i}${r?` version ${r}`:""}`,c=us.get(o),l=`${e} is ${c} since ${s} on ${a}.`,d=`caniuse-cell ${o}`,u=(p=`${c} since ${s}.`).charAt(0).toUpperCase()+p.slice(1);var p;const f=r||"—",h=function(e){const t=ds.get(e).path??e;return`https://www.w3.org/assets/logos/browser-logos/${t}/${t}.svg`}(n),m=Qe` +
          + ${i} logo${f} +
          + `;return t.get(a).push(m),t}}(t);n.reduce(o,r);const i=[...r].filter((([,e])=>e.length)).map((([e,t])=>Qe`
          +
          ${t}
          +
          ${e}
          +
          `));return i.push(Qe`More info`),i}(e,t))).catch((e=>function(e,t,n){const r=`Failed to retrieve feature "${t.feature}".`,o=zt`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${"[caniuse]"}.`;return It(r,cs,{hint:o}),console.error(e),Qe`caniuse.com`}(e,t,n))),s=Qe`
          Browser support:
          - ${{any:o,placeholder:"Fetching data from caniuse.com..."}} -
          `;r.append(...i.childNodes),await o,Mt("amend-user-config",{caniuse:t.feature}),t.removeOnSave&&(r.querySelectorAll(".caniuse-browser").forEach((e=>e.classList.add("removeOnSave"))),qt("beforesave",(e=>{Qe.bind(e.querySelector(".caniuse-stats"))` - caniuse.com`})))}});var ts=String.raw`.mdn{font-size:.75em;position:absolute;right:.3em;min-width:0;margin-top:3em} + ${{any:a,placeholder:"Fetching data from caniuse.com..."}} + `;r.append(...s.childNodes),await a,o("amend-user-config",{caniuse:t.feature}),t.removeOnSave&&(r.querySelectorAll(".caniuse-browser").forEach((e=>e.classList.add("removeOnSave"))),i("beforesave",(e=>{Qe.bind(e.querySelector(".caniuse-stats"))` + caniuse.com`})))}});var fs=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;box-shadow:0 1em 3em -.4em rgba(0,0,0,.3),0 0 1px 1px rgba(0,0,0,.05);border-radius:2px;z-index:11;margin-bottom:.4em} +.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} -.mdn summary span{font-family:zillaslab,Palatino,"Palatino Linotype",serif;color:#fff;background-color:#000;display:inline-block;padding:3px} +.mdn summary span{font-family:zillaslab,Palatino,"Palatino Linotype",serif;color:#fff;color:var(--bg,#fff);background-color:#000;background-color:var(--text,#000);display:inline-block;padding:3px} .mdn a{display:inline-block;word-break:break-all} .mdn p{margin:0} .mdn .engines-all{color:#058b00} @@ -836,49 +856,48 @@ li.caniuse-cell{margin-bottom:1px} .mdn tr::before{content:"";display:table-cell;width:1.5em;height:1.5em;background:no-repeat center center/contain;font-size:.75em} .mdn .no,.mdn .unknown{color:#ccc;filter:grayscale(100%)} .mdn .no::before,.mdn .unknown::before{opacity:.5} -.mdn .chrome::before,.mdn .chrome_android::before{background-image:url(https://resources.whatwg.org/browser-logos/chrome.svg)} -.mdn .edge::before,.mdn .edge_mobile::before{background-image:url(https://resources.whatwg.org/browser-logos/edge.svg)} -.mdn .firefox::before,.mdn .firefox_android::before{background-image:url(https://resources.whatwg.org/browser-logos/firefox.png)} -.mdn .ie::before{background-image:url(https://resources.whatwg.org/browser-logos/ie.png)} -.mdn .opera::before,.mdn .opera_android::before{background-image:url(https://resources.whatwg.org/browser-logos/opera.svg)} -.mdn .safari::before{background-image:url(https://resources.whatwg.org/browser-logos/safari.png)} -.mdn .safari_ios::before{background-image:url(https://resources.whatwg.org/browser-logos/safari-ios.svg)} -.mdn .samsunginternet_android::before{background-image:url(https://resources.whatwg.org/browser-logos/samsung.svg)} -.mdn .webview_android::before{background-image:url(https://resources.whatwg.org/browser-logos/android-webview.png)}`;const ns="core/mdn-annotation",rs="https://w3c.github.io/mdn-spec-links/",os={chrome:"Chrome",chrome_android:"Chrome Android",edge:"Edge",edge_mobile:"Edge Mobile",firefox:"Firefox",firefox_android:"Firefox Android",ie:"Internet Explorer",opera:"Opera",opera_android:"Opera Android",safari:"Safari",safari_ios:"Safari iOS",samsunginternet_android:"Samsung Internet",webview_android:"WebView Android"},is=ht({en:{inAllEngines:"This feature is in all major engines.",inSomeEngines:"This feature has limited support."},zh:{inAllEngines:"所有主要引擎均支持此特性。",inSomeEngines:"此功能支持有限。"}});function as(e){const t=e.closest("section");if(!t)return;const{previousElementSibling:n}=t;if(n&&n.classList.contains("mdn"))return n;const r=Qe``;return t.before(r),r}function ss(e){const{name:t,slug:n,summary:r,support:o,engines:i}=e,a=n.slice(n.indexOf("/")+1),s=`https://developer.mozilla.org/en-US/docs/Web/${n}`,c=`Expand MDN details for ${t}`,l=function(e){if(3===e.length)return Qe``;if(e.length<2)return Qe`🚫`;return Qe``}(i);return Qe`
          +.mdn .chrome::before,.mdn .chrome_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/chrome/chrome.svg)} +.mdn .edge::before,.mdn .edge_mobile::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/edge/edge.svg)} +.mdn .firefox::before,.mdn .firefox_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/firefox/firefox.svg)} +.mdn .opera::before,.mdn .opera_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/opera/opera.svg)} +.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 hs="core/mdn-annotation",ms="https://w3c.github.io/mdn-spec-links/",gs="https://developer.mozilla.org/en-US/docs/Web/",bs={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"},ys=gt({en:{inAllEngines:"This feature is in all major engines.",inSomeEngines:"This feature has limited support."},zh:{inAllEngines:"所有主要引擎均支持此特性。",inSomeEngines:"此功能支持有限。"}});function ws(e){const t=e.closest("section");if(!t)return;const{previousElementSibling:n}=t;if(n&&n.classList.contains("mdn"))return n;const r=Qe``;return t.before(r),r}function vs(e){const{name:t,slug:n,summary:r,support:o,engines:i}=e,a=n.slice(n.indexOf("/")+1),s=`${gs}${n}`,c=`Expand MDN details for ${t}`,l=function(e){if(3===e.length)return Qe``;if(e.length<2)return Qe`🚫`;return Qe``}(i);return Qe`
          MDN${l} ${a} - ${function(e){if(3===e.length)return Qe`

          ${is.inAllEngines}

          `;if(e.length<2)return Qe`

          ${is.inSomeEngines}

          `}(i)} + ${function(e){if(3===e.length)return Qe`

          ${ys.inAllEngines}

          `;if(e.length<2)return Qe`

          ${ys.inSomeEngines}

          `}(i)} ${o?function(e){function t(e,t,n){const r="Unknown"===t?"?":t,o=`${e} ${t.toLowerCase()}`;return Qe` - ${os[e]} + ${bs[e]} ${n||r} `}function n(e,n){if(n.version_removed)return t(e,"No","");const r=n.version_added;return"boolean"==typeof r?t(e,r?"Yes":"No",""):r?t(e,"Yes",`${r}+`):t(e,"Unknown","")}return Qe` - ${Object.keys(os).map((r=>e[r]?n(r,e[r]):t(r,"Unknown","")))} + ${Object.keys(bs).map((r=>e[r]?n(r,e[r]):t(r,"Unknown","")))}
          `}(o):Qe`

          No support data.

          `} -
          `}var cs=Object.freeze({__proto__:null,name:ns,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=rs,maxAge:r=864e5}=t,o=new URL(`${e}.json`,n).href,i=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let o,i;if("caches"in window)try{if(o=await caches.open(r.origin),i=await o.match(n),i&&new Date(i.headers.get("Expires"))>new Date)return i}catch(e){console.error("Failed to use Cache API.",e)}const a=await fetch(n);if(!a.ok&&i)return console.warn(`Returning a stale cached response for ${r}`),i;if(o&&a.ok){const e=a.clone(),r=new Headers(a.headers),i=new Date(Date.now()+t);r.set("Expires",i.toISOString());const s=new Response(await e.blob(),{headers:r});await o.put(n,s).catch(console.error)}return a}(o,r);if(404===i.status){return void Nt(`Could not find MDN data associated with key "${e}".`,ns,{hint:"Please add a valid key to `respecConfig.mdn`"})}return await i.json()}(t,e.mdn);if(!n)return;const r=document.createElement("style");r.textContent=ts,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=as(e);if(r)for(const e of t)r.append(ss(e))}}});const ls="1edtech/exporter";function ds(e=document){const t=function(e){e.querySelectorAll("img").forEach((e=>{e.setAttribute("src",function(e){try{const t=e.ownerDocument.createElement("canvas");t.width=e.width,t.height=e.height;return t.getContext("2d").drawImage(e,0,0,e.width,e.height),t.toDataURL()}catch(t){const n=t.toString();return n.startsWith("SecurityError")||Nt(n,ls),e.src}}(e))}));const t=e.cloneNode(!0);return us(t),function(e){let t=!1,n=!1;e.childNodes.forEach((e=>{t?n?e.remove():"FOOTER"==e.nodeName?n=!0:("SCRIPT"==e.nodeName||"STYLE"==e.nodeName)&&e.remove():"HEADER"!==e.nodeName?e.remove():t=!0}))}(t.body),t.body.innerHTML}(e);return`data:text/html;charset=utf-8,${encodeURIComponent(t)}`}function us(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"),st(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=Qe``),o.appendChild(a);const s=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=Qe` - - `;o.appendChild(c),t.prepend(o),Mt("beforesave",r)}t(ls,{rsDocToCmsDataURL:ds,rsDocToCssDataURL:async function(e=document){const t=await async function(e){const t=e.cloneNode(!0);return us(t),await async function(e){let t="";const n=e.querySelectorAll("link[rel='stylesheet']");await Promise.all(Array.from(n).map((async e=>{try{const n=await fetch(e.href),r=await n.text();t+=r}catch(t){Nt(`Cannot retrieve stylesheet ${e.href}. ${t}.`,ls)}})));return e.querySelectorAll("style").forEach((e=>{t+=e.innerText})),t}(t.head)}(e);return`data:text/css;charset=utf-8,${encodeURIComponent(t)}`}});const ps="ui/save-html",fs=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}},{id:"respec-save-as-cms-extract",ext:"txt",title:"CMS EXTRACT",type:"application/cms",get href(){return ds()}}];function ms(e,t){const{id:n,href:r,ext:o,title:i,type:a}=e,s=function(e,t=""){return ot.format(e).replace(rt,t)}(t.publishDate||new Date),c=[t.specStatus,t.shortName||"spec",s].join("-");return Qe``}var $s=Object.freeze({__proto__:null,name:hs,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=ms,maxAge:r=864e5}=t,o=new URL(`${e}.json`,n).href,i=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let o,i;if("caches"in window)try{if(o=await caches.open(r.origin),i=await o.match(n),i&&new Date(i.headers.get("Expires"))>new Date)return i}catch(e){console.error("Failed to use Cache API.",e)}const a=await fetch(n);if(!a.ok&&i)return console.warn(`Returning a stale cached response for ${r}`),i;if(o&&a.ok){const e=a.clone(),r=new Headers(a.headers),i=new Date(Date.now()+t);r.set("Expires",i.toISOString());const s=new Response(await e.blob(),{headers:r});await o.put(n,s).catch(console.error)}return a}(o,r);if(404===i.status){return void It(`Could not find MDN data associated with key "${e}".`,hs,{hint:"Please add a valid key to `respecConfig.mdn`"})}return await i.json()}(t,e.mdn);if(!n)return;const r=document.createElement("style");r.textContent=fs,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=ws(e);if(r)for(const e of t)r.append(vs(e))}}});const xs="1edtech/exporter";function ks(e=document){const t=function(e){const t=e.querySelectorAll("img");t.forEach((e=>{e.setAttribute("src",function(e){try{const t=e.ownerDocument.createElement("canvas");t.width=e.width,t.height=e.height;return t.getContext("2d").drawImage(e,0,0,e.width,e.height),t.toDataURL()}catch(t){const n=t.toString();return n.startsWith("SecurityError")||It(n,xs),e.src}}(e))}));const n=e.cloneNode(!0);return Es(n),function(e){let t=!1,n=!1;e.childNodes.forEach((e=>{t?n?e.remove():"FOOTER"==e.nodeName?n=!0:("SCRIPT"==e.nodeName||"STYLE"==e.nodeName)&&e.remove():"HEADER"!==e.nodeName?e.remove():t=!0}))}(n.body),n.body.innerHTML}(e);return`data:text/html;charset=utf-8,${encodeURIComponent(t)}`}function Es(e){const{head:t,body:n,documentElement:r}=e;Tt(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),ct(r);const i=e.createDocumentFragment(),a=e.querySelector("meta[name='viewport']");a&&t.firstChild!==a&&i.appendChild(a);let s=e.querySelector("meta[charset], meta[content*='charset=']");s||(s=Qe``),i.appendChild(s);const c=`ReSpec ${window.respecVersion||"Developer Channel"}`,l=Qe` + + `;i.appendChild(l),t.prepend(i),o("beforesave",r)}n(xs,{rsDocToCmsDataURL:ks,rsDocToCssDataURL:async function(e=document){const t=await async function(e){const t=e.cloneNode(!0);return Es(t),await async function(e){let t="";const n=e.querySelectorAll("link[rel='stylesheet']");await Promise.all(Array.from(n).map((async e=>{try{const n=await fetch(e.href),r=await n.text();t+=r}catch(t){It(`Cannot retrieve stylesheet ${e.href}. ${t}.`,xs)}})));return e.querySelectorAll("style").forEach((e=>{t+=e.innerText})),t}(t.head)}(e);return`data:text/css;charset=utf-8,${encodeURIComponent(t)}`}});const As="ui/save-html",_s=gt({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),Ss=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return Ut(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return Ut(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}},{id:"respec-save-as-cms-extract",ext:"txt",title:"CMS EXTRACT",type:"application/cms",get href(){return ks()}}];function Cs(e,t){const{id:n,href:r,ext:o,title:i,type:a}=e,s=function(e,t=""){return it.format(e).replace(ot,t)}(t.publishDate||new Date),c=[t.specStatus,t.shortName||"spec",s].join("-");return Qe`_n.closeModal()} + onclick=${()=>vn.closeModal()} >${i}`}var gs=Object.freeze({__proto__:null,name:ps,run:function(e){const t={async show(t){await document.respec.ready;const n=Qe`
          - ${hs.map((t=>ms(t,e)))} -
          `;_n.freshModal(fs.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=_n.addCommand(fs.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))},exportDocument:function(e,t){return Rt("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",ps,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),Bt(t)}});const bs="https://respec.org/specref/",ys=ht({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"仕様検索"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"搜索 Specref"}}),ws=_n.addCommand(ys.search_specref,(function(){const e=Qe` - - Open Search UI in a new tab - `;_n.freshModal(ys.search_specref,e,ws)}),"Ctrl+Shift+Alt+space","🔎");var vs=Object.freeze({__proto__:null});const $s="https://respec.org/xref/",xs={en:{title:"Search definitions"},ja:{title:"定義検索"},de:{title:"Definitionen durchsuchen"},zh:{title:"搜索定义"}},ks=xs[o in xs?o:"en"],Es=_n.addCommand(ks.title,(function(){const e=Qe` - - Open Search UI in a new tab - `;_n.freshModal(ks.title,e,Es)}),"Ctrl+Shift+Alt+x","📚");var _s=Object.freeze({__proto__:null});const As=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 Ss=document.createElement("div"),Cs=Qe.bind(Ss),Ts=_n.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(Ls).forEach((t=>{e.push(t)}));Cs` + >`}var Ts=Object.freeze({__proto__:null,exportDocument:function(e,t){return Ot("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",As,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),Ut(t)},name:As,run:function(e){const t={async show(t){await document.respec.ready;const n=Qe`
          + ${Ss.map((t=>Cs(t,e)))} +
          `;vn.freshModal(_s.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=vn.addCommand(_s.save_snapshot,(function(){if(!n)return;t.show(r)}),"Ctrl+Shift+Alt+S","💾"))}});const Ls="https://respec.org/specref/",Rs=gt({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"仕様検索"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"搜索 Specref"}}),Ns=vn.addCommand(Rs.search_specref,(function(){const e=Qe` + + Open Search UI in a new tab + `;vn.freshModal(Rs.search_specref,e,Ns)}),"Ctrl+Shift+Alt+space","🔎");var Is=Object.freeze({__proto__:null});const Os="https://respec.org/xref/",Ps=gt({en:{title:"Search definitions"},ja:{title:"定義検索"},de:{title:"Definitionen durchsuchen"},zh:{title:"搜索定义"}}),js=vn.addCommand(Ps.title,(function(){const e=Qe` + + Open Search UI in a new tab + `;vn.freshModal(Ps.title,e,js)}),"Ctrl+Shift+Alt+x","📚");var Ds=Object.freeze({__proto__:null});const Ms=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 zs=document.createElement("div"),qs=Qe.bind(zs),Fs=vn.addCommand(`${Ms.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(Us).forEach((t=>{e.push(t)}));qs`

          ReSpec is a document production toolchain, with a notable focus on W3C specifications.

          Documentation, - Bugs. + Bugs.

          ${e} -`,_n.freshModal(`${As.about_respec} - ${window.respecVersion}`,Ss,Ts)}),"Ctrl+Shift+Alt+A","ℹ️");function Ls({name:e,duration:t}){return Qe` +`,vn.freshModal(`${Ms.about_respec} - ${window.respecVersion}`,zs,Fs)}),"Ctrl+Shift+Alt+A","ℹ️");function Us({name:e,duration:t}){return Qe` - ${e} + ${e} ${t} - `}var Ns=Object.freeze({__proto__:null});var Rs=Object.freeze({__proto__:null,name:"core/seo",run:function(){const e=document.querySelector("#abstract p:first-of-type");if(!e)return;const t=e.textContent.replace(/\s+/," ").trim(),n=document.createElement("meta");n.name="description",n.content=t,document.head.appendChild(n)}});var Is=Object.freeze({__proto__:null,name:"1edtech/seo",run:async function(e){const t=document.createElement("link");t.setAttribute("rel","canonical"),t.setAttribute("href",e.thisURL),document.head.appendChild(t)}});var Os=String.raw`.hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;background:#fafafa} -.hljs-comment,.hljs-quote{color:#717277;font-style:italic} -.hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4} -.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#ca4706;font-weight:700} -.hljs-literal{color:#0b76c5} -.hljs-addition,.hljs-attribute,.hljs-meta-string,.hljs-regexp,.hljs-string{color:#42803c} -.hljs-built_in,.hljs-class .hljs-title{color:#9a6a01} -.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#986801} -.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#336ae3} + `}var Bs=Object.freeze({__proto__:null});var Hs=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=Qe``;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 Ws=Object.freeze({__proto__:null,name:"1edtech/seo",run:async function(e){const t=document.createElement("link");t.setAttribute("rel","canonical"),t.setAttribute("href",e.thisURL),document.head.appendChild(t)}});var Vs=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} +} +.hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;color:var(--mono-1,#383a42);background:#fafafa;background:var(--base,#fafafa)} +.hljs-comment,.hljs-quote{color:#717277;color:var(--mono-3,#717277);font-style:italic} +.hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4;color:var(--hue-3,#a626a4)} +.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#ca4706;color:var(--hue-5,#ca4706);font-weight:700} +.hljs-literal{color:#0b76c5;color:var(--hue-1,#0b76c5)} +.hljs-addition,.hljs-attribute,.hljs-meta-string,.hljs-regexp,.hljs-string{color:#42803c;color:var(--hue-4,#42803c)} +.hljs-built_in,.hljs-class .hljs-title{color:#9a6a01;color:var(--hue-6-2,#9a6a01)} +.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#986801;color:var(--hue-6,#986801)} +.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 Ps(e){const t=await fetch(new URL(`../../${e}`,document.currentScript&&document.currentScript.src||new URL("respec-1edtech.js",document.baseURI).href));return await t.text()}const js=at({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(js);const Ds=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return ll}))).default}catch{return Ps("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();t("core/worker",Ds.then((e=>({worker:e}))));const zs=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function Ms(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:zs(),languages:t},r=await Ds;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(i){const{data:{id:a,language:s,value:c}}=i;a===n.id&&(r.removeEventListener("message",t),clearTimeout(o),e({language:s,value:c}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:o,value:i}=r;switch(e.localName){case"pre":e.classList.remove(o),e.innerHTML=`${i}`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=i,e.classList.add("hljs"),o&&e.classList.add(o)}e.setAttribute("aria-busy","false")}var qs=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(Ms);document.head.appendChild(Qe``),await Promise.all(n)}});const Fs=ht({en:{missing_test_suite_uri:jt`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:jt`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:jt`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:jt`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),Us="core/data-tests";function Bs(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 Qe` +.hljs-link{text-decoration:underline}`;async function Ys(t){const n=await fetch(new URL(`../../${t}`,e&&e.src||new URL("respec-1edtech.js",document.baseURI).href));return await n.text()}const Ks=st({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(Ks);const Xs=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return $l}))).default}catch{return Ys("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 Gs=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function Zs(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:Gs(),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(i){const{data:{id:a,language:s,value:c}}=i;a===n.id&&(r.removeEventListener("message",t),clearTimeout(o),e({language:s,value:c}))}))}))}(e.innerText,t)}catch(e){return void console.error(e)}const{language:o,value:i}=r;switch(e.localName){case"pre":e.classList.remove(o),e.innerHTML=`${i}`,e.classList.length||e.removeAttribute("class");break;case"code":e.innerHTML=i,e.classList.add("hljs"),o&&e.classList.add(o)}e.setAttribute("aria-busy","false")}var Js=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(Zs);document.head.appendChild(Qe``),await Promise.all(n)}});const Qs=gt({en:{missing_test_suite_uri:zt`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:zt`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:zt`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:zt`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),ec="core/data-tests";function tc(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 Qe`
        3. ${o} ${t}
        4. - `}function Hs(e,t,n){return e.map((e=>{try{return new URL(e,t).href}catch{Rt(jt`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,Us,{elements:[n]})}})).filter((e=>e))}function Ws(e,t){const n=e.filter(((e,t,n)=>n.indexOf(e)!==t));if(n.length){const e=jt`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=jt`To fix, remove duplicates from ${"[data-tests]"}: ${Ot(n,{quotes:!0})}.`;Rt(e,Us,{hint:r,elements:[t]})}}function Vs(e){const t=[...new Set(e)];return Qe` + `}function nc(e,t,n){return e.map((e=>{try{return new URL(e,t).href}catch{Ot(zt`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,ec,{elements:[n]})}})).filter((e=>e))}function rc(e,t){const n=e.filter(((e,t,n)=>n.indexOf(e)!==t));if(n.length){const e=zt`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=zt`To fix, remove duplicates from ${"[data-tests]"}: ${Dt(n,{quotes:!0})}.`;Ot(e,ec,{hint:r,elements:[t]})}}function oc(e){const t=[...new Set(e)];return Qe`
          tests: ${t.length}
            - ${t.map(Bs)} + ${t.map(tc)}
          - `}var Ys=Object.freeze({__proto__:null,name:Us,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);Ws(t,n);const r=Vs(t);n.append(r)}else Nt(Fs.missing_test_suite_uri,Us)}});const Zs="core/list-sorter";function Gs(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(Gs(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function Ks(e,t){return[...e.querySelectorAll(":scope > dt")].sort(Gs(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,o=document.createDocumentFragment();let{nextSibling:i}=t;for(;i&&i.nextSibling;){o.appendChild(i.cloneNode(!0));const{nodeType:e,nodeName:t}=i.nextSibling;if(e===n&&t===r)break;i=i.nextSibling}return o.prepend(t.cloneNode(!0)),e.appendChild(o),e}),document.createDocumentFragment())}var Js=Object.freeze({__proto__:null,name:Zs,sortListItems:Xs,sortDefinitionTerms:Ks,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=Ks(t,n);break;case"ol":case"ul":e=Xs(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)}}}});var Qs=String.raw`var:hover{text-decoration:underline;cursor:pointer} + `}var ic=Object.freeze({__proto__:null,name:ec,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=nc(n.dataset.tests.split(/,/gm).map((e=>e.trim())),e.testSuiteURI,n);rc(t,n);const r=oc(t);n.append(r)}else It(Qs.missing_test_suite_uri,ec)}});const ac="core/list-sorter";function sc(e){const t="ascending"===e?1:-1;return({textContent:e},{textContent:n})=>t*e.trim().localeCompare(n.trim())}function cc(e,t){return[...e.querySelectorAll(":scope > li")].sort(sc(t)).reduce(((e,t)=>(e.appendChild(t),e)),document.createDocumentFragment())}function lc(e,t){return[...e.querySelectorAll(":scope > dt")].sort(sc(t)).reduce(((e,t)=>{const{nodeType:n,nodeName:r}=t,o=document.createDocumentFragment();let{nextSibling:i}=t;for(;i&&i.nextSibling;){o.appendChild(i.cloneNode(!0));const{nodeType:e,nodeName:t}=i.nextSibling;if(e===n&&t===r)break;i=i.nextSibling}return o.prepend(t.cloneNode(!0)),e.appendChild(o),e}),document.createDocumentFragment())}var dc=Object.freeze({__proto__:null,name:ac,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=lc(t,n);break;case"ol":case"ul":e=cc(t,n);break;default:Ot(`ReSpec can't sort ${t.localName} elements.`,ac,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:lc,sortListItems:cc});var uc=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)} +} var.respec-hl-c1{--bg-color:#f4d200} var.respec-hl-c2{--bg-color:#ff87a2} var.respec-hl-c3{--bg-color:#96e885} @@ -937,14 +966,14 @@ 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 ec(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=ft(e.textContent),n=e.closest("section"),r=nc(e),o=[...n.querySelectorAll("var")].filter((e=>ft(e.textContent)===t&&e.closest("section")===n)),i=o[0].classList.contains("respec-hl");if(tc.set(r,i),i)return o.forEach((e=>rc(e,r))),[];o.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return o}(t),r=()=>{const e=nc(t);n.forEach((t=>rc(t,e))),[...tc.keys()].forEach((e=>tc.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const tc=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 nc(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===tc.get("respec-hl-c1")?"respec-hl-c1":[...tc.keys()].find((e=>tc.get(e)))||"respec-hl-c1"}function rc(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var oc=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=Qs,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",ec))),qt("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(rc)}))}});var ic=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:small Helvetica Neue,sans-serif,Droid Sans Fallback;background:#fff;color:#000;box-shadow:0 1em 3em -.4em rgba(0,0,0,.3),0 0 1px 1px rgba(0,0,0,.05);border-radius:2px} +}`;function pc(e){e.stopPropagation();const{target:t}=e,n=function(e){const t=mt(e.textContent),n=e.closest(".algorithm, section"),r=hc(e),o=[...n.querySelectorAll("var")].filter((e=>mt(e.textContent)===t&&e.closest(".algorithm, section")===n)),i=o[0].classList.contains("respec-hl");if(fc.set(r,i),i)return o.forEach((e=>mc(e,r))),[];o.forEach((e=>function(e,t){e.classList.add("respec-hl",t)}(e,r)));return o}(t),r=()=>{const e=hc(t);n.forEach((t=>mc(t,e))),[...fc.keys()].forEach((e=>fc.set(e,!0)))};n.length&&document.body.addEventListener("click",r,{once:!0})}const fc=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 hc(e){const{value:t}=e.classList,n=/respec-hl-\w+/,r=n.test(t)&&t.match(n);return r?r[0]:!0===fc.get("respec-hl-c1")?"respec-hl-c1":[...fc.keys()].find((e=>fc.get(e)))||"respec-hl-c1"}function mc(e,t){e.classList.remove("respec-hl",t),e.classList.length||e.removeAttribute("class")}var gc=Object.freeze({__proto__:null,name:"core/highlight-vars",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=uc,t.classList.add("removeOnSave"),document.head.appendChild(t),document.querySelectorAll("var").forEach((e=>e.addEventListener("click",pc))),i("beforesave",(e=>{e.querySelectorAll("var.respec-hl").forEach(mc)}))}});var bc=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;top:0} -.dfn-panel:not(.docked)>.caret::before{border-bottom:9px solid #a2a9b1} +.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} +.dfn-panel:not(.docked)>.caret::before{border-bottom:9px solid #a2a9b1;border-bottom-color:var(--indextable-hover-bg,#a2a9b1)} .dfn-panel *{margin:0} -.dfn-panel b{display:block;color:#000;margin-top:.25em} -.dfn-panel ul a[href]{color:#333} +.dfn-panel b{display:block;color:#000;color:var(--text,#000);margin-top:.25em} +.dfn-panel ul a[href]{color:#333;color:var(--text,#333)} .dfn-panel>div{display:flex} .dfn-panel a.self-link{font-weight:700;margin-right:auto} .dfn-panel .marker{padding:.1em;margin-left:.5em;border-radius:.2em;text-align:center;white-space:nowrap;font-size:90%;color:#040b1c} @@ -954,7 +983,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 ac(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}`,i=e.getAttribute("aria-label")||ft(e.textContent),a=Qe` +.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 yc(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}`,i=e.getAttribute("aria-label")||mt(e.textContent),a=Qe`
          Referenced in:

          ${function(e,t){if(!t.length)return Qe`
          • Not referenced in this document.
          • -
          `;const n=new Map;t.forEach(((t,r)=>{const o=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=o);const i=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(i)||n.set(i,[]).get(i)).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`
        5. - ${r(e).map((e=>Qe`${e.text}${" "}`))} -
        6. `;return Qe`
            +
          `;const n=new Map;t.forEach(((t,r)=>{const o=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=o);const i=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(i)||n.set(i,[]).get(i)).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`
        7. + ${r(e).map((e=>Qe`${e.text}${" "}`))} +
        8. `;return Qe`
            ${[...n].map(o)}
          `}(t,r)}
          - `;return a}var sc=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(Qe``,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(ac(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 dl}))).default}catch{return Ps("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});var cc=String.raw`var{position:relative;cursor:pointer} + `;return a}var wc=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(Qe``,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(yc(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 xl}))).default}catch{return Ys("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});var vc=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:#000} -var[data-type]::after{content:attr(data-type);transform:translateX(-50%) translateY(-100%);background:#000;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 lc=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=cc,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 dc=String.raw`.assert{background:#eee;border-left:.5em solid #aaa;padding:.3em}`;var uc=Object.freeze({__proto__:null,name:"core/algorithms",run:function(){if(Array.from(document.querySelectorAll("ol.algorithm li")).filter((e=>e.textContent.trim().startsWith("Assert: "))).forEach((e=>e.classList.add("assert"))),document.querySelector(".assert")){const e=document.createElement("style");e.textContent=dc,document.head.appendChild(e)}}});const pc="core/anchor-expander";function fc(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.`,pc,{title:"Missing title.",elements:[n]})}const o=At(r);n.append(...o.childNodes),n.classList.add("box-ref")}function hc(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 \`
          \`.`,pc,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...At(r).childNodes].filter((e=>!e.classList||!e.classList.contains("fig-title")));o.pop(),n.append(...o),n.classList.add("fig-ref");const i=r.querySelector(".fig-title");!n.hasAttribute("title")&&i&&(n.title=ft(i.textContent))}function mc(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)gc(r,n),bc(r,n);else{n.textContent=n.getAttribute("href");Nt("Found matching section, but the section was lacking a heading element.",pc,{title:`No matching id in document: "${t}".`,elements:[n]})}}function gc(e,t){const n=e.querySelector(".self-link"),r=[...At(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=vt(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)}))}function bc(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 yc=Object.freeze({__proto__:null,name:pc,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":gc(n,t);break;case"section":mc(n,e,t);break;case"figure":hc(n,e,t);break;case"aside":case"div":fc(n,e,t);break;default:t.textContent=t.getAttribute("href");Nt("ReSpec doesn't support expanding this kind of reference.",pc,{title:`Can't expand "#${e}".`,elements:[t]})}bc(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");Nt(`Couldn't expand inline reference. The id "${e}" is not in the document.`,pc,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});const wc="rs-changelog",vc=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)` +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 $c=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;const t=document.createElement("style");t.textContent=vc,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 xc=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 kc=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`Assert`,": "))}const t=document.createElement("style");t.textContent=xc,document.head.appendChild(t)}});const Ec="core/anchor-expander";function Ac(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void It(`Found matching element "${t}", but it has no title or marker.`,Ec,{title:"Missing title.",elements:[n]})}const o=Ct(r);n.append(...o.childNodes),n.classList.add("box-ref")}function _c(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void It(`Found matching figure "${t}", but figure is lacking a \`
          \`.`,Ec,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...Ct(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("figno"),e)));n.append(...o),n.classList.add("fig-ref");const i=r.querySelector(".fig-title");!n.hasAttribute("title")&&i&&(n.title=mt(i.textContent))}function Sc(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void It(`Found matching table "${t}", but table is lacking a \`\`.`,Ec,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...Ct(r.querySelector(".self-link")).childNodes].map((e=>(e.classList?.remove("tableno"),e)));n.append(...o),n.classList.add("table-ref");const i=r.querySelector(".table-title");!n.hasAttribute("title")&&i&&(n.title=mt(i.textContent))}function Cc(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(r)Tc(r,n),Lc(r,n);else{n.textContent=n.getAttribute("href");It("Found matching section, but the section was lacking a heading element.",Ec,{title:`No matching id in document: "${t}".`,elements:[n]})}}function Tc(e,t){const n=e.querySelector(".self-link"),r=[...Ct(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 Lc(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 Rc=Object.freeze({__proto__:null,name:Ec,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":Tc(n,t);break;case"section":Cc(n,e,t);break;case"figure":_c(n,e,t);break;case"table":Sc(n,e,t);break;case"aside":case"div":Ac(n,e,t);break;default:t.textContent=t.getAttribute("href");It("ReSpec doesn't support expanding this kind of reference.",Ec,{title:`Can't expand "#${e}".`,elements:[t]})}Lc(n,t),t.normalize()}else{t.textContent=t.getAttribute("href");It(`Couldn't expand inline reference. The id "${e}" is not in the document.`,Ec,{title:`No matching id in document: ${e}.`,elements:[t]})}}}});const Nc="rs-changelog",Ic=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)`
            - ${{any:$c(e,t,n).then((e=>async function(e){const{repoURL:t}=await Xn;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),o=`${t}commit/${e.hash}`,i=r&&Qe` (#${r})`;return Qe`
          • ${n.trim()}${i}
          • `}))}(e))).catch((e=>Nt(e.message,wc,{elements:[this]}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}} + ${{any:Oc(e,t,n).then((e=>async function(e){const{repoURL:t}=await Wn;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),o=`${t}commit/${e.hash}`,i=r&&Qe` (#${r})`;return Qe`
          • ${n.trim()}${i}
          • `}))}(e))).catch((e=>It(e.message,Nc,{elements:[this]}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}}
          - `}};async function $c(e,t,n){let r;try{const o=await Xn;if(!o)throw new Error("`respecConfig.github` is not set");const i=new URL("commits",`${o.apiBase}/${o.fullName}/`);i.searchParams.set("from",e),i.searchParams.set("to",t);const a=await fetch(i.href);if(!a.ok)throw new Error(`Request to ${i} failed with status code ${a.status}`);if(r=await a.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 xc=[Object.freeze({__proto__:null,name:wc,element:vc})];var kc=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){xc.forEach((e=>{customElements.define(e.name,e.element)}));const e=xc.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 Ec=Object.freeze({__proto__:null,name:"1edtech/cleanBody",run:async function(e){if(e.cleanBodyAll||e.cleanBodyScripts){document.body.querySelectorAll("script").forEach((e=>{e.parentNode.removeChild(e)}))}if(e.cleanBodyAll||e.cleanBodyCSS){document.querySelectorAll("*[style]").forEach((e=>{e.removeAttribute("style")}))}}});var _c=Object.freeze({__proto__:null,name:"1edtech/title-attrs",run:async function(e){if(e.noTitleAttrs)return;document.body.querySelectorAll("a[href].internalDFN").forEach((e=>{const t=e.getAttribute("href"),n=document.body.querySelector(t);if(n&&"DFN"===n.tagName){let t="";if(function(e,t){return null!=e.closest(t)}(n,"dt")){const e=n.closest("dt").nextElementSibling;e&&"DD"===e.tagName&&(t=e.textContent)}else{const e=n.closest("p, td, li, div, aside");e&&(t=e.textContent)}if(t.length>0){t=t.replace(/^(\s*)|(\s*)$/g,"").replace(/\s+/g," ");const n=document.createAttribute("title");n.value=t,e.setAttributeNode(n)}}}))}});var Ac=Object.freeze({__proto__:null,name:"1edtech/scripts",run:async function(e){if(e.noSideBarTOC)document.body.className+=" toc-inline";else{let t="https://purl.imsglobal.org/spec/fixup.js";e.overrideFixupLocation&&(t=e.overrideFixupLocation),function(e){const t=document.createElement("script");t.addEventListener("load",(()=>{window.location.hash&&(window.location=window.location)}),{once:!0}),t.src=e,document.body.appendChild(t)}(t)}}});var Sc=Object.freeze({__proto__:null,name:"1edtech/comments",run:async function(){const e=document.createNodeIterator(document.documentElement,NodeFilter.SHOW_COMMENT),t=[];let n;for(;n=e.nextNode();)t.push(n);t.forEach((e=>{e.parentElement.removeChild(e)}))}});var Cc=Object.freeze({__proto__:null,name:"1edtech/footers",run:async function(e){const t=(e=>Qe`
          + `}};async function Oc(e,t,n){let r;try{const o=await Wn;if(!o)throw new Error("`respecConfig.github` is not set");const i=new URL("commits",`${o.apiBase}/${o.fullName}/`);i.searchParams.set("from",e),i.searchParams.set("to",t);const a=await fetch(i.href);if(!a.ok)throw new Error(`Request to ${i} failed with status code ${a.status}`);if(r=await a.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 Pc=[Object.freeze({__proto__:null,element:Ic,name:Nc})];var jc=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Pc.forEach((e=>{customElements.define(e.name,e.element)}));const e=Pc.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 Dc=Object.freeze({__proto__:null,name:"1edtech/cleanBody",run:async function(e){if(e.cleanBodyAll||e.cleanBodyScripts){document.body.querySelectorAll("script").forEach((e=>{e.parentNode.removeChild(e)}))}if(e.cleanBodyAll||e.cleanBodyCSS){document.querySelectorAll("*[style]").forEach((e=>{e.removeAttribute("style")}))}}});var Mc=Object.freeze({__proto__:null,name:"1edtech/title-attrs",run:async function(e){if(e.noTitleAttrs)return;document.body.querySelectorAll("a[href].internalDFN").forEach((e=>{const t=e.getAttribute("href"),n=document.body.querySelector(t);if(n&&"DFN"===n.tagName){let t="";if(function(e,t){const n=e.closest(t);return null!=n}(n,"dt")){const e=n.closest("dt").nextElementSibling;e&&"DD"===e.tagName&&(t=e.textContent)}else{const e=n.closest("p, td, li, div, aside");e&&(t=e.textContent)}if(t.length>0){t=t.replace(/^(\s*)|(\s*)$/g,"").replace(/\s+/g," ");const n=document.createAttribute("title");n.value=t,e.setAttributeNode(n)}}}))}});var zc=Object.freeze({__proto__:null,name:"1edtech/scripts",run:async function(e){if(e.noSideBarTOC)document.body.className+=" toc-inline";else{let t="https://purl.imsglobal.org/spec/fixup.js";e.overrideFixupLocation&&(t=e.overrideFixupLocation),function(e){const t=document.createElement("script");t.addEventListener("load",(()=>{window.location.hash&&(window.location=window.location)}),{once:!0}),t.src=e,document.body.appendChild(t)}(t)}}});var qc=Object.freeze({__proto__:null,name:"1edtech/comments",run:async function(){const e=document.createNodeIterator(document.documentElement,NodeFilter.SHOW_COMMENT),t=[];let n;for(;n=e.nextNode();)t.push(n);t.forEach((e=>{e.parentElement.removeChild(e)}))}});var Fc=Object.freeze({__proto__:null,name:"1edtech/footers",run:async function(e){const t=(e=>Qe`

          1EdTech™ Consortium, Inc. ("1EdTech") is publishing the @@ -1033,5 +1067,5 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var lc=Obje

          Date: ${e.specDate}

          -
          `)(e);document.body.appendChild(t)}});const Tc="core/linter-rules/check-charset",Lc=ht({en:{msg:"Document must only contain one `` tag with charset set to 'utf-8'",hint:'Add this line in your document `` section - `` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `` 标签",hint:'将此行添加到文档的 `` 部分—— `` 或将 charset 设置为 utf-8(如果尚未设置)。'}});var Nc=Object.freeze({__proto__:null,name:Tc,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(Lc.msg,Tc,{hint:Lc.hint,elements:[...t]})}});const Rc="core/linter-rules/check-punctuation",Ic=[".",":","!","?"],Oc=ht({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Ic.map((e=>`"${e}"`)).join(", ")}.`}});var Pc=Object.freeze({__proto__:null,name:Rc,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Ic.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top)")].filter((e=>!t.test(e.textContent.trim())));n.length&&Rt(Oc.msg,Rc,{hint:Oc.hint,elements:n})}});const jc="core/linter-rules/check-internal-slots",Dc=ht({en:{msg:"Internal slots should be preceded by a '.'",hint:"Add a '.' between the elements mentioned."}});var zc=Object.freeze({__proto__:null,name:jc,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&&Rt(Dc.msg,jc,{hint:Dc.hint,elements:t})}});const Mc="core/linter-rules/local-refs-exist",qc=ht({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function Fc(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Uc=Object.freeze({__proto__:null,name:Mc,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Fc);t.length&&Rt(qc.msg,Mc,{hint:qc.hint,elements:t})}});const Bc="core/linter-rules/no-headingless-sections",Hc=ht({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `
          `."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `
          `."},zh:{msg:"所有章节(section)都必须以 `h2-6` 元素开头。",hint:"将 `h2-6` 添加到有问题的章节或使用 `
          `。"}}),Wc=({firstElementChild:e})=>null===e||!1===/^h[1-6]$/.test(e.localName);var Vc=Object.freeze({__proto__:null,name:Bc,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section")].filter(Wc);t.length&&Rt(Hc.msg,Bc,{hint:Hc.hint,elements:t})}});const Yc="core/linter-rules/no-unused-vars",Zc=ht({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the ``."}});var Gc=Object.freeze({__proto__:null,name:Yc,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(Zc.msg,Yc,{hint:Zc.hint,elements:t})}});const Xc="core/linter-rules/privsec-section",Kc=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 Jc=Object.freeze({__proto__:null,name:Xc,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(Kc.msg,Xc,{hint:Kc.hint})}});const Qc="core/linter-rules/wpt-tests-exist",el=ht({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 tl=Object.freeze({__proto__:null,name:Qc,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 Rt("Failed to parse WPT directory from testSuiteURI",`linter/${Qc}`),console.error(e),null}const r=new URL("web-platform-tests/wpt/files",`${t}/`);r.searchParams.set("path",n);const o=await fetch(r);if(!o.ok){return Rt(`Failed to fetch files from WPT repository. Request failed with error: ${await o.text()} (${o.status})`,`linter/${Qc}`),null}const{entries:i}=await o.json(),a=i.filter((e=>!e.endsWith("/")));return new Set(a)}(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=>{Rt(`${el.msg} \`${t}\`.`,Qc,{hint:el.hint,elements:[e]})}))}});const nl="core/linter-rules/no-http-props",rl=ht({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 ol=Object.freeze({__proto__:null,name:nl,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=>jt`${`[${e}]`}`));Rt(rl.msg,nl,{hint:rl.hint+e})}}});const il="core/linter-rules/a11y",al=["color-contrast","landmark-one-main","landmark-unique","region"];function sl(e){const t=[];for(const n of e.split("\n\n")){const[e,...r]=n.split(/^\s{2}/m),o=r.map((e=>`- ${e.trimEnd()}`)).join("\n");t.push(`${e}${o}`)}return t.join("\n\n")}var cl=Object.freeze({__proto__:null,name:il,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(al.map((e=>[e,{enabled:!1}]))),...t},...n,elementRef:!0,resultTypes:["violations"],reporter:"v1"};let o;try{o=await function(){const e=document.createElement("script");return e.classList.add("remove"),e.src="https://unpkg.com/axe-core@3/axe.min.js",document.head.appendChild(e),new Promise(((t,n)=>{e.onload=()=>t(window.axe),e.onerror=n}))}()}catch(e){return Nt("Failed to load a11y linter.",il),console.error(e),[]}try{return(await o.run(document,r)).violations}catch(e){return Nt("Error while looking for a11y issues.",il),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:o,helpUrl:i}=e,a=`a11y/${n}: ${r}`;for(const[e,n]of t){const t=sl(e);Rt(a,il,{details:`\n\n${o}.\n\n${t}. ([Learn more](${i}))`,elements:n})}}}}),ll=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'}),dl=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 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 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} 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})()'})}(); +
          `)(e);document.body.appendChild(t)}});const Uc="core/linter-rules/check-charset",Bc=gt({en:{msg:"Document must only contain one `` tag with charset set to 'utf-8'",hint:'Add this line in your document `` section - `` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `` 标签",hint:'将此行添加到文档的 `` 部分—— `` 或将 charset 设置为 utf-8(如果尚未设置)。'}});var Hc=Object.freeze({__proto__:null,name:Uc,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(Bc.msg,Uc,{hint:Bc.hint,elements:[...t]})}});const Wc="core/linter-rules/check-punctuation",Vc=[".",":","!","?"],Yc=gt({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Vc.map((e=>`"${e}"`)).join(", ")}.`}});var Kc=Object.freeze({__proto__:null,name:Wc,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Vc.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter((e=>!t.test(e.textContent.trim())));n.length&&Ot(Yc.msg,Wc,{hint:Yc.hint,elements:n})}});const Xc="core/linter-rules/check-internal-slots",Gc=gt({en:{msg:"Internal slots should be preceded by a '.'",hint:"Add a '.' between the elements mentioned."}});var Zc=Object.freeze({__proto__:null,name:Xc,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&&Ot(Gc.msg,Xc,{hint:Gc.hint,elements:t})}});const Jc="core/linter-rules/local-refs-exist",Qc=gt({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."}});function el(e){const t=e.getAttribute("href").substring(1),n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var tl=Object.freeze({__proto__:null,name:Jc,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(el);t.length&&Ot(Qc.msg,Jc,{hint:Qc.hint,elements:t})}});const nl="core/linter-rules/no-headingless-sections",rl=gt({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `
          `."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `
          `."},zh:{msg:"所有章节(section)都必须以 `h2-6` 元素开头。",hint:"将 `h2-6` 添加到有问题的章节或使用 `
          `。"}});var ol=Object.freeze({__proto__:null,name:nl,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(rl.msg,nl,{hint:rl.hint,elements:t})}});const il="core/linter-rules/no-unused-vars",al=gt({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the ``."}});var sl=Object.freeze({__proto__:null,name:il,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(al.msg,il,{hint:al.hint,elements:t})}});const cl="core/linter-rules/privsec-section",ll=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 dl=Object.freeze({__proto__:null,name:cl,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(ll.msg,cl,{hint:ll.hint})}});const ul="core/linter-rules/wpt-tests-exist",pl=gt({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 fl=Object.freeze({__proto__:null,name:ul,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 Ot("Failed to parse WPT directory from testSuiteURI",`linter/${ul}`),console.error(e),null}const r=new URL("web-platform-tests/wpt/files",`${t}/`);r.searchParams.set("path",n);const o=await fetch(r);if(!o.ok){return Ot(`Failed to fetch files from WPT repository. Request failed with error: ${await o.text()} (${o.status})`,`linter/${ul}`),null}const{entries:i}=await o.json(),a=i.filter((e=>!e.endsWith("/")));return new Set(a)}(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=>{Ot(`${pl.msg} \`${t}\`.`,ul,{hint:pl.hint,elements:[e]})}))}});const hl="core/linter-rules/no-http-props",ml=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 gl=Object.freeze({__proto__:null,name:hl,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=>zt`${`[${e}]`}`));Ot(ml.msg,hl,{hint:ml.hint+e})}}});const bl="core/linter-rules/a11y",yl=["color-contrast","landmark-one-main","landmark-unique","region"];function wl(e){const t=[];for(const n of e.split("\n\n")){const[e,...r]=n.split(/^\s{2}/m),o=r.map((e=>`- ${e.trimEnd()}`)).join("\n");t.push(`${e}${o}`)}return t.join("\n\n")}var vl=Object.freeze({__proto__:null,name:bl,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(yl.map((e=>[e,{enabled:!1}]))),...t},...n,elementRef:!0,resultTypes:["violations"],reporter:"v1"};let o;try{o=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 It("Failed to load a11y linter.",bl),console.error(e),[]}try{return(await o.run(document,r)).violations}catch(e){return It("Error while looking for a11y issues.",bl),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:o,helpUrl:i}=e,a=`a11y/${n}: ${r}.`;for(const[e,n]of t){const t=wl(e);Ot(a,bl,{details:`\n\n${o}.\n\n${t}. ([Learn more](${i}))`,elements:n})}}}}),$l=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'}),xl=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 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 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} 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-1edtech.js.map diff --git a/builds/respec-1edtech.js.map b/builds/respec-1edtech.js.map index cb448bcab3..3c1810d60d 100644 --- a/builds/respec-1edtech.js.map +++ b/builds/respec-1edtech.js.map @@ -1 +1 @@ -{"version":3,"file":"respec-1edtech.js","sources":["../src/core/expose-modules.js","../src/core/l10n.js","../node_modules/idb/build/esm/wrap-idb-value.js","../node_modules/idb/build/esm/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/reindent.js","../src/core/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/1edtech.js","../src/core/location-hash.js","../src/core/defaults.js","../src/1edtech/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/1edtech/styles/1edtech-base.css.js","../src/1edtech/style.js","../src/1edtech/config.js","../src/1edtech/compute.js","../src/1edtech/utils.js","../src/1edtech/transclude.js","../src/core/github.js","../src/core/data-include.js","../src/1edtech/ajv-formats.js","../src/1edtech/templates/templateUtils.js","../src/1edtech/templates/classTemplate.js","../src/1edtech/templates/dataModelTemplate.js","../src/1edtech/templates/operationTemplate.js","../src/1edtech/templates/stereoTypeTemplate.js","../src/1edtech/templates/embeddedSelectionTemplate.js","../src/1edtech/mps.js","../src/1edtech/templates/enumerationTemplate.js","../src/1edtech/templates/interfaceTemplate.js","../src/1edtech/templates/jsonSchemaTemplate.js","../src/1edtech/templates/jsonSchemasTemplate.js","../src/1edtech/templates/openApiSchemaTemplate.js","../src/1edtech/templates/serviceModelTemplate.js","../src/1edtech/templates/classDiagramTemplate.js","../src/1edtech/privacy.js","../src/1edtech/translations/1edtech.js","../src/1edtech/templates/privacyImplicationsTemplate.js","../src/1edtech/templates/confidentialityLevelTemplate.js","../src/1edtech/post-markdown.js","../src/1edtech/templates/headers.js","../src/1edtech/headers.js","../src/core/id-headers.js","../src/1edtech/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/1edtech/inlines.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/1edtech/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/1edtech/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/1edtech/biblio.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/1edtech/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/styles/caniuse.css.js","../src/core/caniuse.js","../src/styles/mdn-annotation.css.js","../src/core/mdn-annotation.js","../src/1edtech/exporter.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/1edtech/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/dfn-panel.css.js","../src/core/dfn-panel.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/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/1edtech/cleanBody.js","../src/1edtech/title-attrs.js","../src/1edtech/scripts.js","../src/1edtech/comments.js","../src/1edtech/footers.js","../src/1edtech/templates/footers.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-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/wpt-tests-exist.js","../src/core/linter-rules/no-http-props.js","../src/core/linter-rules/a11y.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\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;\nif (html && !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;\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 cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = 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 promise\n .then((value) => {\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n // (see wrapFunction).\n if (value instanceof IDBCursor) {\n cursorRequestMap.set(value, request);\n }\n // Catching to avoid \"Uncaught Promise exceptions\"\n })\n .catch(() => { });\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 // Polyfill for objectStoreNames because of Edge.\n if (prop === 'objectStoreNames') {\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\n }\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 // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n if (func === IDBDatabase.prototype.transaction &&\n !('objectStoreNames' in IDBTransaction.prototype)) {\n return function (storeNames, ...args) {\n const tx = func.call(unwrap(this), storeNames, ...args);\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n return wrap(tx);\n };\n }\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(cursorRequestMap.get(this));\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\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\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));\n });\n }\n if (blocked)\n request.addEventListener('blocked', () => blocked());\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking)\n db.addEventListener('versionchange', () => blocking());\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', () => blocked());\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\nexport { deleteDB, openDB };\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 - a markdown parser\n * Copyright (c) 2011-2021, 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\nvar esmEntry$1 = {exports: {}};\n\nvar defaults$5 = {exports: {}};\n\nfunction getDefaults$1() {\n return {\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartLists: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nfunction changeDefaults$1(newDefaults) {\n defaults$5.exports.defaults = newDefaults;\n}\n\ndefaults$5.exports = {\n defaults: getDefaults$1(),\n getDefaults: getDefaults$1,\n changeDefaults: changeDefaults$1\n};\n\n/**\n * Helpers\n */\n\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = /[&<>\"']/g;\nconst escapeTestNoEncode = /[<>\"']|&(?!#?\\w+;)/;\nconst escapeReplaceNoEncode = /[<>\"']|&(?!#?\\w+;)/g;\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape$3(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n } else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n}\n\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\n\nfunction unescape$1(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon') 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}\n\nconst caret = /(^|[^\\[])\\^/g;\nfunction edit$1(regex, opt) {\n regex = regex.source || regex;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n val = val.source || val;\n val = val.replace(caret, '$1');\n regex = regex.replace(name, val);\n return obj;\n },\n getRegex: () => {\n return new RegExp(regex, opt);\n }\n };\n return obj;\n}\n\nconst nonWordAndColonTest = /[^\\w:]/g;\nconst originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\nfunction cleanUrl$1(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape$1(href))\n .replace(nonWordAndColonTest, '')\n .toLowerCase();\n } catch (e) {\n return null;\n }\n if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {\n return null;\n }\n }\n if (base && !originIndependentUrl.test(href)) {\n href = resolveUrl(base, href);\n }\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n } catch (e) {\n return null;\n }\n return href;\n}\n\nconst baseUrls = {};\nconst justDomain = /^[^:]+:\\/*[^/]*$/;\nconst protocol = /^([^:]+:)[\\s\\S]*$/;\nconst domain = /^([^:]+:\\/*[^/]*)[\\s\\S]*$/;\n\nfunction resolveUrl(base, href) {\n if (!baseUrls[' ' + base]) {\n // we can ignore everything in base after the last slash of its path component,\n // but we might need to add _that_\n // https://tools.ietf.org/html/rfc3986#section-3\n if (justDomain.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim$1(base, '/', true);\n }\n }\n base = baseUrls[' ' + base];\n const relativeBase = base.indexOf(':') === -1;\n\n if (href.substring(0, 2) === '//') {\n if (relativeBase) {\n return href;\n }\n return base.replace(protocol, '$1') + href;\n } else if (href.charAt(0) === '/') {\n if (relativeBase) {\n return href;\n }\n return base.replace(domain, '$1') + href;\n } else {\n return base + href;\n }\n}\n\nconst noopTest$1 = { exec: function noopTest() {} };\n\nfunction merge$2(obj) {\n let i = 1,\n target,\n key;\n\n for (; i < arguments.length; i++) {\n target = arguments[i];\n for (key in target) {\n if (Object.prototype.hasOwnProperty.call(target, key)) {\n obj[key] = target[key];\n }\n }\n }\n\n return obj;\n}\n\nfunction splitCells$1(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 curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n } else {\n // add space before unescaped |\n return ' |';\n }\n }),\n cells = row.split(/ \\|/);\n let i = 0;\n\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (!cells[cells.length - 1].trim()) { cells.pop(); }\n\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) 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// invert: Remove suffix of non-c chars instead. Default falsey.\nfunction rtrim$1(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\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 } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.substr(0, l - suffLen);\n}\n\nfunction findClosingBracket$1(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n const l = str.length;\n let level = 0,\n i = 0;\n for (; i < l; i++) {\n if (str[i] === '\\\\') {\n i++;\n } else if (str[i] === b[0]) {\n level++;\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 checkSanitizeDeprecation$1(opt) {\n if (opt && opt.sanitize && !opt.silent) {\n console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');\n }\n}\n\n// copied from https://stackoverflow.com/a/5450113/806777\nfunction repeatString$1(pattern, count) {\n if (count < 1) {\n return '';\n }\n let result = '';\n while (count > 1) {\n if (count & 1) {\n result += pattern;\n }\n count >>= 1;\n pattern += pattern;\n }\n return result + pattern;\n}\n\nvar helpers = {\n escape: escape$3,\n unescape: unescape$1,\n edit: edit$1,\n cleanUrl: cleanUrl$1,\n resolveUrl,\n noopTest: noopTest$1,\n merge: merge$2,\n splitCells: splitCells$1,\n rtrim: rtrim$1,\n findClosingBracket: findClosingBracket$1,\n checkSanitizeDeprecation: checkSanitizeDeprecation$1,\n repeatString: repeatString$1\n};\n\nconst { defaults: defaults$4 } = defaults$5.exports;\nconst {\n rtrim,\n splitCells,\n escape: escape$2,\n findClosingBracket\n} = helpers;\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape$2(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\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 } else {\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape$2(text)\n };\n }\n}\n\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n\n if (matchIndentToCode === null) {\n return text;\n }\n\n const indentToCode = matchIndentToCode[1];\n\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n\n const [indentInNode] = matchIndentInNode;\n\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n\n return node;\n })\n .join('\\n');\n}\n\n/**\n * Tokenizer\n */\nvar Tokenizer_1$1 = class Tokenizer {\n constructor(options) {\n this.options = options || defaults$4;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap) {\n if (cap[0].length > 1) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n return { raw: '\\n' };\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\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\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim() : cap[2],\n text\n };\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\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n } else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n\n const token = {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text: text,\n tokens: []\n };\n this.lexer.inline(token.text, token.tokens);\n return token;\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\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ *> ?/gm, '');\n\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens: this.lexer.blockTokens(text, []),\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, lines, itemContents;\n\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n\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\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?: [^\\\\n]*| *)(?:\\\\n[^\\\\n]*)*(?:\\\\n|$))`);\n\n // Get each top-level item\n while (src) {\n if (this.rules.block.hr.test(src)) { // End list if we encounter an HR (possibly move into itemRegex?)\n break;\n }\n\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n lines = cap[2].split('\\n');\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = lines[0].trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = cap[1].length + (indent > 4 ? 1 : indent); // intented code blocks after 4 spaces; indent is always 1\n itemContents = lines[0].slice(indent - cap[1].length);\n }\n\n blankLine = false;\n raw = cap[0];\n\n if (!lines[0] && /^ *$/.test(lines[1])) { // items begin with at most one blank line\n raw = cap[1] + lines.slice(0, 2).join('\\n') + '\\n';\n list.loose = true;\n lines = [];\n }\n\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])`);\n\n for (i = 1; i < lines.length; i++) {\n line = lines[i];\n\n if (this.options.pedantic) { // Re-align to follow commonmark nesting rules\n line = line.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(line)) {\n raw = cap[1] + lines.slice(0, i).join('\\n') + '\\n';\n break;\n }\n\n // Until we encounter a blank line, item contents do not need indentation\n if (!blankLine) {\n if (!line.trim()) { // Check if current line is empty\n blankLine = true;\n }\n\n // Dedent if possible\n if (line.search(/[^ ]/) >= indent) {\n itemContents += '\\n' + line.slice(indent);\n } else {\n itemContents += '\\n' + line;\n }\n continue;\n }\n\n // Dedent this line\n if (line.search(/[^ ]/) >= indent || !line.trim()) {\n itemContents += '\\n' + line.slice(indent);\n continue;\n } else { // Line was not properly indented; end of this item\n raw = cap[1] + lines.slice(0, i).join('\\n') + '\\n';\n break;\n }\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 } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\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\n list.items.push({\n type: 'list_item',\n raw: raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n src = src.slice(raw.length);\n }\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.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n if (list.items[i].tokens.some(t => t.type === 'space')) {\n list.loose = true;\n list.items[i].loose = true;\n }\n }\n\n return list;\n }\n }\n\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n token.type = 'paragraph';\n token.text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$2(cap[0]);\n token.tokens = [];\n this.lexer.inline(token.text, token.tokens);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href: cap[2],\n title: cap[3]\n };\n }\n }\n\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (cap) {\n const item = {\n type: 'table',\n header: splitCells(cap[1]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] ? cap[3].replace(/\\n$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n item.raw = cap[0];\n\n let l = item.align.length;\n let i, j, k, row;\n for (i = 0; i < l; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n l = item.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = [];\n this.lexer.inlineTokens(item.header[j].text, item.header[j].tokens);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = [];\n this.lexer.inlineTokens(row[k].text, row[k].tokens);\n }\n }\n\n return item;\n }\n }\n }\n\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n const token = {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: []\n };\n this.lexer.inline(token.text, token.tokens);\n return token;\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const token = {\n type: 'paragraph',\n raw: cap[0],\n text: cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1],\n tokens: []\n };\n this.lexer.inline(token.text, token.tokens);\n return token;\n }\n }\n\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n const token = {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: []\n };\n this.lexer.inline(token.text, token.tokens);\n return token;\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$2(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^/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 } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape$2(cap[0]))\n : cap[0]\n };\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 return;\n }\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 } 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\n if (link) {\n href = link[1];\n title = link[3];\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n\n href = href.trim();\n if (/^$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n } else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline._escapes, '$1') : href,\n title: title ? title.replace(this.rules.inline._escapes, '$1') : title\n }, cap[0], this.lexer);\n }\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 let link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = links[link.toLowerCase()];\n if (!link || !link.href) {\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\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrong.lDelim.exec(src);\n if (!match) return;\n\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)) return;\n\n const nextChar = match[1] || match[2] || '';\n\n if (!nextChar || (nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) {\n const lLength = match[0].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;\n endReg.lastIndex = 0;\n\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n if (!rDelim) continue; // skip single * in __abc*abc__\n\n rLength = rDelim.length;\n\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\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\n delimTotal -= rLength;\n\n if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = src.slice(1, lLength + match.index + rLength);\n return {\n type: 'em',\n raw: src.slice(0, lLength + match.index + rLength + 1),\n text,\n tokens: this.lexer.inlineTokens(text, [])\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = src.slice(2, lLength + match.index + rLength - 1);\n return {\n type: 'strong',\n raw: src.slice(0, lLength + match.index + rLength + 1),\n text,\n tokens: this.lexer.inlineTokens(text, [])\n };\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$2(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\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\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\n autolink(src, mangle) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$2(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape$2(cap[1]);\n href = text;\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\n url(src, mangle) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape$2(this.options.mangle ? mangle(cap[0]) : cap[0]);\n href = 'mailto:' + text;\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$2(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + text;\n } else {\n href = text;\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\n inlineText(src, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$2(cap[0])) : cap[0];\n } else {\n text = escape$2(this.options.smartypants ? smartypants(cap[0]) : cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n};\n\nconst {\n noopTest,\n edit,\n merge: merge$1\n} = helpers;\n\n/**\n * Block-Level Grammar\n */\nconst block$1 = {\n newline: /^(?: *(?:\\n|$))+/,\n code: /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/,\n fences: /^ {0,3}(`{3,}(?=[^`\\n]*\\n)|~{3,})([^\\n]*)\\n(?:|([\\s\\S]*?)\\n)(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/,\n hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)( [^\\n]+?)?(?:\\n|$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|\\\\n*|$)' // (4)\n + '|\\\\n*|$)' // (5)\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 + '|(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *\\n? *]+)>?(?:(?: +\\n? *| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^([^\\n]+)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n // regex template, placeholders will be replaced according to different paragraph\n // interruption rules of commonmark and the original markdown spec:\n _paragraph: /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock$1._label = /(?!\\s*\\])(?:\\\\[\\[\\]]|[^\\[\\]])+/;\nblock$1._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock$1.def = edit(block$1.def)\n .replace('label', block$1._label)\n .replace('title', block$1._title)\n .getRegex();\n\nblock$1.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock$1.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block$1.bullet)\n .getRegex();\n\nblock$1.list = edit(block$1.list)\n .replace(/bull/g, block$1.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block$1.def.source + ')')\n .getRegex();\n\nblock$1._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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock$1._comment = /|$)/;\nblock$1.html = edit(block$1.html, 'i')\n .replace('comment', block$1._comment)\n .replace('tag', block$1._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock$1.paragraph = edit(block$1._paragraph)\n .replace('hr', block$1.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\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', ')|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block$1._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock$1.blockquote = edit(block$1.blockquote)\n .replace('paragraph', block$1.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock$1.normal = merge$1({}, block$1);\n\n/**\n * GFM Block Grammar\n */\n\nblock$1.gfm = merge$1({}, block$1.normal, {\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n});\n\nblock$1.gfm.table = edit(block$1.gfm.table)\n .replace('hr', block$1.hr)\n .replace('heading', ' {0,3}#{1,6} ')\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', ')|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock$1.pedantic = merge$1({}, block$1.normal, {\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+? *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block$1._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: /^ *\\[([^\\]]+)\\]: *]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n paragraph: edit(block$1.normal._paragraph)\n .replace('hr', block$1.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block$1.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n});\n\n/**\n * Inline-Level Grammar\n */\nconst inline$1 = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noopTest,\n tag: '^comment'\n + '|^' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. \n + '|^' // declaration, e.g. \n + '|^', // CDATA section\n link: /^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/,\n reflink: /^!?\\[(label)\\]\\[(?!\\s*\\])((?:\\\\[\\[\\]]?|[^\\[\\]\\\\])+)\\]/,\n nolink: /^!?\\[(?!\\s*\\])((?:\\[[^\\[\\]]*\\]|\\\\[\\[\\]]|[^\\[\\]])*)\\](?:\\[\\])?/,\n reflinkSearch: 'reflink|nolink(?!\\\\()',\n emStrong: {\n lDelim: /^(?:\\*+(?:([punct_])|[^\\s*]))|^_+(?:([punct*])|([^\\s_]))/,\n // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.\n // () Skip orphan delim inside strong (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a\n rDelimAst: /^[^_*]*?\\_\\_[^_*]*?\\*[^_*]*?(?=\\_\\_)|[punct_](\\*+)(?=[\\s]|$)|[^punct*_\\s](\\*+)(?=[punct_\\s]|$)|[punct_\\s](\\*+)(?=[^punct*_\\s])|[\\s](\\*+)(?=[punct_])|[punct_](\\*+)(?=[punct_])|[^punct*_\\s](\\*+)(?=[^punct*_\\s])/,\n rDelimUnd: /^[^_*]*?\\*\\*[^_*]*?\\_[^_*]*?(?=\\*\\*)|[punct*](\\_+)(?=[\\s]|$)|[^punct*_\\s](\\_+)(?=[punct*\\s]|$)|[punct*\\s](\\_+)(?=[^punct*_\\s])|[\\s](\\_+)(?=[punct*])|[punct*](\\_+)(?=[punct*])/ // ^- Not allowed for _\n },\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noopTest,\n text: /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\?@\\\\[\\\\]`^{|}~';\ninline$1.punctuation = edit(inline$1.punctuation).replace(/punctuation/g, inline$1._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, \ninline$1.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\ninline$1.escapedEmSt = /\\\\\\*|\\\\_/g;\n\ninline$1._comment = edit(block$1._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline$1.emStrong.lDelim = edit(inline$1.emStrong.lDelim)\n .replace(/punct/g, inline$1._punctuation)\n .getRegex();\n\ninline$1.emStrong.rDelimAst = edit(inline$1.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline$1._punctuation)\n .getRegex();\n\ninline$1.emStrong.rDelimUnd = edit(inline$1.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline$1._punctuation)\n .getRegex();\n\ninline$1._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline$1._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline$1._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])?)+(?![-_])/;\ninline$1.autolink = edit(inline$1.autolink)\n .replace('scheme', inline$1._scheme)\n .replace('email', inline$1._email)\n .getRegex();\n\ninline$1._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline$1.tag = edit(inline$1.tag)\n .replace('comment', inline$1._comment)\n .replace('attribute', inline$1._attribute)\n .getRegex();\n\ninline$1._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline$1._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline$1._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline$1.link = edit(inline$1.link)\n .replace('label', inline$1._label)\n .replace('href', inline$1._href)\n .replace('title', inline$1._title)\n .getRegex();\n\ninline$1.reflink = edit(inline$1.reflink)\n .replace('label', inline$1._label)\n .getRegex();\n\ninline$1.reflinkSearch = edit(inline$1.reflinkSearch, 'g')\n .replace('reflink', inline$1.reflink)\n .replace('nolink', inline$1.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline$1.normal = merge$1({}, inline$1);\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline$1.pedantic = merge$1({}, inline$1.normal, {\n strong: {\n start: /^__|\\*\\*/,\n middle: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n endAst: /\\*\\*(?!\\*)/g,\n endUnd: /__(?!_)/g\n },\n em: {\n start: /^_|\\*/,\n middle: /^()\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)|^_(?=\\S)([\\s\\S]*?\\S)_(?!_)/,\n endAst: /\\*(?!\\*)/g,\n endUnd: /_(?!_)/g\n },\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', inline$1._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline$1._label)\n .getRegex()\n});\n\n/**\n * GFM Inline Grammar\n */\n\ninline$1.gfm = merge$1({}, inline$1.normal, {\n escape: edit(inline$1.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\ 0.5) {\n ch = 'x' + ch.toString(16);\n }\n out += '&#' + ch + ';';\n }\n\n return out;\n}\n\n/**\n * Block Lexer\n */\nvar Lexer_1$1 = class Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults$3;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer$2();\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\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n } else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n } else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\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 /**\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 /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n')\n .replace(/\\t/g, ' ');\n\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/^ +$/gm, '');\n }\n let token, lastToken, cutSrc, lastParagraphClipped;\n\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\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.type) {\n tokens.push(token);\n }\n continue;\n }\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 } else {\n tokens.push(token);\n }\n continue;\n }\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\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\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\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\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\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\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 } 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\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\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\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(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\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 } else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\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 } else {\n tokens.push(token);\n }\n continue;\n }\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 } else {\n throw new Error(errMsg);\n }\n }\n }\n\n this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens) {\n this.inlineQueue.push({ src, tokens });\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n\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) + '[' + repeatString('a', 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) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n\n // Mask out escaped em & strong delimiters\n while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n }\n\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n\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\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\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 } else {\n tokens.push(token);\n }\n continue;\n }\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\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 } else {\n tokens.push(token);\n }\n continue;\n }\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\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\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\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\n // autolink\n if (token = this.tokenizer.autolink(src, mangle)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\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(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {\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 } else {\n tokens.push(token);\n }\n continue;\n }\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 } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n};\n\nconst { defaults: defaults$2 } = defaults$5.exports;\nconst {\n cleanUrl,\n escape: escape$1\n} = helpers;\n\n/**\n * Renderer\n */\nvar Renderer_1$1 = class Renderer {\n constructor(options) {\n this.options = options || defaults$2;\n }\n\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/\\S*/)[0];\n if (this.options.highlight) {\n const out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n code = code.replace(/\\n$/, '') + '\\n';\n\n if (!lang) {\n return '
          '\n        + (escaped ? code : escape$1(code, true))\n        + '
          \\n';\n }\n\n return '
          '\n      + (escaped ? code : escape$1(code, true))\n      + '
          \\n';\n }\n\n blockquote(quote) {\n return '
          \\n' + quote + '
          \\n';\n }\n\n html(html) {\n return html;\n }\n\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n return ''\n + text\n + '\\n';\n }\n // ignore IDs\n return '' + text + '\\n';\n }\n\n hr() {\n return this.options.xhtml ? '
          \\n' : '
          \\n';\n }\n\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul',\n startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '\\n';\n }\n\n listitem(text) {\n return '
        9. ' + text + '
        10. \\n';\n }\n\n checkbox(checked) {\n return ' ';\n }\n\n paragraph(text) {\n return '

          ' + text + '

          \\n';\n }\n\n table(header, body) {\n if (body) body = '' + body + '';\n\n return '\\n'\n + '\\n'\n + header\n + '\\n'\n + body\n + '
          \\n';\n }\n\n tablerow(content) {\n return '\\n' + content + '\\n';\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 + '\\n';\n }\n\n // span level renderer\n strong(text) {\n return '' + text + '';\n }\n\n em(text) {\n return '' + text + '';\n }\n\n codespan(text) {\n return '' + text + '';\n }\n\n br() {\n return this.options.xhtml ? '
          ' : '
          ';\n }\n\n del(text) {\n return '' + text + '';\n }\n\n link(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n let out = '
          ';\n return out;\n }\n\n image(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n\n let out = '\"'' : '>';\n return out;\n }\n\n text(text) {\n return text;\n }\n};\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\n\nvar TextRenderer_1$1 = class TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n\n em(text) {\n return text;\n }\n\n codespan(text) {\n return text;\n }\n\n del(text) {\n return text;\n }\n\n html(text) {\n return text;\n }\n\n text(text) {\n return text;\n }\n\n link(href, title, text) {\n return '' + text;\n }\n\n image(href, title, text) {\n return '' + text;\n }\n\n br() {\n return '';\n }\n};\n\n/**\n * Slugger generates header id\n */\n\nvar Slugger_1$1 = class Slugger {\n constructor() {\n this.seen = {};\n }\n\n serialize(value) {\n return value\n .toLowerCase()\n .trim()\n // remove html tags\n .replace(/<[!\\/a-z].*?>/ig, '')\n // remove unwanted chars\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '')\n .replace(/\\s/g, '-');\n }\n\n /**\n * Finds the next safe (unique) slug to use\n */\n getNextSafeSlug(originalSlug, isDryRun) {\n let slug = originalSlug;\n let occurenceAccumulator = 0;\n if (this.seen.hasOwnProperty(slug)) {\n occurenceAccumulator = this.seen[originalSlug];\n do {\n occurenceAccumulator++;\n slug = originalSlug + '-' + occurenceAccumulator;\n } while (this.seen.hasOwnProperty(slug));\n }\n if (!isDryRun) {\n this.seen[originalSlug] = occurenceAccumulator;\n this.seen[slug] = 0;\n }\n return slug;\n }\n\n /**\n * Convert string to unique id\n * @param {object} options\n * @param {boolean} options.dryrun Generates the next unique slug without updating the internal accumulator.\n */\n slug(value, options = {}) {\n const slug = this.serialize(value);\n return this.getNextSafeSlug(slug, options.dryrun);\n }\n};\n\nconst Renderer$2 = Renderer_1$1;\nconst TextRenderer$2 = TextRenderer_1$1;\nconst Slugger$2 = Slugger_1$1;\nconst { defaults: defaults$1 } = defaults$5.exports;\nconst {\n unescape\n} = helpers;\n\n/**\n * Parsing & Compiling\n */\nvar Parser_1$1 = class Parser {\n constructor(options) {\n this.options = options || defaults$1;\n this.options.renderer = this.options.renderer || new Renderer$2();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer$2();\n this.slugger = new Slugger$2();\n }\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 /**\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 /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '',\n i,\n j,\n k,\n l2,\n l3,\n row,\n cell,\n header,\n body,\n token,\n ordered,\n start,\n loose,\n itemBody,\n item,\n checked,\n task,\n checkbox,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\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 out += this.renderer.heading(\n this.parseInline(token.tokens),\n token.depth,\n unescape(this.parseInline(token.tokens, this.textRenderer)),\n this.slugger);\n continue;\n }\n case 'code': {\n out += this.renderer.code(token.text,\n token.lang,\n token.escaped);\n continue;\n }\n case 'table': {\n header = '';\n\n // header\n cell = '';\n l2 = token.header.length;\n for (j = 0; j < l2; j++) {\n cell += this.renderer.tablecell(\n this.parseInline(token.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[j];\n\n cell = '';\n l3 = row.length;\n for (k = 0; k < l3; k++) {\n cell += this.renderer.tablecell(\n this.parseInline(row[k].tokens),\n { header: false, align: token.align[k] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n body = this.parse(token.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n ordered = token.ordered;\n start = token.start;\n loose = token.loose;\n l2 = token.items.length;\n\n body = '';\n for (j = 0; j < l2; j++) {\n item = token.items[j];\n checked = item.checked;\n task = item.task;\n\n itemBody = '';\n if (item.task) {\n 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 } else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox\n });\n }\n } else {\n itemBody += checkbox;\n }\n }\n\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, checked);\n }\n\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n // TODO parse inline content if parameter markdown=1\n out += this.renderer.html(token.text);\n continue;\n }\n case 'paragraph': {\n out += this.renderer.paragraph(this.parseInline(token.tokens));\n continue;\n }\n case 'text': {\n body = token.tokens ? this.parseInline(token.tokens) : token.text;\n while (i + 1 < l && tokens[i + 1].type === 'text') {\n token = tokens[++i];\n body += '\\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\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 } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out;\n }\n\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '',\n i,\n token,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n 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\n switch (token.type) {\n case 'escape': {\n out += renderer.text(token.text);\n break;\n }\n case 'html': {\n out += renderer.html(token.text);\n break;\n }\n case 'link': {\n out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));\n break;\n }\n case 'image': {\n out += renderer.image(token.href, token.title, token.text);\n break;\n }\n case 'strong': {\n out += renderer.strong(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'em': {\n out += renderer.em(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'codespan': {\n out += renderer.codespan(token.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n out += renderer.del(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'text': {\n out += renderer.text(token.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 } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n};\n\nconst Lexer$1 = Lexer_1$1;\nconst Parser$1 = Parser_1$1;\nconst Tokenizer$1 = Tokenizer_1$1;\nconst Renderer$1 = Renderer_1$1;\nconst TextRenderer$1 = TextRenderer_1$1;\nconst Slugger$1 = Slugger_1$1;\nconst {\n merge,\n checkSanitizeDeprecation,\n escape\n} = helpers;\nconst {\n getDefaults,\n changeDefaults,\n defaults\n} = defaults$5.exports;\n\n/**\n * Marked\n */\nfunction marked$1(src, opt, callback) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked(): input parameter is undefined or null');\n }\n if (typeof src !== 'string') {\n throw new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n opt = merge({}, marked$1.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n tokens = Lexer$1.lex(src, opt);\n } catch (e) {\n return callback(e);\n }\n\n const done = function(err) {\n let out;\n\n if (!err) {\n try {\n if (opt.walkTokens) {\n marked$1.walkTokens(tokens, opt.walkTokens);\n }\n out = Parser$1.parse(tokens, opt);\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? callback(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!tokens.length) return done();\n\n let pending = 0;\n marked$1.walkTokens(tokens, function(token) {\n if (token.type === 'code') {\n pending++;\n setTimeout(() => {\n highlight(token.text, token.lang, function(err, code) {\n if (err) {\n return done(err);\n }\n if (code != null && code !== token.text) {\n token.text = code;\n token.escaped = true;\n }\n\n pending--;\n if (pending === 0) {\n done();\n }\n });\n }, 0);\n }\n });\n\n if (pending === 0) {\n done();\n }\n\n return;\n }\n\n try {\n const tokens = Lexer$1.lex(src, opt);\n if (opt.walkTokens) {\n marked$1.walkTokens(tokens, opt.walkTokens);\n }\n return Parser$1.parse(tokens, opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (opt.silent) {\n return '

          An error occurred:

          '\n        + escape(e.message + '', true)\n        + '
          ';\n }\n throw e;\n }\n}\n\n/**\n * Options\n */\n\nmarked$1.options =\nmarked$1.setOptions = function(opt) {\n merge(marked$1.defaults, opt);\n changeDefaults(marked$1.defaults);\n return marked$1;\n};\n\nmarked$1.getDefaults = getDefaults;\n\nmarked$1.defaults = defaults;\n\n/**\n * Use Extension\n */\n\nmarked$1.use = function(...args) {\n const opts = merge({}, ...args);\n const extensions = marked$1.defaults.extensions || { renderers: {}, childTokens: {} };\n let hasExtensions;\n\n args.forEach((pack) => {\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n hasExtensions = true;\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if (ext.renderer) { // Renderer extensions\n const prevRenderer = extensions.renderers ? extensions.renderers[ext.name] : null;\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 } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if (ext.tokenizer) { // 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 if (extensions[ext.level]) {\n extensions[ext.level].unshift(ext.tokenizer);\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 } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if (ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = marked$1.defaults.renderer || new Renderer$1();\n for (const prop in pack.renderer) {\n const prevRenderer = renderer[prop];\n // Replace renderer with func to run extension, but fall back if false\n renderer[prop] = (...args) => {\n let ret = pack.renderer[prop].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 = marked$1.defaults.tokenizer || new Tokenizer$1();\n for (const prop in pack.tokenizer) {\n const prevTokenizer = tokenizer[prop];\n // Replace tokenizer with func to run extension, but fall back if false\n tokenizer[prop] = (...args) => {\n let ret = pack.tokenizer[prop].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\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked$1.defaults.walkTokens;\n opts.walkTokens = function(token) {\n pack.walkTokens.call(this, token);\n if (walkTokens) {\n walkTokens.call(this, token);\n }\n };\n }\n\n if (hasExtensions) {\n opts.extensions = extensions;\n }\n\n marked$1.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked$1.walkTokens = function(tokens, callback) {\n for (const token of tokens) {\n callback.call(marked$1, token);\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n marked$1.walkTokens(cell.tokens, callback);\n }\n for (const row of token.rows) {\n for (const cell of row) {\n marked$1.walkTokens(cell.tokens, callback);\n }\n }\n break;\n }\n case 'list': {\n marked$1.walkTokens(token.items, callback);\n break;\n }\n default: {\n if (marked$1.defaults.extensions && marked$1.defaults.extensions.childTokens && marked$1.defaults.extensions.childTokens[token.type]) { // Walk any extensions\n marked$1.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {\n marked$1.walkTokens(token[childTokens], callback);\n });\n } else if (token.tokens) {\n marked$1.walkTokens(token.tokens, callback);\n }\n }\n }\n }\n};\n\n/**\n * Parse Inline\n */\nmarked$1.parseInline = function(src, opt) {\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n throw new Error('marked.parseInline(): input parameter is undefined or null');\n }\n if (typeof src !== 'string') {\n throw new Error('marked.parseInline(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n opt = merge({}, marked$1.defaults, opt || {});\n checkSanitizeDeprecation(opt);\n\n try {\n const tokens = Lexer$1.lexInline(src, opt);\n if (opt.walkTokens) {\n marked$1.walkTokens(tokens, opt.walkTokens);\n }\n return Parser$1.parseInline(tokens, opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if (opt.silent) {\n return '

          An error occurred:

          '\n        + escape(e.message + '', true)\n        + '
          ';\n }\n throw e;\n }\n};\n\n/**\n * Expose\n */\nmarked$1.Parser = Parser$1;\nmarked$1.parser = Parser$1.parse;\nmarked$1.Renderer = Renderer$1;\nmarked$1.TextRenderer = TextRenderer$1;\nmarked$1.Lexer = Lexer$1;\nmarked$1.lexer = Lexer$1.lex;\nmarked$1.Tokenizer = Tokenizer$1;\nmarked$1.Slugger = Slugger$1;\nmarked$1.parse = marked$1;\n\nvar marked_1 = marked$1;\n\nconst marked = marked_1;\nconst Lexer = Lexer_1$1;\nconst Parser = Parser_1$1;\nconst Tokenizer = Tokenizer_1$1;\nconst Renderer = Renderer_1$1;\nconst TextRenderer = TextRenderer_1$1;\nconst Slugger = Slugger_1$1;\n\nesmEntry$1.exports = marked;\nvar parse = esmEntry$1.exports.parse = marked;\nvar Parser_1 = esmEntry$1.exports.Parser = Parser;\nvar parser = esmEntry$1.exports.parser = Parser.parse;\nvar Renderer_1 = esmEntry$1.exports.Renderer = Renderer;\nvar TextRenderer_1 = esmEntry$1.exports.TextRenderer = TextRenderer;\nvar Lexer_1 = esmEntry$1.exports.Lexer = Lexer;\nvar lexer = esmEntry$1.exports.lexer = Lexer.lex;\nvar Tokenizer_1 = esmEntry$1.exports.Tokenizer = Tokenizer;\nvar Slugger_1 = esmEntry$1.exports.Slugger = Slugger;\n\nvar esmEntry = esmEntry$1.exports;\n\nexport { Lexer_1 as Lexer, Parser_1 as Parser, Renderer_1 as Renderer, Slugger_1 as Slugger, TextRenderer_1 as TextRenderer, Tokenizer_1 as Tokenizer, esmEntry as default, lexer, parse, parser };\n","var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\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(function (root, pluralize) {\n /* istanbul ignore else */\n if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n // Node.\n module.exports = pluralize();\n } else {\n // Browser global.\n root.pluralize = pluralize();\n }\n})(commonjsGlobal, function () {\n // Rule storage - pluralize and singularize need to be run sequentially,\n // while other rules can be optimized using an object for instant lookups.\n var pluralRules = [];\n var singularRules = [];\n var uncountables = {};\n var irregularPlurals = {};\n var irregularSingles = {};\n\n /**\n * Sanitize a pluralization rule to a usable regular expression.\n *\n * @param {(RegExp|string)} rule\n * @return {RegExp}\n */\n function sanitizeRule (rule) {\n if (typeof rule === 'string') {\n return new RegExp('^' + rule + '$', 'i');\n }\n\n return rule;\n }\n\n /**\n * Pass in a word token to produce a function that can replicate the case on\n * another word.\n *\n * @param {string} word\n * @param {string} token\n * @return {Function}\n */\n function restoreCase (word, token) {\n // Tokens are an exact match.\n if (word === token) return token;\n\n // Lower cased words. E.g. \"hello\".\n if (word === word.toLowerCase()) return token.toLowerCase();\n\n // Upper cased words. E.g. \"WHISKY\".\n if (word === word.toUpperCase()) return token.toUpperCase();\n\n // Title cased words. E.g. \"Title\".\n if (word[0] === word[0].toUpperCase()) {\n return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n }\n\n // Lower cased words. E.g. \"test\".\n return token.toLowerCase();\n }\n\n /**\n * Interpolate a regexp string.\n *\n * @param {string} str\n * @param {Array} args\n * @return {string}\n */\n function interpolate (str, args) {\n return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n return args[index] || '';\n });\n }\n\n /**\n * Replace a word using a rule.\n *\n * @param {string} word\n * @param {Array} rule\n * @return {string}\n */\n function replace (word, rule) {\n return word.replace(rule[0], function (match, index) {\n var result = interpolate(rule[1], arguments);\n\n if (match === '') {\n return restoreCase(word[index - 1], result);\n }\n\n return restoreCase(match, result);\n });\n }\n\n /**\n * Sanitize a word by passing in the word and sanitization rules.\n *\n * @param {string} token\n * @param {string} word\n * @param {Array} rules\n * @return {string}\n */\n function sanitizeWord (token, word, rules) {\n // Empty string or doesn't need fixing.\n if (!token.length || uncountables.hasOwnProperty(token)) {\n return word;\n }\n\n var len = rules.length;\n\n // Iterate over the sanitization rules and use the first one to match.\n while (len--) {\n var rule = rules[len];\n\n if (rule[0].test(word)) return replace(word, rule);\n }\n\n return word;\n }\n\n /**\n * Replace a word with the updated word.\n *\n * @param {Object} replaceMap\n * @param {Object} keepMap\n * @param {Array} rules\n * @return {Function}\n */\n function replaceWord (replaceMap, keepMap, rules) {\n return function (word) {\n // Get the correct token and case restoration functions.\n var token = word.toLowerCase();\n\n // Check against the keep object map.\n if (keepMap.hasOwnProperty(token)) {\n return restoreCase(word, token);\n }\n\n // Check against the replacement map for a direct word replacement.\n if (replaceMap.hasOwnProperty(token)) {\n return restoreCase(word, replaceMap[token]);\n }\n\n // Run all the rules against the word.\n return sanitizeWord(token, word, rules);\n };\n }\n\n /**\n * Check if a word is part of the map.\n */\n function checkWord (replaceMap, keepMap, rules, bool) {\n return function (word) {\n var token = word.toLowerCase();\n\n if (keepMap.hasOwnProperty(token)) return true;\n if (replaceMap.hasOwnProperty(token)) return false;\n\n return sanitizeWord(token, token, rules) === token;\n };\n }\n\n /**\n * Pluralize or singularize a word based on the passed in count.\n *\n * @param {string} word The word to pluralize\n * @param {number} count How many of the word exist\n * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n * @return {string}\n */\n function pluralize (word, count, inclusive) {\n var pluralized = count === 1\n ? pluralize.singular(word) : pluralize.plural(word);\n\n return (inclusive ? count + ' ' : '') + pluralized;\n }\n\n /**\n * Pluralize a word.\n *\n * @type {Function}\n */\n pluralize.plural = replaceWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Check if a word is plural.\n *\n * @type {Function}\n */\n pluralize.isPlural = checkWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Singularize a word.\n *\n * @type {Function}\n */\n pluralize.singular = replaceWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Check if a word is singular.\n *\n * @type {Function}\n */\n pluralize.isSingular = checkWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Add a pluralization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addPluralRule = function (rule, replacement) {\n pluralRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add a singularization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addSingularRule = function (rule, replacement) {\n singularRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add an uncountable word rule.\n *\n * @param {(string|RegExp)} word\n */\n pluralize.addUncountableRule = function (word) {\n if (typeof word === 'string') {\n uncountables[word.toLowerCase()] = true;\n return;\n }\n\n // Set singular and plural references for the word.\n pluralize.addPluralRule(word, '$0');\n pluralize.addSingularRule(word, '$0');\n };\n\n /**\n * Add an irregular word definition.\n *\n * @param {string} single\n * @param {string} plural\n */\n pluralize.addIrregularRule = function (single, plural) {\n plural = plural.toLowerCase();\n single = single.toLowerCase();\n\n irregularSingles[single] = plural;\n irregularPlurals[plural] = single;\n };\n\n /**\n * Irregular rules.\n */\n [\n // Pronouns.\n ['I', 'we'],\n ['me', 'us'],\n ['he', 'they'],\n ['she', 'they'],\n ['them', 'them'],\n ['myself', 'ourselves'],\n ['yourself', 'yourselves'],\n ['itself', 'themselves'],\n ['herself', 'themselves'],\n ['himself', 'themselves'],\n ['themself', 'themselves'],\n ['is', 'are'],\n ['was', 'were'],\n ['has', 'have'],\n ['this', 'these'],\n ['that', 'those'],\n // Words ending in with a consonant and `o`.\n ['echo', 'echoes'],\n ['dingo', 'dingoes'],\n ['volcano', 'volcanoes'],\n ['tornado', 'tornadoes'],\n ['torpedo', 'torpedoes'],\n // Ends with `us`.\n ['genus', 'genera'],\n ['viscus', 'viscera'],\n // Ends with `ma`.\n ['stigma', 'stigmata'],\n ['stoma', 'stomata'],\n ['dogma', 'dogmata'],\n ['lemma', 'lemmata'],\n ['schema', 'schemata'],\n ['anathema', 'anathemata'],\n // Other irregular rules.\n ['ox', 'oxen'],\n ['axe', 'axes'],\n ['die', 'dice'],\n ['yes', 'yeses'],\n ['foot', 'feet'],\n ['eave', 'eaves'],\n ['goose', 'geese'],\n ['tooth', 'teeth'],\n ['quiz', 'quizzes'],\n ['human', 'humans'],\n ['proof', 'proofs'],\n ['carve', 'carves'],\n ['valve', 'valves'],\n ['looey', 'looies'],\n ['thief', 'thieves'],\n ['groove', 'grooves'],\n ['pickaxe', 'pickaxes'],\n ['passerby', 'passersby']\n ].forEach(function (rule) {\n return pluralize.addIrregularRule(rule[0], rule[1]);\n });\n\n /**\n * Pluralization rules.\n */\n [\n [/s?$/i, 's'],\n [/[^\\u0000-\\u007F]$/i, '$0'],\n [/([^aeiou]ese)$/i, '$1'],\n [/(ax|test)is$/i, '$1es'],\n [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n [/(e[mn]u)s?$/i, '$1s'],\n [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n [/(seraph|cherub)(?:im)?$/i, '$1im'],\n [/(her|at|gr)o$/i, '$1oes'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n [/sis$/i, 'ses'],\n [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n [/([^aeiouy]|qu)y$/i, '$1ies'],\n [/([^ch][ieo][ln])ey$/i, '$1ies'],\n [/(x|ch|ss|sh|zz)$/i, '$1es'],\n [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n [/(pe)(?:rson|ople)$/i, '$1ople'],\n [/(child)(?:ren)?$/i, '$1ren'],\n [/eaux$/i, '$0'],\n [/m[ae]n$/i, 'men'],\n ['thou', 'you']\n ].forEach(function (rule) {\n return pluralize.addPluralRule(rule[0], rule[1]);\n });\n\n /**\n * Singularization rules.\n */\n [\n [/s$/i, ''],\n [/(ss)$/i, '$1'],\n [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n [/ies$/i, 'y'],\n [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n [/\\b(mon|smil)ies$/i, '$1ey'],\n [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n [/(seraph|cherub)im$/i, '$1'],\n [/(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 [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n [/(test)(?:is|es)$/i, '$1is'],\n [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n [/(alumn|alg|vertebr)ae$/i, '$1a'],\n [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n [/(matr|append)ices$/i, '$1ix'],\n [/(pe)(rson|ople)$/i, '$1rson'],\n [/(child)ren$/i, '$1'],\n [/(eau)x?$/i, '$1'],\n [/men$/i, 'man']\n ].forEach(function (rule) {\n return pluralize.addSingularRule(rule[0], rule[1]);\n });\n\n /**\n * Uncountable rules.\n */\n [\n // Singular words with no plurals.\n 'adulthood',\n 'advice',\n 'agenda',\n 'aid',\n 'aircraft',\n 'alcohol',\n 'ammo',\n 'analytics',\n 'anime',\n 'athletics',\n 'audio',\n 'bison',\n 'blood',\n 'bream',\n 'buffalo',\n 'butter',\n 'carp',\n 'cash',\n 'chassis',\n 'chess',\n 'clothing',\n 'cod',\n 'commerce',\n 'cooperation',\n 'corps',\n 'debris',\n 'diabetes',\n 'digestion',\n 'elk',\n 'energy',\n 'equipment',\n 'excretion',\n 'expertise',\n 'firmware',\n 'flounder',\n 'fun',\n 'gallows',\n 'garbage',\n 'graffiti',\n 'hardware',\n 'headquarters',\n 'health',\n 'herpes',\n 'highjinks',\n 'homework',\n 'housework',\n 'information',\n 'jeans',\n 'justice',\n 'kudos',\n 'labour',\n 'literature',\n 'machinery',\n 'mackerel',\n 'mail',\n 'media',\n 'mews',\n 'moose',\n 'music',\n 'mud',\n 'manga',\n 'news',\n 'only',\n 'personnel',\n 'pike',\n 'plankton',\n 'pliers',\n 'police',\n 'pollution',\n 'premises',\n 'rain',\n 'research',\n 'rice',\n 'salmon',\n 'scissors',\n 'series',\n 'sewage',\n 'shambles',\n 'shrimp',\n 'software',\n 'species',\n 'staff',\n 'swine',\n 'tennis',\n 'traffic',\n 'transportation',\n 'trout',\n 'tuna',\n 'wealth',\n 'welfare',\n 'whiting',\n 'wildebeest',\n 'wildlife',\n 'you',\n /pok[eé]mon$/i,\n // Regexes.\n /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n /deer$/i, // \"deer\", \"reindeer\"\n /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n /measles$/i,\n /o[iu]s$/i, // \"carnivorous\"\n /pox$/i, // \"chickpox\", \"smallpox\"\n /sheep$/i\n ].forEach(pluralize.addUncountableRule);\n\n return pluralize;\n});\n}(pluralize$1));\n\nvar pluralize = pluralize$1.exports;\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;ro;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b>>0;n\"+e+\"\",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=''+e+\"\",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

          ',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+\">\"}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 {\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(/>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = resolveLanguageAlias(lang.toLowerCase());\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-ignore\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = (data[lang] && data[lang][key]) || 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// --- 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 * Formats a date to \"yyyy-mm-dd\".\n * @param {Date} date\n */\nexport function toShortIsoDate(date) {\n return ISODate.format(date);\n}\n\n/**\n * Given either a Date object or a date in `YYYY-MM-DD` format, return a\n * human-formatted date suitable for use in the specification.\n * @param {Date | string} [date]\n */\nexport function humanDate(\n date = new Date(),\n lang = document.documentElement.lang || \"en\"\n) {\n if (!(date instanceof Date)) date = new Date(date);\n const langs = [lang, \"en\"];\n const day = date.toLocaleString(langs, {\n day: \"2-digit\",\n timeZone: \"UTC\",\n });\n const month = date.toLocaleString(langs, {\n month: \"long\",\n timeZone: \"UTC\",\n });\n const year = date.toLocaleString(langs, {\n year: \"numeric\",\n timeZone: \"UTC\",\n });\n // date month year\n return `${day} ${month} ${year}`;\n}\n\n/**\n * Given either a Date object or a date in `YYYY-MM-DD` format, return an ISO\n * formatted date suitable for use in a xsd:datetime item\n * @param {Date | string} date\n */\nexport function isoDate(date) {\n return (date instanceof Date ? date : new Date(date)).toISOString();\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} 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 * `` 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}\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 `` 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 `` 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
          ), 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 *

          Int3.member

          \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 Foo.Bar() 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 * 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 `
          ` 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} */\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} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array} [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} walker\n * @return {IterableIterator}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map}\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[0]} message\n * @param {Parameters[1]} plugin\n * @param {Parameters[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 * 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 return 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}\n","// @ts-check\nimport { expose } from \"./expose-modules.js\";\nimport { showError } from \"./utils.js\";\n\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\nconst subscriptions = new Map();\n\nexport function pub(topic, ...data) {\n if (!subscriptions.has(topic)) {\n return; // Nothing to do...\n }\n Array.from(subscriptions.get(topic)).forEach(cb => {\n try {\n cb(...data);\n } catch (err) {\n const msg = `Error when calling function ${cb.name}.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n }\n });\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = data\n // to structured clonable\n .map(arg => String(JSON.stringify(arg.stack || arg)));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n/**\n * Subscribes to a message type.\n *\n * @param {string} topic The topic to subscribe to (e.g., \"start-all\")\n * @param {Function} cb Callback function\n * @param {Object} [opts]\n * @param {Boolean} [opts.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, opts = { once: false }) {\n if (opts.once) {\n return sub(topic, function wrapper(...args) {\n unsub({ topic, cb: wrapper });\n cb(...args);\n });\n }\n if (subscriptions.has(topic)) {\n subscriptions.get(topic).add(cb);\n } else {\n subscriptions.set(topic, new Set([cb]));\n }\n return { topic, cb };\n}\n/**\n * Unsubscribe from messages.\n *\n * @param {Object} opaque The object that was returned from calling sub()\n */\nexport function unsub({ topic, cb }) {\n // opaque is whatever is returned by sub()\n const callbacks = subscriptions.get(topic);\n if (!callbacks || !callbacks.has(cb)) {\n console.warn(\"Already unsubscribed:\", topic, cb);\n return false;\n }\n return callbacks.delete(cb);\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``;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n \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 * This module also adds the legacy `document.respecIsReady` property for\n * backward compatibility. It is now an alias to `document.respec.ready`.\n */\nimport { serialize } from \"../core/exporter.js\";\nimport { showWarning } from \"../core/utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise} */\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 let respecIsReadyWarningShown = false;\n Object.defineProperty(document, \"respecIsReady\", {\n get() {\n if (!respecIsReadyWarningShown) {\n const msg =\n \"`document.respecIsReady` is deprecated and will be removed in a future release.\";\n const hint = \"Use `document.respec.ready` instead.\";\n showWarning(msg, name, { hint });\n respecIsReadyWarningShown = true;\n }\n return document.respec.ready;\n },\n });\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 { 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 => {\n try {\n return await f(config, document);\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 { 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 => {\n try {\n return await f(config, document);\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 respecConfig.state = {};\n await executePreparePass(runnables, respecConfig);\n await executeRunPass(runnables, respecConfig);\n respecConfig.state = {};\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#respec-pill,\n.respec-info-button {\n background: #fff;\n height: 2.5em;\n color: rgb(120, 120, 120);\n border: 1px solid #ccc;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\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}\n\n.respec-info-button:focus,\n.respec-info-button:hover {\n opacity: 1;\n transition: opacity 0.2s;\n}\n\n#respec-pill:disabled {\n font-size: 2.8px;\n text-indent: -9999em;\n border-top: 1.1em solid rgba(40, 40, 40, 0.2);\n border-right: 1.1em solid rgba(40, 40, 40, 0.2);\n border-bottom: 1.1em solid rgba(40, 40, 40, 0.2);\n border-left: 1.1em solid #ffffff;\n transform: translateZ(0);\n animation: respec-spin 0.5s infinite linear;\n box-shadow: none;\n}\n\n#respec-pill:disabled,\n#respec-pill:disabled:after {\n border-radius: 50%;\n width: 10em;\n height: 10em;\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: #fff;\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: rgb(240, 240, 240);\n background: 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: white;\n background: 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: #193766;\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 list-style: none;\n font-family: sans-serif;\n background-color: rgb(255, 251, 230);\n font-size: 0.85em;\n}\n\n.respec-warning-list > li,\n.respec-error-list > li {\n padding: 0.4em 0.7em;\n}\n\n.respec-warning-list > li::before {\n content: \"⚠️\";\n padding-right: 0.5em;\n}\n.respec-warning-list p,\n.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-error-list li::before {\n content: \"💥\";\n padding-right: 0.5em;\n}\n\n.respec-error-list li {\n padding: 0.4em 0.7em;\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n.respec-error-list li > p {\n margin: 0;\n padding: 0;\n display: inline-block;\n}\n\n.respec-error-list li > p:first-child,\n.respec-warning-list li > p:first-child {\n display: inline;\n}\n\n.respec-warning-list > li li,\n.respec-error-list > li li {\n margin: 0;\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 margin: auto;\n top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n width: 79%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n}\n\n@media screen and (min-width: 78em) {\n .respec-modal {\n width: 62%;\n }\n}\n\n.respec-modal h3 {\n margin: 0;\n padding: 0.2em;\n text-align: center;\n color: black;\n background: linear-gradient(\n to bottom,\n rgba(238, 238, 238, 1) 0%,\n rgba(238, 238, 238, 1) 50%,\n rgba(204, 204, 204, 1) 100%\n );\n font-size: 1em;\n}\n\n.respec-modal .inside div p {\n padding-left: 1cm;\n}\n\n#respec-menu button.respec-option {\n background: white;\n padding: 0 0.2cm;\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#respec-menu button:focus {\n background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\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`;\n","// @ts-check\n/**\n * Module core/reindent\n *\n * Removes common indents across the IDL texts,\n * so that indentation inside
           won't affect the rendered result.\n */\n\nexport const name = \"core/reindent\";\n\n/**\n * @param {string} 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\nexport function run() {\n  for (const pre of document.getElementsByTagName(\"pre\")) {\n    pre.innerHTML = reindent(pre.innerHTML);\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/chjj/marked\n *\n * Note that the content of SECTION elements, and elements with a\n * class name of \"note\", \"issue\" or \"req\" are also parsed.\n *\n * The HTML created by the Markdown parser is turned into a nested\n * structure of SECTION elements, following the structure given by\n * the headings. For example, the following markup:\n *\n *     Title\n *     -----\n *\n *     ### Subtitle ###\n *\n *     Here's some text.\n *\n *     ### Another subtitle ###\n *\n *     More text.\n *\n * will be transformed into:\n *\n *     
          \n *

          Title

          \n *
          \n *

          Subtitle

          \n *

          Here's some text.

          \n *
          \n *
          \n *

          Another subtitle

          \n *

          More text.

          \n *
          \n *
          \n *\n * The whitespace of pre elements are left alone.\n */\n\nimport { getElementIndentation } from \"./utils.js\";\nimport { marked } from \"./import-maps.js\";\nimport { reindent } from \"./reindent.js\";\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 `
          ${code}
          `;\n }\n\n // @ts-expect-error\n const html = super.code(code, language, isEscaped);\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(\"
          \", `
          `);\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, slugger) {\n    const headingWithIdRegex = /(.+)\\s+{#([\\w-]+)}$/;\n    if (headingWithIdRegex.test(text)) {\n      const [, textContent, id] = text.match(headingWithIdRegex);\n      return `${textContent}`;\n    }\n    // @ts-expect-error\n    return super.heading(text, level, raw, slugger);\n  }\n}\n\n/**\n * @param {string} text\n */\nexport function markdownToHtml(text) {\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  // @ts-ignore\n  const result = marked(potentialMarkdown, {\n    sanitize: false,\n    gfm: true,\n    headerIds: false,\n    langPrefix: \"\",\n    renderer: new Renderer(),\n  });\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 
          \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} */\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\nclass Builder {\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, process) {\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(process(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\nfunction structure(fragment, doc) {\n  function process(root) {\n    const stack = new Builder(doc);\n    while (root.firstChild) {\n      const node = root.firstChild;\n      if (node.nodeType !== Node.ELEMENT_NODE) {\n        root.removeChild(node);\n        continue;\n      }\n      switch (node.localName) {\n        case \"h1\":\n        case \"h2\":\n        case \"h3\":\n        case \"h4\":\n        case \"h5\":\n        case \"h6\":\n          stack.addHeader(node);\n          break;\n        case \"section\":\n          stack.addSection(node, process);\n          break;\n        default:\n          stack.addElement(node);\n      }\n    }\n    return stack.root;\n  }\n  return process(fragment);\n}\n\n/**\n * Re-structure DOM around elem whose markdown has been processed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n  const structuredInternals = structure(elem, elem.ownerDocument);\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\n/**\n * @param {Iterable} 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    for (const processedElem of processMDSections(document.body)) {\n      restructure(processedElem);\n    }\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  // Restructure the document properly\n  const fragment = structure(newBody, document);\n  // Frankenstein the whole thing back together\n  newBody.append(rsUI, fragment);\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 css from \"../styles/ui.css.js\";\nimport { joinAnd } from \"./utils.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``;\nconst menu = html``;\nconst closeButton = html` ui.closeModal()}\n  title=\"Close\"\n>\n  ❌\n`;\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``;\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``;\n  button.addEventListener(\"click\", () => {\n    button.setAttribute(\"aria-expanded\", \"true\");\n    const ol = html`
            `;\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``;\n const menuItem = html`
          1. ${button}
          2. `;\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`
            `;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`\n ${closeButton}\n

            ${title}

            \n
            ${content}
            \n `;\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 ? ` (Plugin: \"${err.plugin}\").` : \"\";\n const hint = err.hint ? ` ${err.hint}` : \"\";\n const elements = Array.isArray(err.elements)\n ? ` Occurred at: ${joinAnd(err.elements.map(generateMarkdownLink))}.`\n : \"\";\n const details = err.details\n ? `\\n\\n
            \\n${err.details}\\n
            \\n`\n : \"\";\n\n const text = `${err.message}${hint}${elements}${plugin}${details}`;\n return markdownToHtml(text);\n}\n\n/**\n * @param {Element} element\n * @param {number} i\n */\nfunction generateMarkdownLink(element, i) {\n return `[${i + 1}](#${element.id})`;\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/1edtech/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/1edtech/style.js\"),\n // Check configuration\n import(\"../src/1edtech/config.js\"),\n // Compute common values\n import(\"../src/1edtech/compute.js\"),\n // Process transcludes\n import(\"../src/1edtech/transclude.js\"),\n import(\"../src/core/github.js\"),\n import(\"../src/core/data-include.js\"),\n // Model Processing Service plugin\n import(\"../src/1edtech/mps.js\"),\n // Add the 1EdTech privacy appendix\n import(\"../src/1edtech/privacy.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/1edtech/post-markdown.js\"),\n import(\"../src/core/reindent.js\"),\n // import(\"../src/core/title.js\"),\n import(\"../src/1edtech/headers.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/1edtech/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n // Make sure markdown conformance section has an id\n import(\"../src/1edtech/inlines.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/1edtech/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 // Left in for legacy specs\n import(\"../src/1edtech/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n // Import 1EdTech biblio\n import(\"../src/1edtech/biblio.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/1edtech/contrib.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/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/1edtech/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/dfn-panel.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/custom-elements/index.js\"),\n // Clean up the document\n import(\"../src/1edtech/cleanBody.js\"),\n // Add title attributes to internal definition references\n import(\"../src/1edtech/title-attrs.js\"),\n // Insert 1EdTech stylesheet\n import(\"../src/1edtech/scripts.js\"),\n // Remove all comment nodes\n import(\"../src/1edtech/comments.js\"),\n // Add the 1EdTech footer\n import(\"../src/1edtech/footers.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-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/wpt-tests-exist.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n import(\"../src/core/linter-rules/a11y.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// Resets window.location.hash to jump to the right point in the document\n\nexport const name = \"core/location-hash\";\n\nexport function run() {\n if (!location.hash) {\n return;\n }\n document.respec.ready.then(() => {\n let hash = decodeURIComponent(location.hash).substr(1);\n const hasLink = document.getElementById(hash);\n const isLegacyFrag = /\\W/.test(hash);\n // Allow some degree of recovery for legacy fragments format.\n // See https://github.com/w3c/respec/issues/1353\n if (!hasLink && isLegacyFrag) {\n const id = hash\n .replace(/[\\W]+/gim, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\");\n if (document.getElementById(id)) {\n hash = id;\n }\n }\n location.hash = `#${hash}`;\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 1EdTech specs\n */\nexport const name = \"1edtech/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst imsDefaults = {};\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...imsDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...imsDefaults,\n ...conf,\n lint,\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/* Override code highlighter background */\n.hljs {\n background: transparent !important;\n}\n\n/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) abbr {\n border: none;\n}\n\ndfn {\n font-weight: bold;\n}\n\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\ncode {\n color: #c63501;\n}\n\nth code {\n color: inherit;\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/* --- TOC --- */\n\n.toc a,\n.tof a {\n text-decoration: none;\n}\n\na .secno,\na .figno {\n color: #000;\n}\n\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\n/* --- TABLE --- */\n\ntable.simple {\n border-spacing: 0;\n border-collapse: collapse;\n border-bottom: 3px solid #005a9c;\n}\n\n.simple th {\n background: #005a9c;\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th a {\n color: #fff;\n padding: 3px 5px;\n text-align: left;\n}\n\n.simple th[scope=\"row\"] {\n background: inherit;\n color: inherit;\n border-top: 1px solid #ddd;\n}\n\n.simple td {\n padding: 3px 10px;\n border-top: 1px solid #ddd;\n}\n\n.simple tr:nth-child(even) {\n background: #f0f6ff;\n}\n\n/* --- DL --- */\n\n.section dd > p:first-child {\n margin-top: 0;\n}\n\n.section dd > p:last-child {\n margin-bottom: 0;\n}\n\n.section dd {\n margin-bottom: 1em;\n}\n\n.section dl.attrs dd,\n.section dl.eldef dd {\n margin-bottom: 0;\n}\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\na[href].self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\nh2,\nh3,\nh4,\nh5,\nh6 {\n position: relative;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n:is(h2, h3, h4, h5, h6) > a.self-link {\n border: none;\n color: inherit;\n font-size: 83%;\n height: 2em;\n left: -1.6em;\n opacity: 0.5;\n position: absolute;\n text-align: center;\n text-decoration: none;\n top: 0;\n transition: opacity 0.2s;\n width: 2em;\n}\n\n:is(h2, h3, h4, h5, h6) > a.self-link::before{\n content: \"§\";\n display: block;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\n }\n\n /* Don't position self-link in headings off-screen */\n :is(h2, h3, h4, h5, h6) > a.self-link {\n left: auto;\n top: auto;\n }\n}\n\n@media print {\n .removeOnSave {\n display: none;\n }\n}\n`;\n","// @ts-check\n// Module core/style\n// Inserts the CSS that ReSpec uses into the document.\n//\n// IMPORTANT NOTE\n// To add you own styles, create a plugin that declares the css as a dependency\n// and create a build of your new ReSpec profile.\n//\n// CONFIGURATION\n// - noReSpecCSS: if you're using a profile that loads this module but you don't want\n// the style, set this to true\nimport css from \"../styles/respec.css.js\";\n\nexport const name = \"core/style\";\n\n// Opportunistically inserts the style, with the chance to reduce some FOUC\nconst styleElement = insertStyle();\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\nexport function run(conf) {\n if (conf.noReSpecCSS) {\n styleElement.remove();\n }\n}\n","/* 1EdTech styles and overrides */\nconst css = String.raw;\n\n// prettier-ignore\nexport default css`@charset \"UTF-8\";\n/* Base CSS for 1EdTech specifications. This builds on and in some cases\n * overrides the ReSpec and W3C/TR stylesheets:\n * - https://github.com/w3c/respec/assets/respec2.css\n * - https://www.w3.org/StyleSheets/TR/2016/base.css\n */\n@import url(https://fonts.googleapis.com/css?family=Roboto|Roboto+Condensed|Source+Code+Pro);\n/** variables ******************************************************************/\n:root {\n --fgclr1: rgba(0, 0, 0, 1);\n --fgclr2: rgba(0, 90, 156, 1);\n --fgclr3: rgba(70, 130, 180, 1);\n --fgclr4: rgba(40, 100, 150, 1);\n --gray: rgba(200, 200, 200, 0.9);\n --lightgray: rgba(240, 240, 240, 0.9);\n --lightestgray: rgba(250, 250, 250, 0.8);\n --darkgray: rgba(180, 180, 180, 1);\n}\n\n/** fonts **********************************************************************/\nbody {\n font-family: 'Roboto', Arial, Helvetica, sans-serif;\n}\n\npre, code, samp {\n font-family: 'Source Code Pro', monospace;\n}\n\n/** Header *********************************************************************/\nheader {\n border-bottom: 2px solid var(--gray);\n padding-bottom: 2em;\n}\n\n.header-top {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-flow: row nowrap;\n flex-flow: row nowrap;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n}\n\na#logo, a#ims-logo {\n text-decoration: none;\n border: 0;\n}\n\nh1.title {\n font-size: 200%;\n}\n\ndiv.subtitle {\n font-size: 150%;\n color: var(--fgclr2);\n}\n\n/* the copyright notice */\n#cpr {\n margin-bottom: 1.5em;\n margin-top: 2.5em;\n}\n\n#cpr p {\n margin-top: 0em;\n margin-bottom: 0em;\n}\n\n/* the vertical status bar top left */\n.statusPD {\n position: fixed;\n display: block;\n top: 0px;\n left: 0px;\n width: 300px;\n height: 30px;\n text-align: right;\n padding-top: 2px;\n padding-right: 2em;\n background-color: red;\n color: white;\n font-size: 20px;\n transform-origin: left top;\n transform: rotate(-90deg) translate(-100%, 0%);\n -ms-transform-origin: left top;\n -ms-transform: rotate(90deg);\n -webkit-transform-origin: left top;\n -webkit-transform: rotate(-90deg) translate(-100%, 0%);\n -moz-transform-origin: left top;\n -moz-transform: rotate(-90deg) translate(-100%, 0%);\n -o-transform-origin: left top;\n -o-transform: rotate(-90deg) translate(-100%, 0%);\n z-index: 12000;\n}\n\n.statusPD.final {\n background-color: blue;\n}\n\n/** Headings ******************************************************************/\nh1, h2, h3, h4, h5, h6, dt {\n page-break-after: avoid;\n page-break-inside: avoid;\n font: 100% sans-serif;\n font-family: inherit;\n line-height: 1.2;\n -webkit-hyphens: manual;\n -ms-hyphens: manual;\n hyphens: manual;\n}\n\nh2, h3, h4, h5, h6 {\n margin-top: 3rem;\n}\n\nh1, h2, h3, h4 {\n color: var(--fgclr4);\n background: transparent;\n}\n\nh1 {\n font-size: 170%;\n}\n\nh2 {\n font-size: 140%;\n}\n\nh3 {\n font-size: 120%;\n}\n\nh4 {\n font-weight: bold;\n}\n\nh5 {\n font-style: italic;\n}\n\nh6 {\n font-variant: small-caps;\n}\n\ndt {\n font-weight: bold;\n}\n\n/** Linkage ******************************************************************/\na[href].internalDFN {\n color: var(--fgclr1);\n text-decoration: none;\n border-bottom: 1px var(--fgclr2) dotted;\n}\n\na[href]:focus,\na[href]:hover {\n background: var(--lightgray);\n}\n\na[href]:active {\n color: #C00;\n border-color: #C00;\n}\n\n/** Examples *******************************************************************/\n.example {\n border: 1px solid var(--darkgray);\n counter-increment: example;\n}\n\n.example figcaption {\n background-color: var(--fgclr3);\n color: white;\n}\n\n/** Footer ******************************************************************/\nsection#revisionhistory table {\n margin-bottom: 3em;\n}\n\ndiv#endWarranty p {\n margin-top: 0.3em;\n margin-bottom: 0.3em;\n}\n\ndiv#endWarranty {\n margin-top: 6em;\n padding-top: 3em;\n border-top: 2px solid var(--gray);\n text-align: center;\n}\n\n/** tables *****************************************************************/\n/* The default table style has gray border, with th bgclr being light gray */\ntable {\n border-collapse: collapse;\n word-wrap: normal;\n overflow-wrap: normal;\n -webkit-hyphens: manual;\n -ms-hyphens: manual;\n hyphens: manual;\n width: 100%;\n margin-top: 1.5em;\n margin-bottom: 1.5em;\n max-width: 50em;\n border: 1px solid var(--gray);\n /*margin-left: 0em;*/\n}\n\ntd, th {\n padding-left: 1em;\n padding-right: 1em;\n padding-left: 1em;\n padding-right: 1em;\n text-align: left;\n text-align: start;\n vertical-align: top;\n border: 1px solid var(--gray);\n}\n\nth {\n font-weight: bold;\n background-color: var(--fgclr3);\n color: white;\n padding: 0.6em;\n}\n\ntd {\n padding: 0.8em;\n}\n\nth > * {\n padding: 0;\n margin: 0;\n}\n\n/* specific table styles */\ntable#version-table, table#no-cell-borders {\n border: 1px solid var(--gray);\n}\n\ntable#version-table td, table#no-cell-borders td {\n border: none;\n}\n\ntable#version-table td {\n padding: 0.2em;\n}\n\n/* For when values are extra-complex and need formatting for readability */\ntd.pre, td code {\n white-space: pre;\n overflow: scroll;\n}\n\n/** Index Tables *****************************************************/\n/* See also the data table styling section, which this effectively subclasses */\ntable.index {\n font-size: small;\n border-collapse: collapse;\n border-spacing: 0;\n text-align: left;\n margin: 1em 0;\n}\n\ntable.index td,\ntable.index th {\n padding: 0.4em;\n}\n\ntable.index tr:hover td:not([rowspan]),\ntable.index tr:hover th:not([rowspan]) {\n background: #f7f8f9;\n}\n\n/* The link in the first column in the property table (formerly a TD) */\ntable.index th:first-child a {\n font-weight: bold;\n}\n\n/** boxes *************************************************************/\n.alert {\n border: 2px solid red;\n padding: 0.3em;\n}\n\n/** inlines *************************************************************/\ndt > dfn {\n font-weight: bold;\n}\n\n/** \"Link here\" for section headings *****************************************/\na[href].hidden-reveal::before {\n content: \"›\";\n}\n\n/* w3c/respec change in how section headers are formed */\nh2 > a[href].self-link::before, h3 > a[href].self-link::before,\nh4 > a[href].self-link::before, h5 > a[href].self-link::before,\nh6 > a[href].self-link::before {\n content: \"›\";\n}\n\na[href].hidden-reveal, a[href].hidden-reveal:visited {\n text-decoration: none;\n border-bottom: none;\n}\n\n/** Admonitions for section headings *****************************************/\n.admonition {\n margin-top: 1em;\n margin-bottom: 1em;\n margin: 1em 0;\n border-left-width: .5em;\n border-left-style: solid;\n padding: 0.5em 1.2em 0.5em;\n position: relative;\n clear: both;\n}\n\n.admonition .admon-top {\n padding-right: 1em;\n min-width: 7.5em;\n color: #e05252;\n text-transform: uppercase;\n}\n\n.admonition .note-title, .admonition .ednote-title {\n color: #2b2;\n}\n\n.admonition .warning-title, .admonition .ednote-title {\n color: #f22;\n}\n\n.admonition.issue {\n border-color: #e05252;\n background: #fbe9e9;\n counter-increment: issue;\n overflow: auto;\n}\n\n.admonition.note, .admonition.ednote {\n border-color: #52e052;\n background: #e9fbe9;\n}\n\n.admonition > p:first-child {\n margin-top: 0;\n}\n\n.admonition.warning {\n border-color: #f11;\n border-width: .2em;\n border-style: solid;\n background: #fbe9e9;\n padding-top: 1em;\n}\n\n.admonition .warning-title:before {\n content: \"⚠\";\n /*U+26A0 WARNING SIGN*/\n font-size: 3em;\n float: left;\n height: 100%;\n padding-right: .3em;\n vertical-align: top;\n margin-top: -0.5em;\n}\n\n/******************************************************************************\n * Overrides to W3C/TR/2016/base.css *\n ******************************************************************************\n\n/******************************************************************************/\n/* Body */\n/******************************************************************************/\nbody {\n -webkit-hyphens: auto;\n -ms-hyphens: auto;\n hyphens: auto;\n /* Colors */\n color: var(--fgclr1);\n}\n\n/******************************************************************************/\n/* Images */\n/******************************************************************************/\nfigure, .figure, .sidefigure {\n text-align: left;\n}\n\n.figure img, .sidefigure img, figure img,\n.figure pre, .sidefigure pre, figure pre {\n display: unset;\n}\n\n.caption, figcaption, caption {\n display: block;\n padding: 0.5em 0 0.5em 0.5em;\n}\n`;\n","// @ts-check\n/**\n * Module 1edtech/style\n *\n * Inserts 1EdTech stylesheet and replaces w3c/style.\n *\n * The CSS documents are pulled from known locations so the spec documents\n * can be located anywhere. Overrides are available via respecConfig.\n *\n * CONFIGURATION\n *\n * - overrideCSSLocation: by default 1edtech-base.css will be loaded from\n * ./styles/1edtech-base.css.js.\n */\n\nimport { linkCSS, toKeyValuePairs } from \"../core/utils.js\";\nimport css from \"./styles/1edtech-base.css.js\";\n\nexport const name = \"1edtech/style\";\n\n/**\n * From w3c/style\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 attachMetaViewport() {\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 document.head.insertBefore(meta, document.head.firstChild);\n}\n\n/**\n * From w3c/style\n *\n * Ignores specStatus and always loads base.css.\n */\nfunction linkW3cCSS() {\n linkCSS(document, \"https://www.w3.org/StyleSheets/TR/2016/base.css\");\n}\n\n/**\n * @param {*} conf respecConfig\n */\nexport async function run(conf) {\n // From w3c/style\n attachMetaViewport();\n linkW3cCSS();\n\n // Link to 1EdTech stylesheet\n if (conf.overrideCSSLocation) {\n const cssURL = conf.overrideCSSLocation;\n linkCSS(document, cssURL);\n } else {\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n }\n}\n","// @ts-check\n\n/**\n * check config and inform user if required ones are missing\n */\n\nimport { humanDate, showError } from \"../core/utils.js\";\n\nexport const name = \"1edtech/config\";\n\n/**\n * Returns true if value is not null or empty.\n *\n * @param { string } value\n */\nfunction check(value) {\n return value != undefined && value.trim().length > 0;\n}\n\n/**\n * @param {*} conf\n */\nexport async function run(conf) {\n if (!check(conf.specTitle)) {\n showError(\n \"head config must have the specTitle property set: \" +\n \"title of the document, excluding version\",\n name\n );\n conf.specTitle = \"@@@FIXME (conf.specTitle)\";\n }\n\n if (!check(conf.docVersion)) {\n showError(\n \"head config must have the docVersion property set, e.g. 'June 28, 2019'\",\n name\n );\n conf.docVersion = \"@@@FIXME (conf.docVersion)\";\n }\n\n if (!check(conf.specDate)) {\n if (conf.specStatus === \"Base Document\") {\n conf.specDate = humanDate();\n } else {\n showError(\n \"head config must have the specDate property set, e.g. 'June 28, 2019'\",\n name\n );\n conf.specDate = \"@@@FIXME(conf.specDate)\";\n }\n }\n\n if (!check(conf.specNature)) {\n showError(\n \"head config must have the specNature property set: one of 'normative' or 'informative'\",\n name\n );\n conf.specNature = \"informative\";\n }\n\n if (!check(conf.specType)) {\n showError(\n \"head config must have the specType property set: One of 'spec', 'cert', 'impl', 'errata', 'doc' \",\n name\n );\n conf.specType = \"spec\";\n }\n\n if (conf.specType === \"doc\" || conf.specType === \"proposal\") {\n return;\n }\n\n if (!check(conf.shortName)) {\n showError(\n \"head config must have the shortName property set: \" +\n \"list at urls-names.md#shortnames\",\n name\n );\n conf.shortName = \"FIXME\";\n }\n\n if (!check(conf.specStatus)) {\n showError(\n \"head config must have the specStatus property set to \" +\n \"one of 'Base Document', 'Candidate Final', Candidate Final Public', \" +\n \"or 'Final Release'\",\n name\n );\n conf.specStatus = \"@@@FIXME(conf.specStatus)\";\n }\n\n const statusValues = [\n \"Base Document\",\n \"Candidate Final\",\n \"Candidate Final Public\",\n \"Final Release\",\n \"Proposal\",\n ];\n if (statusValues.indexOf(conf.specStatus) == -1) {\n showError(\n \"head config must have the specStatus property set to \" +\n \"one of 'Base Document', 'Candidate Final', 'Candidate Final Public', \" +\n \"'Final Release', or 'Proposal'\",\n name\n );\n }\n\n if (!check(conf.specVersion)) {\n showError(\n \"head config must have the specVersion property set, e.g. '1.1'\",\n name\n );\n conf.specVersion = \"@@@FIXME(conf.specVersion)\";\n }\n}\n","// @ts-check\n\nexport const name = \"1edtech/compute\";\n\n/**\n * Compute misc variables used by multiple other modules and store them back in conf.\n *\n * @param {*} conf\n */\nexport async function run(conf) {\n const base = `https://www.imsglobal.org/spec/${conf.shortName}/`;\n\n // v1p2-style reformat for use in path segments\n conf.versionURL = `v${conf.specVersion}`.replace(\".\", \"p\");\n\n conf.thisURL = `${base}${conf.versionURL}/`;\n\n conf.errataURL = `${conf.thisURL}errata/`;\n\n if (conf.specType !== \"spec\") {\n conf.thisURL = `${conf.thisURL}${conf.specType}/`;\n }\n\n conf.latestURI = `${base}latest/`;\n if (conf.specType !== \"spec\") {\n conf.latestURI = `${conf.latestURI}${conf.specType}/`;\n }\n\n // needed for aux docs that need to point back to main spec\n conf.mainSpecURL = `${base}${conf.versionURL}/`;\n}\n","// @ts-check\nexport const name = \"1edtech/utils\";\n\n/**\n * Returns the first Element in the string.\n *\n * @param { string } string the HTML string to convert\n * @returns { Element } the first element in the string\n */\nexport function toHTMLElement(string) {\n const node = toHTMLNode(string);\n return node.parentElement.firstElementChild;\n}\n\nexport function toHTMLNodes(string) {\n const element = document.createElement(\"div\");\n element.innerHTML = string;\n return element.childNodes;\n}\n\nexport function toHTMLNode(string) {\n const element = document.createElement(\"div\");\n element.innerHTML = string;\n return element.childNodes[0];\n}\n","// @ts-check\n\nimport { pub } from \"../core/pubsubhub.js\";\nimport { toHTMLNodes } from \"./utils.js\";\n\nexport const name = \"1edtech/transclude\";\n\nexport async function run() {\n /*\n Filesystem transclusion is done using script elements with a class \n of 'transclude'. If the script element has a data-id attribute equal to the \n name of a string variable in global scope, then the script element is \n replaced with HTML nodes corresponding to the given variable. \n \n Each script element can declare zero, one or several string variables. In\n other words, it is possible to have one script which \n declares all transclude variables, and then src-less script elements which\n then only declares where the content should be inserted. It is equally ok\n to have each occurence of the script element in the body to bring in its own \n content via its own src. \n \n Note the use of template literals to allow easy authoring and maintenance\n of multi-line strings in the js files referenced. \n */\n\n let transclude = document.querySelector(\"script.transclude\");\n\n while (transclude !== null) {\n if (!transclude.hasAttribute(\"data-id\")) {\n pub(\"error\", \"transclude script element without data-id attribute\");\n break;\n }\n\n const str = window[transclude.getAttribute(\"data-id\")];\n\n if (str === undefined || typeof str !== \"string\") {\n pub(\n \"error\",\n `no transclude variable named '${str}' found in global scope`\n );\n break;\n }\n\n const newNodes = toHTMLNodes(str);\n\n for (let k = 0; k < newNodes.length; k++) {\n const clone = newNodes[k].cloneNode(true);\n transclude.parentNode.insertBefore(clone, transclude);\n }\n\n transclude.parentNode.removeChild(transclude);\n\n // Get the next transclude\n\n transclude = document.querySelector(\"script.transclude\");\n }\n}\n","// @ts-check\n/**\n * core/github\n *\n * @see https://github.com/w3c/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. (${\n ghURL.href\n }).`;\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// 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 { markdownToHtml, restructure } from \"./markdown.js\";\nimport { runTransforms, showError } from \"./utils.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 /** @type {NodeListOf} */\n const includables = document.querySelectorAll(\"[data-include]\");\n\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()).substr(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 } 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","/**\n * Add formats to ajv validator. These are the formats used by 1EdTech modeling tools.\n *\n * @param {Object} ajv Instance of ajv\n */\nexport function addFormats(ajv) {\n // number formats\n ajv.addFormat(\"byte\", validateInt32);\n ajv.addFormat(\"double\", validateNumber);\n ajv.addFormat(\"float\", validateNumber);\n ajv.addFormat(\"int32\", validateInt32);\n ajv.addFormat(\"int64\", validateInt64);\n // string formats\n ajv.addFormat(\"date\", /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/);\n ajv.addFormat(\n \"date-time\",\n /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i\n );\n ajv.addFormat(\n \"uri\",\n /^(?:[a-z][a-z0-9+\\-.]*:)?(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\\.[a-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)|(?:[a-z0-9\\-._~!$&'\"()*+,;=]|%[0-9a-f]{2})*)(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})*)*|\\/(?:(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\\?(?:[a-z0-9\\-._~!$&'\"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\\-._~!$&'\"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i\n );\n ajv.addFormat(\n \"uuid\",\n /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i\n );\n}\n\nconst MIN_INT32 = -(2 ** 31);\nconst MAX_INT32 = 2 ** 31 - 1;\n\nfunction validateInt32(value) {\n return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;\n}\n\nfunction validateInt64(value) {\n return Number.isInteger(value);\n}\n\nfunction validateNumber() {\n return true;\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render a MPS issue as a Respec issue.\n * @param {String} issue A MPS issue (\"q:\" in a .lines file).\n * @returns The issue wrapped in a div with class=\"issue\".\n */\nexport function renderIssue(issue) {\n return html`
            `;\n}\n\n/**\n * Render a MPS note as a Respec note.\n * @param {String} note A MPS note (\"n:\" in a .lines file).\n * @returns The note wrapped in a div with class=\"note\".\n */\nexport function renderNote(note) {\n return html`
            ${note}
            `;\n}\n\n/**\n * Render a MPS privacy doc as a Respec note.\n * @param {*} config The ReSpec config object.\n * @param {String} doc A MPS privacy doc (\"pd:\" in a .lines file).\n * @returns The doc wrapped in a div with class=\"note\".\n */\nexport function renderPrivacyImplicationDoc(config, doc) {\n if (config.showPrivacyAnnotations && doc) {\n return html`
            Privacy implication: ${doc}
            `;\n }\n}\n/**\n * Render a term as HTML.\n * @param {*} term A MPS model for a property representing an enumeration\n * or vocabulary term.\n * @returns A table row with information about the term.\n */\nexport function renderTerm(term) {\n const id = `${term.parentClass.name}.${term.name}`.toLowerCase();\n return html`\n ${term.name}\n \n ${term.documentation.description}\n ${term.documentation.issues.map(renderIssue)}\n ${term.documentation.notes.map(renderNote)}\n \n `;\n}\n\n/**\n * Return a clickable link to the type definition.\n * @param {*} type The MPS ModelClass object.\n * @returns {HTMLAnchorElement} Returns an anchor element that links to the property type definition.\n */\nexport function renderType(type) {\n let name = type.name;\n if (\n type.stereoType === \"Enumeration\" ||\n type.stereoType === \"EnumExt\"\n ) {\n name += \" Enumeration\";\n }\n name = html`${name}`;\n return name;\n}\n","// @ts-check\nimport {\n renderIssue,\n renderNote,\n renderPrivacyImplicationDoc,\n renderType\n} from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the header, description, notes, and issues, and properties of an MPS Class object.\n * @param {*} config The ReSpec config object.\n * @param {*} classData The Class object.\n * @param {string?} title The preferred title for this section.\n * @returns {HTMLElement[]} An array of HTML elements.\n */\nexport default (config, classData, title) => {\n if (classData && classData.properties) {\n title = title ?? `${classData.name}`;\n return html`

            ${title}

            \n

            ${classData.documentation.description}

            \n ${classData.documentation.issues.map(renderIssue)}\n ${classData.documentation.notes.map(renderNote)}\n \n \n \n \n \n \n \n ${config.showPrivacyAnnotations ? html`` : null}\n \n \n \n ${classData.properties.map(prop => renderProperty(config, prop))}\n ${renderExtensibility(config, classData)}\n \n
            PropertyTypeDescriptionMultiplicityPrivacy
            `;\n }\n};\n\n/**\n * Render text that indicates the class is extensible.\n * @param {*} config The ReSpec config object.\n * @param {*} classData The MPS Class object.\n * @returns {HTMLTableRowElement?} A table row that can be appended to the properties table.\n */\nfunction renderExtensibility(config, classData) {\n if (classData.isExtensible) {\n return html` \n \n This class can be extended with additional properties.\n \n `;\n } else {\n return html``;\n }\n}\n\n/**\n * Render property information.\n * @param {*} config The ReSpec config object.\n * @param {*} property The MPS Property object.\n * @returns {HTMLTableRowElement?} A table row with property information.\n */\nfunction renderProperty(config, property) {\n return html` \n ${property.name}\n ${renderType(property.type)}\n \n ${property.documentation.description}\n ${property.documentation.issues.map(renderIssue)}\n ${property.documentation.notes.map(renderNote)}\n ${renderPrivacyImplicationDoc(config, property.documentation.privacyDoc)}\n \n ${renderCardinality(property)}\n ${config.showPrivacyAnnotations\n ? renderPrivacyImplicationCell(property)\n : null}\n `;\n}\n\n/**\n * Return a string describing whether a property is required or not.\n * @param {*} property The MPS Property object.\n * @returns {string} A string describing whether a property is required or not.\n */\nfunction renderCardinality(property) {\n switch (property.cardinality.value) {\n case \"ONE\":\n return \"[1]\";\n case \"ZERO_OR_ONE\":\n return \"[0..1]\";\n case \"ZERO_OR_MANY\":\n return \"[0..*]\";\n case \"ONE_OR_MANY\":\n return \"[1..*]\";\n case \"TWO\":\n return \"[2]\";\n default:\n break;\n }\n}\n\n/**\n * Return a table cell with a string describing the privacy implications of a property.\n * @param {*} property The MPS Property object.\n * @returns {HTMLTableCellElement} A table cell with a string describing the privacy implications of a property.\n */\nfunction renderPrivacyImplicationCell(property) {\n return html`\n \n ${renderPrivacyImplication(property)}\n \n `;\n}\n\n/**\n * Return a string describing the privacy implications of a property.\n * @param {*} property The MPS Property object.\n * @returns {string} A string describing the privacy implications of a property.\n */\nfunction renderPrivacyImplication(property) {\n return html`${property.privacyImplications.label}`;\n}\n","// @ts-check\nimport { renderIssue, renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the header, notes, and issues for a MPS Model. This template\n * is used when the Model includes MPS DataModels.\n * @param {*} dataModel The MPS Model.\n * @param {string?} title The preferred title for this section.\n * @param {string?} id The unique header id to use so a model can appear in multiple sections.\n * @returns {HTMLElement[]} An array of HTML elements.\n */\nexport default (dataModel, title, id) => {\n if (dataModel) {\n title = title ?? `${dataModel.name} Data Model`;\n id = (id ?? dataModel.id).replace(/\\./g, \"-\");\n return html`

            ${title}

            \n ${dataModel.documentation.issues.map(renderIssue)}\n ${dataModel.documentation.notes.map(renderNote)}`;\n }\n};\n","// @ts-check\nimport { renderIssue, renderNote as renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the header, description, notes, and issues for a MPS RestOperation object.\n * @param {*} config The ReSpec config object.\n * @param {string} rootPath The root path for the service definition. For example, \"ims/clr/v2p0\".\n * @param {*} operation The RestOperation object from MPS.\n * @param {string?} title Optional title for the section. By default it will be the operation name.\n * @returns {HTMLElement[]} Information about the operation.\n */\nexport default (config, rootPath, operation, title) => {\n if (operation) {\n title = title ?? `${operation.name}`;\n return html`

            ${title}

            \n

            ${operation.documentation.description}

            \n ${operation.documentation.issues.map(renderIssue)}\n ${operation.documentation.notes.map(renderNote)}\n ${renderRequest(config, rootPath, operation)}\n ${renderResponses(config, operation)}`;\n }\n};\n\n/**\n * Render the operation request.\n * @param {*} config The ReSpec config object.\n * @param {string} rootPath The root path for the service definition. For example, \"ims/clr/v2p0\".\n * @param {*} operation The operation object from CDM/MPS.\n * @returns {HTMLElement[]} The rendered request as HTML elements.\n */\nfunction renderRequest(config, rootPath, operation) {\n return html`
            Request
            \n ${renderUrl(rootPath, operation)}\n ${renderRequestParameters(config, operation)}\n ${renderRequestBodies(config, operation)}`;\n}\n\n/**\n * Render the request URL.\n * @param {string} rootPath The root path for the service definition. For example, \"ims/clr/v2p0\".\n * @param {*} operation The operation object from CDM/MPS.\n * @returns {HTMLParagraphElement} The rendered URL.\n */\nfunction renderUrl(rootPath, operation) {\n let url = `${operation.method} ${rootPath}${operation.request.path}`;\n const queryParameters = operation.request.parameters.filter(\n parameter => parameter.type === \"QUERY\"\n );\n if (queryParameters) {\n for (let index = 0; index < queryParameters.length; index++) {\n const parameter = queryParameters[index];\n url += index == 0 ? \"?\" : \"&\";\n url += `${parameter.name}={${parameter.name}}`;\n }\n }\n return html`

            ${url}

            `;\n}\n\n/**\n * Render the operation request parameters.\n * @param {*} config The ReSpec config object.\n * @param {*} operation The operation object from CDM/MPS.\n * @returns {HTMLTableElement} A table of information about the request parameters.\n */\nfunction renderRequestParameters(config, operation) {\n if (Array.from(operation.request.parameters).length > 0) {\n return html`\n \n \n \n \n \n \n \n \n ${config.showPrivacyAnnotations\n ? html``\n : null}\n \n \n \n ${operation.request.parameters.map(param =>\n renderParameter(config, param)\n )}\n \n
            \n Request header, path, and query parameters\n
            ParameterParameter TypeDescriptionRequiredConfidentiality Level
            \n `;\n }\n}\n\n/**\n * Render the operation request bodies (if any).\n * @param {*} config The ReSpec config object.\n * @param {*} operation The operation object from CDM/MPS.\n * @returns {HTMLTableElement} A table of information about the request bodies.\n */\nfunction renderRequestBodies(config, operation) {\n if (Array.from(operation.request.bodies).length > 0) {\n return html`\n \n \n \n \n \n \n \n \n ${config.showPrivacyAnnotations\n ? html``\n : null}\n \n \n \n ${operation.request.bodies.map(body =>\n renderRequestBody(config, body)\n )}\n \n
            \n Allowed request content types\n
            Content-Type HeaderContent TypeContent DescriptionContent RequiredConfidentiality Level
            \n `;\n }\n}\n\n/**\n * Render a single request body.\n * @param {*} config The ReSpec config object.\n * @param {*} body The body object from CDM/MPS.\n * @returns {HTMLTableRowElement} A table row with information about the request body.\n */\nfunction renderRequestBody(config, body) {\n return html`\n ${body.contentType}\n ${renderBodyType(body)}\n \n ${body.documentation?.description}\n ${body.documentation?.issues.map(renderIssue)}\n ${body.documentation?.notes.map(renderNote)}\n \n ${renderRequired(body)}\n ${config.showPrivacyAnnotations ? renderConfidentialityCell(body) : null}\n `;\n}\n\nfunction renderParameter(config, parameter) {\n return html` \n \n ${parameter.name}\n
            (${parameter.type.toLowerCase()})
            \n \n ${renderParmeterType(parameter)}\n \n ${parameter.documentation.description}\n ${parameter.documentation.issues.map(renderIssue)}\n ${parameter.documentation.notes.map(renderNote)}\n \n ${renderRequired(parameter)}\n ${config.showPrivacyAnnotations\n ? renderConfidentialityCell(parameter)\n : null}\n `;\n}\n\nfunction renderResponses(config, operation) {\n const responses = operation.responses.flatMap(mergeResponseBodies);\n return html`
            Responses
            \n \n \n \n \n \n \n \n \n \n ${config.showPrivacyAnnotations\n ? html``\n : null}\n \n \n \n ${responses.map(resp => renderResponse(config, resp))}\n \n
            \n Allowed response codes and content types\n
            Status CodeContent-Type HeaderContent TypeContent DescriptionContent RequiredConfidentiality Level
            `;\n}\n\nfunction renderResponse(config, response) {\n return html`\n ${response.statusCode}\n ${response.body?.contentType}\n ${renderBodyType(response.body)}\n \n ${response.documentation?.description}\n ${response.body?.documentation?.description}\n ${response.body?.documentation?.issues.map(renderIssue)}\n ${response.body?.documentation?.notes.map(renderNote)}\n \n ${renderRequired(response.body)}\n ${config.showPrivacyAnnotations\n ? renderConfidentialityCell(response.body)\n : null}\n `;\n}\n\nfunction mergeResponseBodies(response) {\n const bodies = Array.from(response.bodies);\n if (bodies.length == 0) {\n return response;\n } else {\n const mergedResponses = new Array();\n for (let index = 0; index < bodies.length; index++) {\n const body = bodies[index];\n mergedResponses.push({\n ...response,\n body,\n });\n }\n return mergedResponses;\n }\n}\n\nfunction renderRequired(value) {\n if (value?.cardinality)\n return value.cardinality.value.includes(\"ZERO\") ? \"Optional\" : \"Required\";\n}\n\n/**\n * Return a table cell with a string describing the privacy implications of a property.\n * @param {*} value The value object from CDM/MPS.\n * @returns {HTMLTableCellElement} A table cell with a string describing the privacy implications of a property.\n */\nfunction renderConfidentialityCell(value) {\n if (value?.confidentiality) {\n return html`\n \n ${renderConfidentiality(value)}\n \n `;\n }\n}\nfunction renderConfidentiality(value) {\n if (value?.confidentiality) {\n return value.confidentiality.label;\n }\n}\n\nfunction renderParmeterType(parameter) {\n let name = parameter.value.name;\n if (parameter.cardinality.value.includes(\"MANY\")) {\n name += \"[]\";\n }\n if (\n parameter.value.stereoType === \"Enumeration\" ||\n parameter.value.stereoType === \"EnumExt\"\n ) {\n name += \" Enumeration\";\n }\n name = html`${name}`;\n return name;\n}\n\nfunction renderBodyType(body) {\n if (body?.type) {\n let name = body.type.name;\n if (body.cardinality.value.includes(\"MANY\")) {\n name += \"[]\";\n }\n if (\n body.type.stereoType === \"Enumeration\" ||\n body.type.stereoType === \"EnumExt\"\n ) {\n name += \" Enumeration\";\n }\n name = html`${name}`;\n return name;\n }\n}\n","// @ts-check\nimport { renderIssue, renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render a table of types with the same stereotype.\n * @param {*} dataModel An array of Derived or Primitive types.\n * @param {*} stereoType The MPS StereoType to list. For example, DerivedType or PrimitiveType.\n * @returns {HTMLElement[]} An array of HTML elements.\n */\nexport default (dataModel, stereoType) => {\n const types = dataModel.classes\n .filter(classData => classData.stereoType === stereoType)\n .sort((a, b) => {\n const nameA = a.name.toUpperCase();\n const nameB = b.name.toUpperCase();\n if (nameA < nameB) {\n return -1;\n }\n if (nameA > nameB) {\n return 1;\n }\n return 0;\n });\n if (types.length > 0) {\n return html` \n \n \n \n \n \n \n \n ${types.map(renderType)}\n \n
            TypeDescription
            `;\n }\n};\n\n/**\n * Render type information.\n * @param {*} type The MPS Class object for a DerivedType or PrimitiveType.\n * @returns {HTMLTableRowElement?} A table row with property information.\n */\nfunction renderType(type) {\n return html` \n ${type.name}\n \n ${type.documentation.description}\n ${type.documentation.issues.map(renderIssue)}\n ${type.documentation.notes.map(renderNote)}\n \n `;\n}\n","// @ts-check\nimport { renderIssue, renderNote, renderType } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render an EmbeddedSelection class.\n * @param {*} classData The MPS Class object.\n * @param {string?} title The preferred title.\n * @returns {HTMLElement[]} The entire section contents.\n */\nexport default (classData, title) => {\n if (classData && classData.generalizations) {\n title = title ?? `${classData.name}`;\n return html`

            ${title}

            \n

            ${classData.documentation.description}

            \n ${classData.documentation.issues.map(renderIssue)}\n ${classData.documentation.notes.map(renderNote)}\n

            The ultimate representation of this class is a choice of exactly one of the classes in the following set:

            \n \n \n \n \n \n \n \n \n ${classData.generalizations.map(renderSuperClass)}\n \n
            TypeDescription
            `;\n }\n};\n\n/**\n * Render superclass information.\n * @param {*} cls The MPS ModelClass object.\n * @returns {HTMLTableRowElement?} A table row with property information.\n */\nfunction renderSuperClass(cls) {\n return html` \n ${renderType(cls)}\n \n ${cls.documentation.description}\n ${cls.documentation.issues.map(renderIssue)}\n ${cls.documentation.notes.map(renderNote)}\n \n `;\n}\n","// @ts-nocheck\n\n/**\n * Module 1edtech/mps\n * Handles the optional Model Processing Service.\n */\nimport { addFormats } from \"./ajv-formats.js\";\nimport classDiagramTemplate from \"./templates/classDiagramTemplate.js\";\nimport classTemplate from \"./templates/classTemplate.js\";\nimport dataModelTemplate from \"./templates/dataModelTemplate.js\";\nimport enumerationTemplate from \"./templates/enumerationTemplate.js\";\nimport { html } from \"../core/import-maps.js\";\nimport interfaceTemplate from \"./templates/interfaceTemplate.js\";\nimport jsonSchemaTemplate from \"./templates/jsonSchemaTemplate.js\";\nimport jsonSchemasTemplate from \"./templates/jsonSchemasTemplate.js\";\nimport openApiSchemaTemplate from \"./templates/openApiSchemaTemplate.js\";\nimport operationTemplate from \"./templates/operationTemplate.js\";\nimport serviceModelTemplate from \"./templates/serviceModelTemplate.js\";\nimport { showError } from \"../core/utils.js\";\nimport stereoTypeTemplate from \"./templates/stereoTypeTemplate.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nimport embeddedSelectionTemplate from \"./templates/embeddedSelectionTemplate.js\";\n\nexport const name = \"1edtech/mps\";\n\n/**\n * Get the MPS API KEY from the configuration.\n *\n * @param {object} config The respecConfig\n * @returns {string} The MPS API KEY.\n */\nfunction getApiKey(config) {\n if (config.mps.apiKey) {\n return config.mps.apiKey;\n }\n throw \"No MPS API KEY found\";\n}\n\n/**\n * Get the MPS server URL from the configuration.\n *\n * @param {object} config The respecConfig\n * @returns {string} The MPS server URL.\n */\nfunction getBaseUrl(config) {\n if (config.mps.serverUrl) {\n return config.mps.serverUrl;\n }\n throw \"No MPS server URL found\";\n}\n\n/**\n * Async function that returns a sample JSON object for a single MPS Class.\n *\n * @param {object} config The respecConfig.\n * @param {string} id MPS Class id.\n * @param {boolean} includeOptionalFields True if the sample should include all optional fields (the default is false).\n * @returns {object} The sample JSON object.\n */\nasync function getDataSample(config, id, includeOptionalFields = false) {\n try {\n const res = await fetch(\n `${getBaseUrl(\n config\n )}/sample/${id}?includeOptionalFields=${includeOptionalFields}`,\n {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Api-Key\": getApiKey(config),\n },\n }\n );\n if (!res.ok) {\n showError(`Could not get sampledata for ${id}: ${res.status}`, name);\n return null;\n }\n const data = await res.json();\n return data;\n } catch (error) {\n showError(`Could not get sample data for ${id}: ${error}`, name);\n return null;\n }\n}\n\n/**\n * Async function that returns the JSON Schema for an MPS Class.\n *\n * @param {object} config The respecConfig.\n * @param {string} id MPS Class id.\n * @param {boolean} allowAdditionalProperties If true or omitted, the generated schema will reflect the MPS model. If false, the generated schema will never allow additional properties. Use false to check examples for typos.\n * @returns {object} The JSON Schema object.\n */\nasync function getJsonSchema(config, id, allowAdditionalProperties = true) {\n try {\n const res = await fetch(\n `${getBaseUrl(\n config\n )}/jsonschema/${id}?allowAdditionalProperties=${allowAdditionalProperties}`,\n {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Api-Key\": getApiKey(config),\n },\n }\n );\n if (!res.ok) {\n showError(`Could not get the schema for ${id}: ${res.status}`, name);\n return null;\n }\n const data = await res.json();\n return data;\n } catch (error) {\n showError(`Could not get the schema for ${id}: ${error}`, name);\n return null;\n }\n}\n\n// execute the API to retrieve the MPS class diagram (/classdiagram/{id})\nasync function getClassDiagram(\n config,\n id,\n omitProperties = false,\n hideTitle = false,\n title = null,\n packages = null,\n classes = null\n) {\n try {\n // create a query string from all the parameters\n let query = `?omitProperties=${omitProperties}&hideTitle=${hideTitle}`;\n if (title) query += `&title=${title}`;\n if (packages) query += `&packageNames=${packages}`;\n if (classes) query += `&classNames=${classes}`;\n\n // execute the API call\n const res = await fetch(\n `${getBaseUrl(config)}/classdiagram/${id}${query}`,\n {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"text/markdown\",\n \"X-Api-Key\": getApiKey(config),\n },\n }\n );\n if (!res.ok) {\n showError(\n `Could not get the class diagram for ${id}: ${res.status}`,\n name\n );\n return null;\n }\n const data = await res.text();\n return data;\n } catch (error) {\n showError(`Could not get the class diagram for ${id}: ${error}`, name);\n return null;\n }\n}\n\n/**\n * Execute the API call to retrieve MPS Model Classes and Services.\n *\n * @param {object} config The respecConfig.\n * @param {string} source The source (CORE or SANDBOX) of the Model.\n * @param {string} id The id of the MPS Model to retrieve.\n * @returns {object} The model as an object.\n */\nasync function getModel(config, source, id) {\n const key = `${source}-${id}`;\n const json = sessionStorage.getItem(key);\n if (json) return JSON.parse(json);\n const query = JSON.stringify({\n query: `\n {\n modelByID(id: \"${id}\", source: ${source ?? \"CORE\"}) {\n id\n id\n name\n documentation {\n description\n notes\n issues\n }\n classes {\n id\n name\n stereoType\n documentation {\n description\n notes\n issues\n packageName\n }\n properties {\n name\n type {\n id\n name\n stereoType\n }\n cardinality {\n value\n }\n documentation {\n description\n notes\n issues\n privacyDoc\n }\n privacyImplications {\n label\n value\n }\n parentClass {\n id\n name\n }\n\n }\n isExtensible\n generalizations {\n id\n name\n documentation {\n description\n notes\n issues\n }\n }\n }\n services {\n ... on RestService {\n id\n type\n documentation {\n description\n notes\n issues\n }\n rootPath\n interfaces {\n id\n name\n documentation {\n description\n notes\n issues\n }\n operations {\n id\n name\n documentation {\n description\n notes\n issues\n }\n method\n request {\n id\n documentation {\n description\n notes\n issues\n }\n path\n bodies {\n documentation {\n description\n notes\n issues\n }\n type {\n id\n name\n }\n cardinality {\n value\n }\n confidentiality {\n label\n value\n }\n contentType\n }\n parameters {\n id\n name\n documentation {\n description\n notes\n issues\n }\n type\n cardinality {\n value\n }\n confidentiality {\n label\n value\n }\n value {\n id\n name\n stereoType\n }\n }\n }\n responses {\n id\n documentation {\n description\n notes\n issues\n }\n statusCode\n bodies {\n documentation {\n description\n notes\n issues\n }\n type {\n id\n name\n stereoType\n }\n confidentiality {\n label\n value\n }\n cardinality {\n value\n }\n contentType\n }\n parameters {\n id\n name\n documentation {\n description\n notes\n issues\n }\n type\n cardinality {\n value\n }\n value {\n id\n name\n stereoType\n }\n }\n }\n }\n }\n }\n }\n }\n }\n `,\n });\n\n try {\n const res = await fetch(`${getBaseUrl(config)}/graphql`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Api-Key\": getApiKey(config),\n },\n body: query,\n });\n if (!res.ok) {\n showError(\n `Could not get MPS model for ${id}. Please see the developer console for details.`,\n name\n );\n return null;\n }\n const data = await res.json();\n const model = data.data.modelByID;\n if (!model) {\n showError(\n `Unknown model ${id} at ${getBaseUrl(config)}, source: ${\n config.mps.source ?? \"CORE\"\n }`,\n name\n );\n return null;\n }\n sessionStorage.setItem(key, JSON.stringify(model));\n return model;\n } catch (error) {\n showError(`Could not get MPS model for ${id}: ${error}`, name);\n return null;\n }\n}\n\n/**\n * Async function that returns the OpenAPI Schema for an MPS Model.\n *\n * @param {object} config The respecConfig.\n * @param {string} id MPS Model id.\n * @param {string} binding The OpenAPI Schema file format (YAML or JSON).\n * @returns {object} The OpenAPI Schema text.\n */\nasync function getOpenApiSchema(config, id, binding) {\n binding = binding ?? \"yaml\";\n try {\n const res = await fetch(\n `${getBaseUrl(\n config\n )}/openapischema/${id}?binding=${binding.toLowerCase()}`,\n {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Api-Key\": getApiKey(config),\n },\n }\n );\n if (!res.ok) {\n showError(\n `Could not get the OpenAPI schema for ${id}: ${res.status}`,\n name\n );\n return null;\n }\n const data = await res.text();\n return data;\n } catch (error) {\n showError(`Could not get the OpenAPI schema for ${id}: ${error}`, name);\n return null;\n }\n}\n/**\n * Process a single MPS Class model.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The class section element.\n * @param {object} classModel The MPS Class object.\n */\nasync function processClass(config, section, classModel) {\n section.setAttribute(\"id\", classModel.id);\n const title = section.getAttribute(\"title\");\n let wrapper;\n switch (classModel.stereoType) {\n case \"Enum\":\n case \"EnumeratedList\":\n case \"Enumeration\":\n case \"EnumExt\":\n case \"Vocabulary\":\n wrapper = enumerationTemplate(classModel, title);\n break;\n case \"EmbeddedSelection\":\n wrapper = embeddedSelectionTemplate(classModel, title);\n break;\n default:\n wrapper = classTemplate(config, classModel, title);\n break;\n }\n\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n}\n\n/**\n * Process a single data model section. A model can be split across multiple sections (e.g. one section\n * in the main content and one in the appendices). The data-package attribute, if present, acts as a\n * filter for the section. Only classes in the named package will be expected or generated.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The model section element.\n * @param {string} modelId The MPS Model id.\n */\nasync function processDataModel(config, section, modelId) {\n // The MPS/MPS source (CORE|SANDBOX)\n const source = section.getAttribute(\"data-source\") ?? config.mps.source;\n if (source !== \"CORE\" && source !== \"SANDBOX\") {\n showError(`Invalid source ${source} for model ${modelId}`);\n return;\n }\n\n // The preferred section title\n const title = section.getAttribute(\"title\");\n\n // The section's unique id (used to calculate a unique header id)\n const id = section.getAttribute(\"id\");\n\n // The package name filter, if any\n const packageName = section.getAttribute(\"data-package\") ?? \"\";\n\n const dataModel = await getModel(config, source, modelId);\n if (dataModel) {\n const wrapper = dataModelTemplate(dataModel, title, id);\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n\n let classes = Array.from(dataModel.classes).filter(\n classModel =>\n classModel.stereoType !== \"PrimitiveType\" &&\n classModel.stereoType !== \"DerivedType\"\n );\n\n if (packageName !== \"\") {\n classes = classes.filter(\n classModel => classModel.documentation.packageName === packageName\n );\n }\n\n classes.forEach(async classModel => {\n let classSection = section.querySelector(\n `section[data-class=\"${classModel.id}\"]`\n );\n if (classSection) {\n processClass(config, classSection, classModel);\n } else {\n // Auto-generate the class definition\n classSection = html`
            `;\n processClass(config, classSection, classModel);\n section.insertAdjacentElement(\"beforeend\", classSection);\n }\n });\n } else {\n // If there is no data model, add a header to satisfy Respec\n section.insertAdjacentElement(\"afterbegin\", html`

            ${modelId}

            `);\n }\n}\n\n/**\n * Process a single service interface model.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The service interface section element.\n * @param {object} serviceInterface The MPS Interface object.\n */\nasync function processInterface(config, section, serviceInterface) {\n const preferredId = section.getAttribute(\"id\");\n section.setAttribute(\"id\", serviceInterface.id);\n const title = section.getAttribute(\"title\");\n const wrapper = interfaceTemplate(serviceInterface, title, preferredId);\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n\n const operations = Array.from(serviceInterface.operations);\n operations.forEach(async operation => {\n let operationSection = section.querySelector(\n `section[data-operation=\"${operation.id}\"]`\n );\n if (operationSection) {\n processOperation(\n config,\n operationSection,\n serviceInterface.rootPath,\n operation\n );\n } else {\n // Auto-generate the operation section\n operationSection = html``;\n processOperation(\n config,\n operationSection,\n serviceInterface.rootPath,\n operation\n );\n section.insertAdjacentElement(\"beforeend\", operationSection);\n }\n });\n }\n}\n\n/**\n * Process the JSON Schema for single MPS Class model.\n *\n * @param {HTMLElement} section The class section element.\n * @param {object} classModel The MPS Class object.\n */\nasync function processJsonSchema(config, section, classModel) {\n section.setAttribute(\"id\", `${classModel.id}-schema`);\n const title = section.getAttribute(\"title\");\n const schema = await getJsonSchema(config, classModel.id);\n const wrapper = jsonSchemaTemplate(classModel, schema, title);\n if (schema && wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n}\n\n/**\n * Process a JSON Schemas schemas section. Schemas can be split across multiple sections (e.g. one section\n * in the main content and one in the appendices). The data-package attribute, if present, acts as a\n * filter for the section. Only classes in the named package will be expected or generated.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The schema section element.\n * @param {string} modelId The MPS Model id.\n */\nasync function processJsonSchemas(config, section, modelId) {\n // The MPS/MPS source (CORE|SANDBOX)\n const source = section.getAttribute(\"data-source\") ?? config.mps.source;\n if (source !== \"CORE\" && source !== \"SANDBOX\") {\n showError(`Invalid source ${source} for model ${modelId}`);\n return;\n }\n\n // The preferred section title\n const title = section.getAttribute(\"title\");\n\n // The section's unique id (used to calculate a unique header id)\n const id = section.getAttribute(\"id\");\n\n // The package name filter, if any\n const packageName = section.getAttribute(\"data-package\") ?? \"\";\n\n const dataModel = await getModel(config, source, modelId);\n if (dataModel) {\n const wrapper = jsonSchemasTemplate(dataModel, title, id);\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n\n let classes = Array.from(dataModel.classes).filter(\n classModel =>\n classModel.stereoType !== \"PrimitiveType\" &&\n classModel.stereoType !== \"DerivedType\"\n );\n\n if (packageName !== \"\") {\n classes = classes.filter(\n classModel => classModel.documentation.packageName === packageName\n );\n }\n\n classes.forEach(async classModel => {\n let classSection = section.querySelector(\n `section[data-class=\"${classModel.id}\"]`\n );\n if (classSection) {\n processJsonSchema(config, classSection, classModel);\n } else {\n // Auto-generate the class definition\n classSection = html`
            `;\n processJsonSchema(config, classSection, classModel);\n section.insertAdjacentElement(\"beforeend\", classSection);\n }\n });\n } else {\n // If there is no data model, add a header to satisfy Respec\n section.insertAdjacentElement(\"afterbegin\", html`

            ${modelId}

            `);\n }\n}\n\n/**\n * Process an OpenAPI Schema section.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The schema section element.\n * @param {string} modelId The MPS Model id.\n */\nasync function processOpenApiSchema(config, section, modelId) {\n // The MPS/MPS source (CORE|SANDBOX)\n const source = section.getAttribute(\"data-source\") ?? config.mps.source;\n if (source !== \"CORE\" && source !== \"SANDBOX\") {\n showError(`Invalid source ${source} for model ${modelId}`);\n return;\n }\n\n // The preferred section title\n const title = section.getAttribute(\"title\");\n\n // The section's unique id (used to calculate a unique header id)\n const id = section.getAttribute(\"id\");\n\n // The preferred schema binding\n const binding = section.getAttribute(\"data-binding\");\n\n const dataModel = await getModel(config, source, modelId);\n\n const schema = await getOpenApiSchema(config, modelId, binding);\n\n if (dataModel && schema) {\n const wrapper = openApiSchemaTemplate(dataModel, schema, title, id);\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n } else {\n // If there is no schema, add a header to satisfy Respec\n section.insertAdjacentElement(\"afterbegin\", html`

            ${modelId}

            `);\n }\n}\n\n/**\n * Process a single MPS Operation model.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The operation section element.\n * @param {string} rootPath The services root path.\n * @param {object} operation The MPS Operation object.\n */\nasync function processOperation(config, section, rootPath, operation) {\n section.setAttribute(\"id\", operation.id);\n const title = section.getAttribute(\"title\");\n const wrapper = operationTemplate(config, rootPath, operation, title);\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n}\n\n/**\n * Generate a sample. The schema is identified by the data-sample attribute.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} parentElem The element that will contain the generated sample.\n */\nasync function processSample(config, parentElem) {\n const classId = parentElem.getAttribute(\"data-sample\");\n if (classId === \"\") {\n showError(\"Example is missing a schema id\", name);\n return;\n }\n const id = parentElem.getAttribute(\"id\") ?? `example-${classId}`;\n parentElem.setAttribute(\"id\", id);\n parentElem.removeAttribute(\"data-sample\");\n const includeOptionalFields =\n parentElem.getAttribute(\"data-include-optional-fields\") ?? \"false\";\n const sampleData = await getDataSample(\n config,\n classId,\n includeOptionalFields\n );\n if (sampleData) {\n // eslint-disable-next-line prettier/prettier\n const sample = html`\n
            \n${JSON.stringify(sampleData, null, 2)}\n
            `;\n parentElem.append(sample);\n } else {\n parentElem.append(\n html`

            Could not get sample data. See developer console for details.

            `\n );\n }\n}\n\n/**\n * Process a single ServiceModel section. A ServiceModel can be split\n * across multiple sections (e.g. one section in the main content\n * and one in the appendices). The data-interface-filter attribute, if\n * present, acts as a filter for the section. Only operations in\n * the identified interface will be generated.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The model section element.\n * @param {string?} preferredId The preferred id for this section. This be moved to the header.\n */\nasync function processServiceModel(config, section, preferredId) {\n const modelId = section.getAttribute(\"data-model\");\n const serviceModelId = section.getAttribute(\"data-service-model\");\n const source = section.getAttribute(\"data-source\") ?? config.mps.source;\n if (source !== \"CORE\" && source !== \"SANDBOX\") {\n showError(`Invalid source ${source} for model ${modelId}`);\n return;\n }\n\n // The preferred section title\n const title = section.getAttribute(\"title\");\n\n const serviceModels = await getModel(config, source, modelId);\n const serviceModel = serviceModels.services.find(\n service => service.id === serviceModelId\n );\n if (serviceModel) {\n const wrapper = serviceModelTemplate(serviceModel, title, preferredId);\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n\n // Merge service rootPath property into each interface for convenience\n let serviceInterfaces = [];\n serviceModel.interfaces.forEach(serviceInterface => {\n serviceInterface.rootPath = serviceModel.rootPath;\n serviceInterfaces.push(serviceInterface);\n });\n\n // The interface filter, if any\n const interfaceId = section.getAttribute(\"data-interface-filter\") ?? \"\";\n if (interfaceId !== \"\") {\n serviceInterfaces = serviceInterfaces.filter(\n serviceInterface => serviceInterface.id === interfaceId\n );\n }\n\n // Process each interface\n serviceInterfaces.forEach(async serviceInterface => {\n let interfaceSection = section.querySelector(\n `section[data-interface=\"${serviceInterface.id}\"]`\n );\n if (interfaceSection) {\n processInterface(config, interfaceSection, serviceInterface);\n } else {\n // Auto-generate the service definition\n interfaceSection = html`\n
            \n `;\n processInterface(config, interfaceSection, serviceInterface);\n section.insertAdjacentElement(\"beforeend\", interfaceSection);\n }\n });\n } else {\n // If there is no data model, add a header to satisfy Respec\n section.insertAdjacentElement(\"afterbegin\", html`

            ${modelId}

            `);\n }\n}\n\n/**\n * Process classes with a particular stereotype. Only the name and documentation of each class will be listed in a table.\n * Typically used to render the DerivedTypes and PrimitiveTypes.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The model section element.\n * @param {string} The MPS Model id.\n * @param {string} The MPS StereoType.\n */\nasync function processStereoType(config, section, modelId, stereoType) {\n // The MPS/MPS source (CORE|SANDBOX)\n const source = section.getAttribute(\"data-source\") ?? config.mps.source;\n if (source !== \"CORE\" && source !== \"SANDBOX\") {\n showError(`Invalid source ${source} for model ${modelId}`);\n return;\n }\n\n // The preferred section title\n const title = section.getAttribute(\"title\");\n\n // The section's unique id (used to calculate a unique header id)\n const id = section.getAttribute(\"id\");\n\n const dataModel = await getModel(config, source, modelId);\n if (dataModel) {\n const wrapper = dataModelTemplate(dataModel, title, id);\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n const typeList = stereoTypeTemplate(dataModel, stereoType);\n if (typeList) {\n section.insertAdjacentElement(\"beforeend\", typeList);\n }\n } else {\n // If there is no data model, add a header to satisfy Respec\n section.insertAdjacentElement(\"afterbegin\", html`

            ${modelId}

            `);\n }\n}\n\n/**\n * Validate the JSON in a
             element. The schema is identified\n * by a data-schema attribute.\n *\n * @param {object} config The respecConfig.\n * @param {Object} ajv An instance of ajv2019.\n * @param {HTMLPreElement} pre The 
             element that contains the JSON to be validated.\n */\nasync function validateExample(config, ajv, pre) {\n  const schemaId = pre.getAttribute(\"data-schema\");\n  const allowAdditionalProperties =\n    pre.getAttribute(\"data-allowAdditionalProperties\") ?? true;\n  if (schemaId === \"\") {\n    showError(\"Example is missing a schema id\", name);\n    return;\n  }\n  const schemaDef = await getJsonSchema(\n    config,\n    schemaId,\n    allowAdditionalProperties\n  );\n  if (schemaDef === null) return;\n  try {\n    // Remove comments from example\n    let preText = pre.innerText;\n    preText = preText.replace(/\\/\\/ .*$/gm, \"\");\n    const data = JSON.parse(preText);\n    if (ajv.refs[schemaDef.$id] === undefined) {\n      ajv.compile(schemaDef);\n    }\n    const validate = ajv.refs[schemaDef.$id].validate;\n    const valid = validate(data);\n    if (!valid) {\n      pre.insertAdjacentElement(\n        \"beforebegin\",\n        html`
            \n

            NOTE: This example contains invalid JSON for ${schemaId}.

            \n
              \n ${validate.errors.map(error => {\n if (error.instancePath === \"\") error.instancePath = \"class\";\n let message = `${error.instancePath}: ${error.message}`;\n switch (error.keyword) {\n case \"additionalProperties\":\n message += ` (additional property: \"${error.params.additionalProperty})\"`;\n break;\n }\n return `
            • ${message}
            • `;\n })}\n
            \n
            `\n );\n showError(`Invalid example JSON for ${schemaId}.`, name);\n }\n } catch (error) {\n showError(`Cannot parse example JSON for ${schemaId}: ${error}`, name);\n return;\n }\n}\n\n/**\n * Process a Class diagram section. Diagrams can be split across multiple sections (e.g. one section\n * in the main content and one in the appendices). The data-package, data-classes attributes, if present, act as a\n * filter for the section. Only classes in the named package will be expected or generated.\n *\n * The data-class-diagram-omit-properties attribute, if present, will cause the diagram to omit properties and display only class names.\n * The data-class-diagram-hide-title attribute, if present, will cause the diagram to omit the title.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The schema section element.\n * @param {string} modelId The MPS Model id.\n * @param {number} index The index of the diagram.\n */\nasync function processClassDiagram(config, section, modelId, index) {\n section.setAttribute(\"id\", `${modelId}-class-diagram`);\n const title = section.getAttribute(\"title\");\n const packageNames = section.getAttribute(\"data-package\");\n const classNames = section.getAttribute(\"data-classes\");\n const omitProperties = section.hasAttribute(\n \"data-class-diagram-omit-properties\"\n );\n const hideTitle = section.hasAttribute(\"data-class-diagram-hide-title\");\n const diagram = await getClassDiagram(\n config,\n modelId,\n omitProperties,\n hideTitle,\n title,\n packageNames,\n classNames\n );\n\n const wrapper = await classDiagramTemplate(index, diagram, title);\n if (diagram && wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n}\n\n/**\n * Render Model Processing Service objects.\n *\n * @param {object} config respecConfig.\n */\nexport async function run(config) {\n let promises = new Array();\n let index = 0;\n\n // Find all unique Model sections.\n const modelSections = Array.from(\n document.querySelectorAll(\"section[data-model]\")\n );\n if (modelSections.length === 0) return;\n\n // Preload the models so later async threads don't need to\n const models = modelSections\n .map(section => {\n const modelId = section.getAttribute(\"data-model\");\n const source = section.getAttribute(\"data-source\") ?? config.mps.source;\n return `${source}-${modelId}`;\n })\n .filter((value, index, self) => self.indexOf(value) === index);\n promises.push(\n ...Array.from(\n models.map(model => {\n const params = model.split(\"-\");\n return getModel(config, params[0], params[1]);\n })\n )\n );\n await Promise.all(promises);\n promises = new Array();\n\n // Divide the Model sections into DataModel sections, ServiceModel sections\n // and simple type lists.\n const dataModelSections = modelSections.filter(\n elem =>\n !elem.getAttribute(\"data-service-model\") &&\n !elem.getAttribute(\"data-stereotype\") &&\n !elem.getAttribute(\"data-schema-format\") &&\n !elem.hasAttribute(\"data-class-diagram\")\n );\n const stereoTypeSections = modelSections.filter(elem =>\n elem.getAttribute(\"data-stereotype\")\n );\n const serviceModelSections = modelSections.filter(elem =>\n elem.getAttribute(\"data-service-model\")\n );\n const schemaSections = modelSections.filter(elem =>\n elem.getAttribute(\"data-schema-format\")\n );\n const classDiagramSections = modelSections.filter(elem =>\n elem.hasAttribute(\"data-class-diagram\")\n );\n\n // Process the DataModel sections.\n if (dataModelSections.length > 0) {\n promises.push(\n ...Array.from(dataModelSections).map(async section => {\n const modelId = section.getAttribute(\"data-model\") ?? \"\";\n if (modelId === \"\") {\n section.insertAdjacentElement(\n \"afterbegin\",\n html`

            Missing Model id

            `\n );\n showError(\n \"Cannot process DataModel sections without the Model id\",\n name,\n { elements: [section] }\n );\n } else {\n section.setAttribute(\"id\", `${modelId}.${index}`);\n index++;\n try {\n await processDataModel(config, section, modelId);\n } catch (error) {\n showError(`Cannot process DataModel ${modelId}: ${error}`, name);\n }\n }\n })\n );\n }\n\n // Process the StereoType sections.\n if (stereoTypeSections.length > 0) {\n promises.push(\n ...Array.from(stereoTypeSections).map(async section => {\n const modelId = section.getAttribute(\"data-model\") ?? \"\";\n const stereoType = section.getAttribute(\"data-stereotype\") ?? \"\";\n if (modelId === \"\") {\n section.insertAdjacentElement(\n \"afterbegin\",\n html`

            Missing Model id

            `\n );\n showError(\n \"Cannot process SteroType sections without the Model id\",\n name,\n { elements: [section] }\n );\n } else if (stereoType === \"\") {\n section.insertAdjacentElement(\n \"afterbegin\",\n html`

            Missing StereoType

            `\n );\n showError(\n \"Cannot process SteroType sections without the StereoType\",\n name,\n { elements: [section] }\n );\n } else {\n section.setAttribute(\"id\", `${modelId}.${index}`);\n index++;\n try {\n await processStereoType(config, section, modelId, stereoType);\n } catch (error) {\n showError(\n `Cannot process StereoType ${modelId} ${stereoType}: ${error}`,\n name\n );\n }\n }\n })\n );\n }\n\n // Process the Schema sections.\n if (schemaSections.length > 0) {\n promises.push(\n ...Array.from(schemaSections).map(async section => {\n const modelId = section.getAttribute(\"data-model\") ?? \"\";\n const schemaFormat =\n section.getAttribute(\"data-schema-format\")?.toLowerCase() ?? \"\";\n if (modelId === \"\") {\n section.insertAdjacentElement(\n \"afterbegin\",\n html`

            Missing Model id

            `\n );\n showError(\n \"Cannot process Schema sections without the Model id\",\n name,\n { elements: [section] }\n );\n } else {\n section.setAttribute(\"id\", `${modelId}.${index}`);\n index++;\n try {\n if (schemaFormat === \"\" || schemaFormat === \"json\") {\n await processJsonSchemas(config, section, modelId);\n } else {\n await processOpenApiSchema(config, section, modelId);\n }\n } catch (error) {\n showError(`Cannot process Schema for ${modelId}: ${error}`, name);\n }\n }\n })\n );\n }\n\n // Process the ServiceModel sections.\n if (serviceModelSections.length > 0) {\n promises.push(\n ...Array.from(serviceModelSections).map(async section => {\n const modelId = section.getAttribute(\"data-model\") ?? \"\";\n const serviceModelId = section.getAttribute(\"data-service-model\") ?? \"\";\n if (modelId === \"\") {\n section.insertAdjacentElement(\n \"afterbegin\",\n html`

            Missing Model id

            `\n );\n showError(\n \"Cannot process ServiceModel section without the Model id\",\n name,\n { elements: [section] }\n );\n } else if (serviceModelId === \"\") {\n section.insertAdjacentElement(\n \"afterbegin\",\n html`

            Missing ServiceModel id

            `\n );\n showError(\n \"Cannot process ServiceModel section without the ServiceModel id\",\n name,\n { elements: [section] }\n );\n } else {\n const preferredId = section.getAttribute(\"id\");\n section.setAttribute(\"id\", `${modelId}.${index}`);\n index++;\n try {\n await processServiceModel(config, section, preferredId);\n } catch (error) {\n showError(`Cannot process ServiceModel ${modelId}: ${error}`, name);\n }\n }\n })\n );\n }\n\n // Process the ClassDiagram sections.\n if (classDiagramSections.length > 0) {\n promises.push(\n ...Array.from(classDiagramSections).map(async section => {\n const modelId = section.getAttribute(\"data-model\") ?? \"\";\n if (modelId === \"\") {\n section.insertAdjacentElement(\n \"afterbegin\",\n html`

            Missing Model id

            `\n );\n showError(\n \"Cannot process ClassDiagram section without the Model id\",\n name,\n { elements: [section] }\n );\n } else {\n section.setAttribute(\"id\", `${modelId}.${index}`);\n index++;\n try {\n await processClassDiagram(config, section, modelId, index);\n } catch (error) {\n showError(`Cannot process ClassDiagram ${modelId}: ${error}`, name);\n }\n }\n })\n );\n }\n\n const samples = document.querySelectorAll(\"[data-sample]\");\n if (samples) {\n promises.push(\n ...Array.from(samples).map(async sample => {\n const classId = sample.getAttribute(\"data-sample\");\n try {\n await processSample(config, sample);\n } catch (error) {\n showError(`Cannot generate sample ${classId}: ${error}`, name);\n }\n })\n );\n }\n\n if (typeof window.ajv2019 === \"function\") {\n const ajv = new window.ajv2019({\n allErrors: true,\n });\n addFormats(ajv);\n const examples = document.querySelectorAll(\"pre[data-schema]\");\n if (examples) {\n promises.push(\n ...Array.from(examples).map(async example => {\n const classId = example.getAttribute(\"data-schema\");\n try {\n await validateExample(config, ajv, example);\n } catch (error) {\n showError(`Cannot validate example ${classId}: ${error}`, name);\n }\n })\n );\n }\n }\n\n await Promise.all(promises);\n\n // Clear the data model cache\n Array.from(document.querySelectorAll(\"section[data-model]\"))\n .map(\n section => `${config.mps.source}-${section.getAttribute(\"data-model\")}`\n )\n .forEach(key => {\n sessionStorage.removeItem(key);\n });\n\n // Remove MPS config from initialUserConfig so API_KEY is not exposed\n sub(\"end-all\", () => {\n const script = document.getElementById(\"initialUserConfig\");\n const userConfig = JSON.parse(script.innerHTML);\n if (\"mps\" in userConfig) {\n delete userConfig.mdm;\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n }\n });\n}\n","// @ts-check\nimport { renderIssue, renderNote, renderTerm } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render an Enumeration, ExtEnum, or Vocabulary class.\n * @param {*} classData The MPS Class object.\n * @param {string?} title The preferred title.\n * @returns {HTMLElement[]} The entire section contents.\n */\nexport default (classData, title) => {\n if (classData && classData.properties) {\n const suffix =\n classData.stereoType === \"Vocabulary\" ? \"Vocabulary\" : \"Enumeration\";\n title = title ?? `${classData.name} ${suffix}`;\n return html`

            ${title}

            \n

            ${classData.documentation.description}

            \n ${classData.documentation.issues.map(renderIssue)}\n ${classData.documentation.notes.map(renderNote)}\n \n \n \n \n \n \n \n \n ${classData.properties.map(renderTerm)}\n ${classData.stereoType === \"EnumExt\"\n ? html`\n \n `\n : html``}\n \n
            TermDescription
            \n This enumeration can be extended with new, proprietary terms.\n The new terms must start with the substring 'ext:'.\n
            `;\n }\n};\n","// @ts-check\nimport { renderIssue, renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the header, description, notes, and issues for a MPS RestInterface object.\n * @param {*} serviceInterface The RestInterface object.\n * @param {string?} title Optional title for the section. By default it will be the operation name.\n * @param {string?} headerId The preferred header id.\n * @returns {HTMLElement[]} The rendered content.\n */\nexport default (serviceInterface, title, headerId) => {\n if (serviceInterface && serviceInterface.operations) {\n title = title ?? `${serviceInterface.name}`;\n headerId = (headerId ?? serviceInterface.id).replace(/\\./g, \"-\");\n return html`

            ${title}

            \n

            ${serviceInterface.documentation?.description}

            \n ${serviceInterface.documentation?.issues.map(renderIssue)}\n ${serviceInterface.documentation?.notes.map(renderNote)}`;\n }\n};\n","// @ts-check\nimport { renderIssue, renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the JSON Schema of an MPS Class object.\n * @param {*} classData The Class object.\n * @param {*} schema The Class' JSON Schema.\n * @param {string?} title The preferred title for this section.\n * @returns {HTMLElement[]} An array of HTML elements.\n */\nexport default (classData, schema, title) => {\n if (classData) {\n title = title ?? `${classData.name}`;\n return html`

            ${title}

            \n

            ${classData.documentation.description}

            \n ${classData.documentation.issues.map(renderIssue)}\n ${classData.documentation.notes.map(renderNote)}\n
            ${JSON.stringify(schema, null, 2)}
            `;\n }\n};\n","// @ts-check\nimport { renderIssue, renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the header, notes, and issues for a MPS Model. This template\n * is used when the section contains JSON Schemas.\n * @param {*} dataModel The MPS Model.\n * @param {string?} title The preferred title for this section.\n * @param {string?} id The unique header id to use so a model can appear in multiple sections.\n * @returns {HTMLElement[]} An array of HTML elements.\n */\nexport default (dataModel, title, id) => {\n if (dataModel) {\n title = title ?? `${dataModel.name} JSON Schema`;\n id = (id ?? dataModel.id).replace(/\\./g, \"-\");\n return html`

            ${title}

            \n ${dataModel.documentation.issues.map(renderIssue)}\n ${dataModel.documentation.notes.map(renderNote)}`;\n }\n};\n","// @ts-check\nimport { renderIssue, renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the OpenAPI Schema of an MPS Model object.\n * @param {*} modelData The Model object.\n * @param {*} schema The Model's OpenAPI Schema (YAML or JSON).\n * @param {string?} title The preferred title for this section.\n * @returns {HTMLElement[]} An array of HTML elements.\n */\nexport default (modelData, schema, title) => {\n if (modelData) {\n title = title ?? `${modelData.name}`;\n return html`

            ${title}

            \n

            ${modelData.documentation.description}

            \n ${modelData.documentation.issues.map(renderIssue)}\n ${modelData.documentation.notes.map(renderNote)}\n
            ${schema}
            `;\n }\n};\n","// @ts-check\nimport { renderIssue, renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the header, description, notes, and issues for a MPS RestService object.\n * @param {*} serviceModel The ServiceModel object.\n * @param {string?} title The preferred title for this section.\n * @param {string?} headerId The unique header id to use so a data model can appear in multiple sections.\n * @returns {HTMLElement[]} An array of HTML elements.\n */\nexport default (serviceModel, title, headerId) => {\n if (serviceModel) {\n title = title ?? `${serviceModel.name} Service Model`;\n headerId = (headerId ?? serviceModel.id).replace(/\\./g, \"-\");\n return html`

            ${title}

            \n ${serviceModel.documentation.issues.map(renderIssue)}\n ${serviceModel.documentation.notes.map(renderNote)}`;\n }\n};\n","// @ts-check\nimport { html, mermaidModule } from \"../../core/import-maps.js\";\n\n/**\n * Render the Class diagram of an MPS Model / Package object.\n * @param {*} diagram The Class diagram in markdown format.\n * @param {string?} title The preferred title for this section.\n * @returns {Promise} An array of HTML elements.\n */\nexport default async (index, diagram, title) => {\n // dinamycally import mermaid to avoid increase of size of the library\n const { default: mermaid } = await import(mermaidModule);\n mermaid.initialize({ startOnLoad: false });\n const { svg } = await mermaid.render(`class-diagram-${index}`, diagram);\n const cleanedSvg = svg.trim().replace(/height=\"[0-9]*\"/, \"\");\n return html`

            ${title}

            \n ${cleanedSvg}`;\n};\n","// @ts-check\n// Module 1edtech/privacy\n// Handle the privacy section properly.\nimport confLevelTmpl from \"./templates/confidentialityLevelTemplate.js\";\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport localizationStrings from \"./translations/1edtech.js\";\nimport privacyTmpl from \"./templates/privacyImplicationsTemplate.js\";\n\nexport const name = \"1edtech/privacy\";\n\nconst l10n = getIntlData(localizationStrings);\nconst privacyImplicationsKeys = [\n \"ACCESSIBILITY\",\n \"ANALYTICS\",\n \"CONTAINER\",\n \"CREDENTIALS\",\n \"CREDENTIALSIDREF\",\n \"DEMOGRAPHICS\",\n \"EXTENSION\",\n \"FINANCIAL\",\n \"IDENTIFIER\",\n \"IDENTIFIERREF\",\n \"INSURANCE\",\n \"LEGAL\",\n \"MEDICAL\",\n \"NA\",\n \"OTHER\",\n \"QUALIFICATION\",\n \"PERSONAL\",\n \"SOURCEDID\",\n \"SOURCEDIDREF\",\n];\n\nconst confidentialityLevelKeys = [\n \"UNRESTRICTED\",\n \"NORMAL\",\n \"RESTRICTED\",\n \"VERYRESTRICTED\",\n];\n\n/**\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createSection(title, header) {\n return html`
            \n

            ${title}

            \n

            ${header}

            \n
            `;\n}\n\n/**\n * Handles checking for the abstract, and inserts a temp one if not present.\n */\nexport async function run(conf) {\n /** @type {HTMLElement} */\n if (!conf.showPrivacyAnnotations) {\n return;\n }\n\n const privacySection =\n document.querySelector(\"section#privacy-appendix\") ||\n html`
            `;\n\n if (!document.querySelector(\"section#privacy-appendix > h2\")) {\n privacySection.prepend(html`

            ${l10n.privacy_section_header}

            `);\n }\n\n privacySection.classList.add(\"appendix\");\n\n const piSection = createSection(\n l10n.privacy_implications,\n l10n.privacy_implications_paragraph\n );\n piSection.appendChild(privacyTmpl(privacyImplicationsKeys, l10n));\n privacySection.appendChild(piSection);\n\n const confSection = createSection(\n l10n.confidentiality_level,\n l10n.confidentiality_level_paragram\n );\n confSection.appendChild(confLevelTmpl(confidentialityLevelKeys, l10n));\n privacySection.appendChild(confSection);\n\n document.body.appendChild(privacySection);\n}\n","export default {\n en: {\n privacy_section_header: \"Privacy\",\n privacy_implications: \"Privacy Implications\",\n privacy_implications_paragraph:\n \"All of the privacy implications contained within this Information Model are described in this Section. All of the corresponding concepts and methods for these privacy annotations are defined in the Privacy Framework.\",\n confidentiality_level: \"Confidentiality Level\",\n confidentiality_level_paragram:\n \"All of the privacy classification of the exchanged payloads are described in this Section.\",\n ACCESSIBILITY_label: \"Accessibility\",\n ACCESSIBILITY_def:\n \"denotes information about the accessibility personal needs and preferences of the user\",\n ANALYTICS_label: \"Analytics\",\n ANALYTICS_def:\n \"denotes information that will be used to support the creation of learning analytics\",\n CONTAINER_label: \"Container\",\n CONTAINER_def:\n \"denotes that the child attributes have privacy-sensitive information\",\n CREDENTIALS_label: \"Credentials\",\n CREDENTIALS_def:\n \"denotes access control information for the use e.g. password, private key, etc.\",\n CREDENTIALSIDREF_label: \"CredentialsIdRef\",\n CREDENTIALSIDREF_def:\n \"denotes reference to/use of an identifier to credentials information for the user\",\n DEMOGRAPHICS_label: \"Demographics\",\n DEMOGRAPHICS_def:\n \"denotes information about the demographics of the user e.g. ethnicity, gender, etc.\",\n EXTENSION_label: \"Extension\",\n EXTENSION_def:\n \"denotes that proprietary information can be included and so this MAY contain privacy-sensitive information\",\n FINANCIAL_label: \"Financial\",\n FINANCIAL_def:\n \"denotes that the information is of a financial nature e.g. bank account, financial aid status, etc.\",\n IDENTIFIER_label: \"Identifier\",\n IDENTIFIER_def:\n \"denotes a unique identifier that has been assigned, by some third party, to the user e.g. passport number, social security number, etc.\",\n IDENTIFIERREF_label: \"IdentifierRef\",\n IDENTIFIERREF_def:\n \"denotes reference to/use of a unique identifier that has been assigned, by some third party, to the user\",\n INSURANCE_label: \"Insurance/Assurance\",\n INSURANCE_def:\n \"denotes that the information is about the insurance life-assurance nature, e.g. type of insurance, etc.\",\n LEGAL_label: \"Legal\",\n LEGAL_def:\n \"denotes that the information is of a legal or judicial nature e.g. Will, prison record, etc.\",\n MEDICAL_label: \"Medical/Healthcare\",\n MEDICAL_def:\n \"denotes that the information is of a medical, or healthcare-related nature e.g. allergies, blood-type, mobility needs, etc.\",\n NA_label: \"N/A\",\n NA_def:\n \"denotes that there are NO PRIVACY IMPLICATIONS for this attribute (this is the default setting)\",\n OTHER_label: \"Other\",\n OTHER_def:\n \"denotes privacy sensitive information that is NOT covered by one of the other categories\",\n QUALIFICATION_label: \"Qualification/Certification\",\n QUALIFICATION_def:\n \"denotes that the information is about education qualifications, skill-set certifications, microcredentials, etc.\",\n PERSONAL_label: \"Personal\",\n PERSONAL_def:\n \"denotes personal information about the user e.g. name, address, etc.\",\n SOURCEDID_label: \"SourcedId\",\n SOURCEDID_def:\n \"denotes the interoperability unique identifier that has been assigned and MUST be present for the correct usage of the corresponding 1EdTech specification\",\n SOURCEDIDREF_label: \"SourcedIdRef\",\n SOURCEDIDREF_def:\n \"denotes reference to/use of the interoperability unique identifier, sourcedId, to link/point to an associated 1EdTech object\",\n UNRESTRICTED_label: \"unrestricted\",\n UNRESTRICTED_def:\n \"there are no privacy concerns (this is the default value).\",\n NORMAL_label: \"normal\",\n NORMAL_def:\n \"denotes that privacy sensitive data could be included and so all best practices to secure this data should be used.\",\n RESTRICTED_label: \"restricted\",\n RESTRICTED_def:\n \"denotes that some of the data is more sensitive than usual or that many attributes information that when used together create increased vulnerability for identification of the associated individual or group.\",\n VERYRESTRICTED_label: \"veryrestricted\",\n VERYRESTRICTED_def:\n \"denotes that the request could contain very sensitive privacy data. Depending on the capabilities of the Provider this very sensitive data may be obfuscated or may not even be present.\",\n },\n};\n","/* eslint-disable prefer-template */\n// @ts-check\nimport { html } from \"../../core/import-maps.js\";\n\nexport default (keys, translations) => {\n return html`
            \n ${keys.map(\n key => html`
            \n \n ${translations[key + \"_label\"]}\n \n
            \n
            ${translations[key + \"_def\"]}
            `\n )}\n
            `;\n};\n","/* eslint-disable prefer-template */\n// @ts-check\nimport { html } from \"../../core/import-maps.js\";\n\nexport default (keys, translations) => {\n return html`
            \n ${keys.map(\n key => html`
            \n \n ${translations[key + \"_label\"]}\n \n
            \n
            ${translations[key + \"_def\"]}
            `\n )}\n
            `;\n};\n","// @ts-check\nexport const name = \"1edtech/post-markdown\";\n\n/**\n * Post processing of markdown transcludes. Run after markdown.\n *\n * @param {*} conf respecConfig\n */\nexport async function run(conf) {\n if (conf.format !== \"markdown\") return;\n\n // remove elements\n const mdOnlies = document.body.querySelectorAll(\"md-only\");\n for (let i = 0; i < mdOnlies.length; i++) {\n mdOnlies[i].parentNode.removeChild(mdOnlies[i]);\n }\n}\n","/* eslint-disable prettier/prettier */\n// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"1edtech/templates/headers\";\n\n/**\n * @param {*} conf\n */\nfunction getStatusString(conf) {\n // specStatusString: an override of the default descriptions\n if (conf.specStatusString) {\n return conf.specStatusString;\n }\n // for generic docs, have a generic desc\n if (conf.specType === \"doc\") {\n return \"This is an informative 1EdTech document that may be revised at any time.\";\n }\n if (conf.specType === \"proposal\") {\n return \"This is a proposal that may be revised at any time.\";\n }\n // specStatus: See 1edtech/config.js for known values\n switch (conf.specStatus) {\n case \"Proposal\":\n return \"This document is for review and comment by 1EdTech Contributing Members.\";\n case \"Base Document\":\n return \"This document is for review and comment by 1EdTech Contributing Members.\";\n case \"Candidate Final\":\n return \"This document is for review and adoption by the 1EdTech membership.\";\n case \"Candidate Final Public\":\n return \"This document is for review and adoption by the 1EdTech membership.\";\n case \"Final Release\":\n return \"This document is made available for adoption by the public community at large.\";\n default:\n // 1edtech/config.js will issue error for unknown values\n return `Unknown specStatus: \"${conf.specStatus}\"`;\n }\n}\n\nfunction 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 return;\n }\n return html`\n \n ${link.key}\n \n \n \n ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n \n
            \n \n \n `;\n}\n\nfunction showLinkData(data) {\n return html` \n ${data.href\n ? html`${data.value || data.href}`\n : data.value}\n `;\n}\n\nfunction renderSpecVersion(conf) {\n if (conf.specType !== \"doc\" && conf.specType !== \"proposal\") {\n return html`
            \n ${conf.specStatus}
            Spec Version ${conf.specVersion}\n
            `;\n }\n}\n\nfunction renderSpecStatus(conf) {\n if (conf.specType !== \"doc\" && conf.specType !== \"proposal\") {\n return html`${conf.specStatus}`;\n }\n}\n\nfunction renderVersionTable(conf) {\n if (conf.specType !== \"doc\" && conf.specType !== \"proposal\") {\n return html`\n \n \n Document Version:\n ${conf.docVersion}\n \n \n Date Issued:\n ${conf.specDate}\n \n \n Status:\n ${getStatusString(conf)}\n \n \n This version:\n ${conf.thisURL}\n \n ${conf.specNature === \"normative\"\n ? html`\n Latest version:\n ${conf.latestURI}\n \n \n Errata:\n ${conf.errataURL}\n `\n : null\n }\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n \n `;\n } else {\n return html`\n \n \n Date Issued:\n ${conf.specDate}\n \n \n Status:\n ${getStatusString(conf)}\n \n \n `;\n }\n}\n\nfunction renderCopyright() {\n return html`
            \n

            \n © ${new Date().getFullYear()} 1EdTech™ Consortium, Inc. All Rights Reserved.\n

            \n

            \n Trademark information:\n http://www.imsglobal.org/copyright.html\n \n

            \n
            `;\n}\n\nfunction renderDisclosure(conf) {\n if (conf.specType === \"proposal\") {\n return html`
            \n

            Proposals

            \n

            \n Proposals are made available for the purposes of Project Group / Task\n Force only and should not be distributed outside of the 1EdTech Contributing\n Membership without the express written consent of 1EdTech. Provision of\n any work documents outside of the project group/ task force will revoke\n all privileges as an Invited Guest. Any documents provided\n non-participants will be done by 1EdTech only on the 1EdTech public\n website when the documents become publicly available.\n

            \n
            `;\n } else {\n return html``;\n }\n}\n\nfunction renderIpr(conf) {\n return html`
            \n

            IPR and Distribution Notice

            \n

            \n Recipients of this document are requested to submit, with their\n comments, notification of any relevant patent claims or other\n intellectual property rights of which they may be aware that might be\n infringed by any implementation of the specification set forth in this\n document, and to provide supporting documentation.\n

            \n

            \n 1EdTech takes no position regarding the validity or scope of any\n intellectual property or other rights that might be claimed to pertain\n implementation or use of the technology described in this document or\n the extent to which any license under such rights might or might not be\n available; neither does it represent that it has made any effort to\n identify any such rights. Information on 1EdTech's procedures with respect\n to rights in 1EdTech specifications can be found at the 1EdTech Intellectual\n Property Rights webpage:\n \n http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf .\n

            \n
            \n ${renderIprTable(conf)}`;\n}\n\nfunction renderIprTable(conf) {\n if (conf.iprs) {\n return html`

            \n The following participating organizations have made explicit license\n commitments to this specification:\n

            \n \n \n \n \n \n \n \n \n \n \n ${conf.iprs.map(renderIprRow)}\n \n
            Org nameDate election madeNecessary claimsType
            `;\n }\n}\n\nfunction renderIprRow(element) {\n return html`\n ${element.company}\n ${element.electionDate}\n ${element.necessaryClaims}\n ${element.type}\n `;\n}\n\nexport default conf => {\n return html`
            \n \n ${renderSpecVersion(conf)} ${renderSpecStatus(conf)}\n ${renderVersionTable(conf)} ${renderIpr(conf)} ${renderDisclosure(conf)}\n ${renderCopyright()}\n
            `;\n};\n","// @ts-check\n/**\n * Module 1edtech/headers\n * Add 1EdTech boilerplate front matter to the document.\n */\nimport headersTmpl from \"./templates/headers.js\";\n\nexport const name = \"1edtech/headers\";\n\n/**\n * @param {*} conf\n */\nexport async function run(conf) {\n document.title = `${conf.specTitle} ${conf.specVersion ?? \"\"} \n ${conf.specStatus ?? \"\"}`;\n\n const body = document.body;\n const header = headersTmpl(conf);\n\n if (body.firstChild) {\n body.insertBefore(header, body.firstChild);\n } else {\n body.appendChild(header);\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 } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport function run(conf) {\n /** @type {NodeListOf} */\n const headings = document.querySelectorAll(\n `section:not(.head):not(.introductory) 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 h.appendChild(html`\n \n `);\n }\n}\n","// @ts-check\n// Module 1edtech/abstract\n// Handle the abstract section properly.\nimport { html } from \"../core/import-maps.js\";\nimport { showWarning } from \"../core/utils.js\";\nexport const name = \"1edtech/abstract\";\n\n/**\n * Handles checking for the abstract, and inserts a temp one if not present.\n */\nexport async function run() {\n let abstract = document.getElementById(\"abstract\");\n if (!abstract) {\n const msg = `Document should have one element with \\`id=\"abstract\"`;\n showWarning(msg, name);\n // insert a temp abstract\n abstract = html`
            \n

            To be removed

            \n
            `;\n document.body.prepend(abstract);\n }\n\n if (abstract.tagName.startsWith(\"H\")) {\n abstract.removeAttribute(\"id\");\n abstract = abstract.parentElement;\n abstract.id = \"abstract\";\n }\n if (abstract.tagName === \"SECTION\") {\n if (!abstract.classList.contains(\"introductory\")) {\n abstract.classList.add(\"introductory\");\n }\n }\n\n let abstractHeading = document.querySelector(\"#abstract>h2\");\n if (abstractHeading) {\n return;\n }\n abstractHeading = document.createElement(\"h2\");\n abstractHeading.textContent = \"Abstract\";\n abstract.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} */\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} */\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 textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (${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//\n// Ensure the conformance section has an id.\n//\n// core/inlines determines whether a document is informative by the\n// presence or absence of a section with id='conformance'. If the conformance\n// section is in Markddown, it will not have an id. This module will assign the\n// id to a section if the first header in the section is 'conformance' or\n// 'conformance statements' (ignoring case). For example,\n//\n// Note: Run after core/markdown and before core/inlines\n\nimport { addId } from \"../core/utils.js\";\n\nexport const name = \"1edtech/inlines\";\n\n/**\n * Find the Conformance section in parent and assign an id.\n *\n * @param {Element | HTMLElement} parent\n */\nfunction findConformanceSection(parent) {\n /** @type {NodeListOf} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n for (const section of sectionElements) {\n if (!section.children.length) {\n continue;\n }\n\n if (!section.id) {\n const header = section.children[0];\n const title = header.textContent;\n if (\n title.toLowerCase() == \"conformance\" ||\n title.toLowerCase() == \"conformance statements\"\n ) {\n addId(section, null, \"conformance\");\n return section;\n }\n }\n\n const foundSection = findConformanceSection(section);\n if (foundSection) {\n return foundSection;\n }\n }\n\n return null;\n}\n\n/**\n * @param {*} conf\n */\nexport async function run(conf) {\n // No conformance section in 1EdTech Errata documents\n if (conf.specType == \"errata\") {\n return;\n }\n\n let conformance = document.querySelector(\"section#conformance\");\n if (!conformance) {\n conformance = findConformanceSection(document.body);\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\" }}\nconst methodRegex = /(\\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/w3c/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 {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] = value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n results.push({ type: \"method\", identifier, args, renderParent });\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`${identifier + (nullable ? \"?\" : \"\")}`;\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 ? \".\" : \"\"}[[${identifier}]]${argsHtml}`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`${str}`;\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}${arg}`;\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 ? \".\" : \"\"}${identifier}`;\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 { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(args, htmlArgMapper);\n const searchText = `${identifier}(${args.join(\", \")})`;\n const element = html`${parent && renderParent ? \".\" : \"\"}${identifier}(${argsText})`;\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`\"${enumValue}\"`;\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`\"${identifier}\"`;\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`${identifier + (nullable ? \"?\" : \"\")}`;\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`{{ ${str} }}`;\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}\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>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase} */\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} 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} 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} 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} 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} 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} 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} */\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}\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 },\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 },\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 [\"FPWD\", \"W3C First Public Working Draft\"],\n [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\n [\"WG-NOTE\", \"W3C Working Group Note\"],\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`
            `;\n\n if (!document.querySelector(\"section#references > h2\")) {\n refSection.prepend(html`

            ${l10n.references}

            `);\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`
            \n

            ${title}

            \n
            ${refsToShow.map(showRef)}
            \n
            `;\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} 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} */\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`${text}`;\n return linkText ? elem : html`[${elem}]`;\n}\n\n/**\n * renders a reference\n * @param {Ref} ref\n */\nfunction showRef({ ref, refcontent }) {\n const refId = `bib-${ref.toLowerCase()}`;\n if (refcontent) {\n return html`\n
            [${ref}]
            \n
            ${{ html: stringifyReference(refcontent) }}
            \n `;\n } else {\n return html`\n
            [${ref}]
            \n
            Reference not found.
            \n `;\n }\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 = `${ref.title}`;\n\n output = ref.href ? `${output}. ` : `${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: ${ref.href}`;\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(badRefs) {\n badRefs.forEach(({ ref }) => {\n const badrefs = [\n ...document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n ),\n ].filter(({ textContent: t }) => t.toLowerCase() === ref.toLowerCase());\n const msg = `Bad reference: [\\`${ref}\\`] (appears ${badrefs.length} times)`;\n showError(msg, name);\n console.warn(\"Bad references: \", badrefs);\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 / 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 /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bOPTIONAL\\b/,\n ]);\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\n// Inline `code`\n// TODO: Replace (?!`) at the end with (?:]+\\??)?\\|\\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`${textContent}`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`${value}`;\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``;\n }\n return html``;\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, 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\");\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}\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} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`${matched}`;\n}\n\n/**\n * @example |varName: type| => varName\n * @example |varName| => varName\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`${varName}`;\n}\n\n/**\n * @example [= foo =] => foo\n * @example [= bar/foo =] => foo\n * @example [= `foo` =] => foo\n * @example [= foo|bar =] => bar\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`${processedContent}`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`${clean}`;\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} */\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\"];\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 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 1edtech/conformance\n//\n// Based on w3c/conformance with following differences:\n//\n// 1EdTech version:\n// - Skip if specType == 'Errata' (1EdTech Errata documents do not have a conformance section).\n// - Use slightly modified conformance text.\n//\n// Note: Run after inlines so the conformance section has an id and NormativeReferences is available.\nimport { htmlJoinAnd, showError, 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\";\n\nexport const name = \"1edtech/conformance\";\n\n/**\n * core/inlines will count the actual occurances of each term and\n * both w3c/conformance and 1edtech/conformance will only list the terms\n * that are in rfc2119Usage. But the current version of the normative\n * text refers to all the keywords, so this stuffs the list with all\n * the keywords.\n */\nfunction stuffRfc299Usage() {\n rfc2119Usage.MUST = true;\n rfc2119Usage[\"MUST NOT\"] = true;\n rfc2119Usage.REQUIRED = true;\n rfc2119Usage.SHALL = true;\n rfc2119Usage[\"SHALL NOT\"] = true;\n rfc2119Usage.SHOULD = true;\n rfc2119Usage[\"SHOULD NOT\"] = true;\n rfc2119Usage.RECOMMENDED = true;\n rfc2119Usage.MAY = true;\n rfc2119Usage.OPTIONAL = true;\n}\n\n/**\n * @param {*} conf\n */\nfunction getNormativeText(conf) {\n // Make sure all the terms referenced in the text below are included.\n // Remove this step if you only want to list the terms that are actually\n // used in this document.\n stuffRfc299Usage();\n\n // Build the HTML\n const terms = [...Object.keys(rfc2119Usage)];\n const keywords = htmlJoinAnd(\n terms.sort(),\n item => html`${item}`\n );\n const plural = terms.length > 1;\n\n const content = html`

            \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

            \n ${terms.length\n ? html`\n

            \n The key word${plural ? \"s\" : \"\"} ${[keywords]} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n ${renderInlineCitation(\"RFC2119\")}.\n

            \n `\n : null}\n

            \n An implementation of this specification that fails to implement a\n MUST/REQUIRED/SHALL requirement or fails to abide by a MUST NOT/SHALL NOT\n prohibition is considered nonconformant. SHOULD/SHOULD NOT/RECOMMENDED\n statements constitute a best practice. Ignoring a best practice does not\n violate conformance but a decision to disregard such guidance should be\n carefully considered. MAY/OPTIONAL statements indicate that implementers\n are entirely free to choose whether or not to implement the option.\n

            `;\n\n if (conf.skipCertGuideConformanceRef || conf.specType == \"cert\") {\n return content;\n }\n\n return html`${content}\n

            \n The Conformance and Certification Guide\n for this specification may introduce greater normative constraints than\n those defined here for specific service or implementation categories.\n

            `;\n}\n\n/**\n * @param {*} conf\n */\nfunction getInformativeText(conf) {\n if (!conf.mainSpecTitle) {\n showWarning(\"warn\", \"No mainSpecTitle property found in config')\");\n }\n\n if (!conf.mainSpecBiblioKey) {\n showWarning(\"warn\", \"No mainSpecBiblioKey property found in config')\");\n }\n\n return html`

            \n This document is an informative resource in the Document Set of the\n ${conf.mainSpecTitle ? conf.mainSpecTitle : \"\"} specification\n ${conf.mainSpecBiblioKey\n ? renderInlineCitation(conf.mainSpecBiblioKey)\n : \"\"}.\n As such, it does not include any normative requirements. Occurrences in this\n document of terms such as MAY, MUST, MUST NOT, SHOULD or RECOMMENDED have no\n impact on the conformance criteria for implementors of this specification.\n

            `;\n}\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n // Add RFC2119 to the bibliography\n conf.normativeReferences.add(\"RFC2119\");\n\n // Get the appropriate text\n let content;\n\n if (conf.specNature === \"normative\") {\n content = getNormativeText(conf);\n } else if (conf.specNature === \"informative\") {\n content = getInformativeText(conf);\n }\n\n if (conformance.tagName === \"SECTION\") {\n conformance.prepend(...content.childNodes);\n } else {\n conformance.parentNode.append(...content.childNodes);\n }\n}\n\n/**\n * @param {*} conf\n */\nexport function run(conf) {\n // No conformance section in 1EdTech Errata documents\n if (conf.specType === \"errata\") {\n return;\n }\n\n let conformance = document.querySelector(\"section#conformance\");\n if (!conformance)\n conformance = document.querySelector(\"section#conformance-0\");\n if (!conformance) {\n if (conf.specType === \"doc\") {\n // Conformance is optional for generic documents\n return;\n }\n // Otherwise, the conformance section is required\n showError(\"error\", \"No section found with id 'conformance'\");\n return;\n }\n\n // Use 1EdTech specNature to determine conformance text\n if (!conf.specNature) {\n showError(\"error\", \"Document must have config.specNature set\");\n }\n\n // 1EdTech standard is to have a Conformance heading\n if (conformance.tagName === \"SECTION\") {\n const conformanceHeading = conformance.querySelector(\n \"h1, h2, h3, h4, h5, h6\"\n );\n if (!conformanceHeading) {\n showWarning(\"warn\", \"No heading found in the conformance section\");\n } else {\n // Insert conformation text after heading\n conformance = conformanceHeading;\n }\n }\n\n // Insert the conformance text\n processConformance(conformance, conf);\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 {\"attribute\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"attribute\":\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>} */\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 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\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/dfn\";\n\n/** @type {Map} */\nconst knownTypesMap = new Map([\n [\"abstract-op\", { requiresFor: false }],\n [\"attribute\", { requiresFor: false, validator: validateDOMName }],\n [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"an HTML attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"an HTML 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 sub(\"plugins-done\", addContractDefaults);\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., \")\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\nfunction addContractDefaults() {\n // Find all dfns that don't have a type and default them to \"dfn\".\n /** @type NodeListOf */\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 */\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","// @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} */\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} */\n const links = new Set();\n /** @type {NodeListOf} */\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} */\n const dfnTexts = new Set();\n /** @type {NodeListOf} */\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\n:is(aside,div).example {\n border-left-width: 0.5em;\n border-left-style: solid;\n border-color: #e0cb52;\n background: #fcfaee;\n}\n\naside.example div.example {\n border-left-width: 0.1em;\n border-color: #999;\n background: #fff;\n}\n\n\n.example pre {\n background-color: rgba(0, 0, 0, 0.03);\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\";\nimport { pub } from \"./pubsubhub.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`: ${report.title}`\n : \"\";\n return html``;\n}\n\nexport function run() {\n /** @type {NodeListOf} */\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``,\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 pub(\"example\", report);\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`
            \n ${exampleTitle} ${example.cloneNode(true)}\n
            `;\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 if (!inAside) pub(\"example\", report);\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.warning {\n border-color: #f11;\n border-width: 0.2em;\n border-style: solid;\n background: #fbe9e9;\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\";\nimport { pub } from \"./pubsubhub.js\";\n\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 {NodeListOf} ins\n * @param {Map} 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`
            `;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`
            ${title}
            `;\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 if (report.number !== undefined) {\n // Add entry to #issue-summary.\n issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\n }\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 pub(report.type, report);\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`
            `;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html``;\n }\n}\n\n/**\n * @param {string} l10nIssue\n * @param {Report} report\n */\nfunction createIssueSummaryEntry(l10nIssue, report, id) {\n const issueNumberText = `${l10nIssue} ${report.number}`;\n const title = report.title\n ? html`: ${report.title}`\n : \"\";\n return html`
          3. ${issueNumberText}${title}
          4. `;\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`

            ${l10n.no_issues_in_spec}

            `);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `

            ${l10n.issue_summary}

            `\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`: ${title}${labelsGroup}`;\n}\n\n/** @param {string} bgColorHex background color as a hex value without '#' */\nfunction textColorFromBgColor(bgColorHex) {\n return parseInt(bgColorHex, 16) > 0xffffff / 2 ? \"#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` ${name}`;\n}\n\n/**\n * @returns {Promise>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf} */\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} */\n const issuesAndNotes = document.querySelectorAll(query);\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``,\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\nimport { addId } from \"../core/utils.js\";\nimport { pub } from \"../core/pubsubhub.js\";\nimport { toHTMLElement } from \"./utils.js\";\n\nexport const name = \"1edtech/issues-notes\";\n\n/**\n * NOTE: No longer required. core/issues-notes.js handles note|warning|issue\n * just fine even if no github connection. Leaving this in the ims-default\n * profile to support existing markup.\n *\n * Handles admonitions, adding a top bar and a11y attrs\n * Types currently supported:\n * aside.note\n * aside.ednote\n * aside.warning\n * aside.issue (will yield error if status is final, warning if CF)\n *\n * Alternate syntax is div.aside.note|warning|issue\n *\n * This replaces core/issues-notes.js, which has github features we can't utilize\n * because of our non-open repos.\n *\n * @param {*} conf respecConfig\n */\nexport async function run(conf) {\n // check and warn for issue admons in late process stages\n const issues = document.body.querySelectorAll(\"aside.issue, div.aside.issue\");\n if (issues.length > 0) {\n if (conf.specStatus == \"Final Release\") {\n pub(\n \"error\",\n \"Issue asides must not be present when the status is 'Final Release'\"\n );\n } else if (conf.specStatus == \"Candidate Final\") {\n pub(\n \"warn\",\n \"Issue asides should not be present when the status is 'Candidate Final'\"\n );\n }\n }\n\n // prep the output element\n /** @type {NodeListOf} */\n const admons = document.body.querySelectorAll(\n \"aside.note, aside.ednote, aside.warning, aside.issue, \" +\n \" div.aside.note, div.aside.ednote div.aside.warning, div.aside.issue\"\n );\n\n admons.forEach(aside => {\n const type = getAdmonType(aside);\n aside.setAttribute(\"role\", \"note\");\n aside.classList.add(\"admonition\");\n if (!aside.hasAttribute(\"id\")) {\n addId(aside);\n }\n const topBar = toHTMLElement(`
            ${type}
            `);\n topBar.classList.add(`${type}-title`);\n aside.insertAdjacentElement(\"afterbegin\", topBar);\n });\n}\n\n/**\n * Returns the admonition type as a string based on the classList.\n * The three known types are \"note\", \"warning\", and \"issue\". If none\n * of those are present, returns \"info\".\n *\n * @param { * } aside the element to inspect\n * @returns { string } the admonition type as a string\n */\nfunction getAdmonType(aside) {\n if (aside.classList.contains(\"note\")) {\n return \"note\";\n } else if (aside.classList.contains(\"warning\")) {\n return \"warning\";\n } else if (aside.classList.contains(\"issue\")) {\n return \"issue\";\n }\n return \"info\";\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} */\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`${l10n.best_practice}${num + 1}`;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`
          5. ${localizedBpName}: ${makeSafeCopy(bp)}
          6. `;\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`

            Best Practices Summary

            `);\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 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 normalizeImages(document);\n\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`

            ${l10n.list_of_figures}

            `,\n html`
              \n ${tof}\n
            `\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 `
            ` without a `
            `.\";\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``);\n caption.prepend(l10n.fig, html`${i + 1}`, \" \");\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`
          7. \n ${tofCaption.childNodes}\n
          8. `;\n}\n\nfunction normalizeImages(doc) {\n doc\n .querySelectorAll(\n \":not(picture)>img:not([width]):not([height]):not([srcset])\"\n )\n .forEach(img => {\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n img.height = img.naturalHeight;\n img.width = img.naturalWidth;\n });\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\n/**\n * @param {Element} element\n */\nfunction 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","// @ts-check\n/*\n * Fetch the online ims-biblio json and append the data to conf.localBiblio.\n * This approach allows us to reuse the W3C biblio logic & implementation untouched.\n * The effect is that we have three levels of sources for biblio entries:\n * - localBiblio\n * - ims-biblio on purl.imsglobal.org\n * - specref.org\n *\n * Note: Run before core/biblio\n */\n\nimport { pub } from \"../core/pubsubhub.js\";\n\nexport const name = \"1edtech/biblio\";\n\n/**\n * @param {*} conf\n */\nexport async function run(conf) {\n let imsBiblioURL = \"https://purl.imsglobal.org/spec/ims-biblio.json\";\n if (conf.overrideIMSbiblioLocation) {\n imsBiblioURL = conf.overrideIMSbiblioLocation;\n }\n\n if (!conf.disableFetchIMSbiblio) {\n // console.log(\"fetching ims biblio...\");\n try {\n const response = await fetch(imsBiblioURL, { mode: \"cors\" });\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n const json = await response.json();\n // TODO invalid json should be caught here\n // JSON.stringify(conf.localBiblio) --> throws error?\n // TODO we might want to worry about dupes and precedence\n conf.localBiblio = Object.assign(conf.localBiblio, json);\n } catch (error) {\n pub(\"warn\", error.toString());\n }\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 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 */\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 current spec's shortname. It\n * exists to simplify code as passing `conf.shortName` everywhere gets clumsy.\n */\nexport const THIS_SPEC = \"__SPEC__\";\n\n/**\n * @param {CiteDetails} citeDetails\n */\nasync function getLinkProps(citeDetails) {\n const { key, frag, path, href: canonicalHref } = citeDetails;\n let href = \"\";\n let title = \"\";\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 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/w3c/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 return { href, title };\n}\n\n/**\n * @param {HTMLElement} elem\n * @param {object} linkProps\n * @param {string} linkProps.href\n * @param {string} linkProps.title\n * @param {CiteDetails} citeDetails\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 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 an 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 * @typedef {object} CiteDetails\n * @property {string} key\n * @property {boolean} isNormative\n * @property {string} frag\n * @property {string} path\n * @property {string} [href] - canonical href coming from xref\n * @param {HTMLElement} elem\n * @return {CiteDetails};\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 fragment\n return toCiteDetails(elem);\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\nexport async function run() {\n /** @type {NodeListOf} */\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 showWarning(msg, name, { elements: [elem] });\n }\n }\n\n sub(\"beforesave\", cleanup);\n}\n\n/**\n * Fetch and update `biblio` with entries corresponding to given elements\n * @param {HTMLElement[]} elems\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/** @param {Document} doc */\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 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} */\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 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>>} */\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>} */\n const result = new Map();\n const duplicates = [];\n for (const dfn of definitionMap.get(title)) {\n const { dfnFor = \"\", dfnType = \"dfn\" } = dfn.dataset;\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 definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as s instead of .\n const oldIsDfn = oldDfn.localName === \"dfn\";\n const newIsDfn = dfn.localName === \"dfn\";\n const isSameDfnType = dfnType === (oldDfn.dataset.dfnType || \"dfn\");\n const isSameDfnFor = dfnFor === (oldDfn.dataset.dfnFor || \"\");\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n const type = \"idl\" in dfn.dataset || dfnType !== \"dfn\" ? \"idl\" : \"dfn\";\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(type, dfn);\n addId(dfn, \"dfn\", title);\n }\n\n return { result, duplicates };\n}\n\n/**\n * Find a potentially matching for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType} 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 const type = linkType === \"dfn\" ? \"dfn\" : \"idl\";\n return dfnsByType.get(type) || 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} 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 (linkFor && !titleToDfns.get(linkFor) && linkFor !== dfnFor) {\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 .\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by .\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 \\`\\` element with text \"${elem.textContent}\" but no matching \\`\\``;\n const title = \"Linking error: not matching ``\";\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} */\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} */\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} 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/w3c/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} 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 showWarning,\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\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} */\n const links = document.querySelectorAll(\n \":is(a,dfn)[data-cite]:not([data-cite=''],[data-cite*='#'])\"\n );\n /** @type {NodeListOf} */\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: API_URL,\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} */\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>}\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[]} keys\n * @param {string} url\n * @returns {Promise>}\n */\nasync function fetchFromNetwork(keys, url) {\n if (!keys.length) return new Map();\n\n const query = { keys };\n const options = {\n method: \"POST\",\n body: JSON.stringify(query),\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.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} 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 const { pathname: citePath } = url;\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 const msg = `Normative reference to \"${term}\" found but term is defined \"informatively\" in \"${cite}\".`;\n const title = \"Normative reference to non-normative term.\";\n showWarning(msg, name, { title, elements: [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`\n [See search matches for \"${originalTerm}\"](${howToCiteURL}) or\n ${\"[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 = docLink`To fix, use the ${\"[data-cite]\"} attribute to pick the one you mean from the appropriate specification. ${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 `
            ` 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 } 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 ``.\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 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\")) {\n index.prepend(html`

            ${l10n.heading}

            `);\n }\n\n const localTermIndex = html`
            \n

            ${l10n.headlingLocal}

            \n ${createLocalTermIndex()}\n
            `;\n index.append(localTermIndex);\n\n const externalTermIndex = html`
            \n

            ${l10n.headingExternal}

            \n ${createExternalTermIndex()}\n
            `;\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`
              \n ${dataSortedByTerm.map(([term, dfns]) => renderLocalTerm(term, dfns))}\n
            `;\n}\n\nfunction collectLocalTerms() {\n /** @type {Map} */\n const data = new Map();\n /** @type {NodeListOf} */\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`
          9. \n ${{ html: text }} ${suffix\n ? { html: suffix }\n : \"\"}\n
          10. `;\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`
          11. \n ${term}\n
              \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
            \n
          12. `;\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 = `${text}`;\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 ${parent}`;\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 ${parent}`;\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 ${parent}`;\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`${secNum}`;\n };\n\n /** @type {NodeListOf} */\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`
              \n ${dataSortedBySpec.map(\n ([spec, entries]) => html`
            • \n ${renderInlineCitation(spec)} defines the following:\n
                \n ${entries\n .sort((a, b) => a.term.localeCompare(b.term))\n .map(renderExternalTermEntry)}\n
              \n
            • `\n )}\n
            `;\n}\n\nfunction collectExternalTerms() {\n /** @type {Set} */\n const uniqueReferences = new Set();\n /** @type {Map} spec => entry[] */\n const data = new Map();\n\n /** @type {NodeListOf} */\n const elements = document.querySelectorAll(`a[data-cite]`);\n for (const elem of elements) {\n if (!elem.dataset.cite) {\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; // \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`
          13. \n ${{ html: text }}\n
          14. `;\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 = term;\n\n if (CODE_TYPES.has(type)) {\n if (type === \"extended-attribute\") {\n text = `[${text}]`;\n }\n text = `${text}`;\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 = `${linkForText}`;\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\nimport { toHTMLNode } from \"./utils.js\";\n\nexport const name = \"1edtech/contrib\";\n\nexport async function run(conf) {\n if (!conf.contributors) return;\n\n if (conf.specType !== \"errata\") {\n const useRoles = hasRoles(conf.contributors);\n const contrib = toHTMLNode(`
            \n

            List of Contributors

            \n

            The following individuals contributed to the development of this document:

            \n \n \n \n \n ${useRoles ? `` : ``}\n \n \n ${personsToTableRows(conf.contributors, useRoles)}\n \n
            NameOrganizationRole
            \n
            `);\n document.body.appendChild(contrib);\n }\n}\n\nfunction personsToTableRows(arr, useRoles) {\n // use incoming sort\n let ret = \"\";\n arr.forEach(entry => {\n ret += `${entry.name}`;\n ret += \"\";\n if (entry.company) ret += entry.company;\n ret += \"\";\n if (useRoles) {\n ret += \"\";\n if (entry.role) ret += entry.role;\n ret += \"\";\n }\n ret += \"\";\n });\n return ret;\n}\n\nfunction hasRoles(arr) {\n let hasRoles = false;\n arr.forEach(entry => {\n if (entry.role && entry.role.trim().length > 0) {\n hasRoles = true;\n }\n });\n return hasRoles;\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`
              `;\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`${secno} `);\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} */\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``;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`
            1. ${anchor}
            2. `;\n}\n\n/**\n * Replaces any child
              and with .\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} */\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``;\n const h2 = html`

              ${l10n.toc}

              `;\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`

              \n \n

              `;\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`

              ${l10n.informative}

              `);\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.caniuse-stats {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: baseline;\n}\n\nbutton.caniuse-cell {\n margin: 1px 1px 0 0;\n border: none;\n}\n\n.caniuse-browser {\n position: relative;\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)::before {\n content: \"⚠️\";\n padding: 0.5em;\n }\n}\n\n/* reset styles, hide old versions by default */\n.caniuse-browser ul {\n display: none;\n margin: 0;\n padding: 0;\n list-style: none;\n position: absolute;\n left: 0;\n z-index: 2;\n background: #fff;\n margin-top: 1px;\n}\n\n.caniuse-stats a[href] {\n white-space: nowrap;\n align-self: center;\n margin-left: 0.5em;\n}\n\n/* a browser version */\n.caniuse-cell {\n display: flex;\n font-size: 90%;\n height: 0.8cm;\n margin-right: 1px;\n margin-top: 0;\n min-width: 3cm;\n overflow: visible;\n justify-content: center;\n align-items: center;\n\n --supported: #2a8436;\n --no-support: #c44230;\n --no-support-alt: #b43b2b;\n --partial: #807301;\n --partial-alt: #746c00;\n\n color: #fff;\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\nli.caniuse-cell {\n margin-bottom: 1px;\n}\n\n.caniuse-cell:focus {\n outline: none;\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.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/* show rest of the browser versions */\n.caniuse-stats button:focus + ul,\n.caniuse-stats .caniuse-browser:hover > ul {\n display: block;\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/w3c/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\nconst BROWSERS = new Set([\n \"and_chr\",\n \"and_ff\",\n \"and_uc\",\n \"android\",\n \"bb\",\n \"chrome\",\n \"edge\",\n \"firefox\",\n \"ie\",\n \"ios_saf\",\n \"op_mini\",\n \"op_mob\",\n \"opera\",\n \"safari\",\n \"samsung\",\n]);\n\nexport function prepare(conf) {\n if (!conf.caniuse) {\n return; // nothing to do.\n }\n const options = getNormalizedConf(conf);\n conf.caniuse = options; // for tests\n if (!options.feature) {\n return; // no feature to show\n }\n\n document.head.appendChild(html`\n ${css}\n `);\n\n const apiUrl = options.apiURL || API_URL;\n // Initiate a fetch, but do not wait. Try to fill the cache early instead.\n conf.state[name] = {\n fetchPromise: fetchStats(apiUrl, options),\n };\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\n const headDlElem = document.querySelector(\".head dl\");\n const contentPromise = (async () => {\n try {\n const stats = await conf.state[name].fetchPromise;\n return html`${{ html: stats }}`;\n } catch (err) {\n const msg = `Couldn't find feature \"${options.feature}\" on caniuse.com.`;\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`caniuse.com`;\n }\n })();\n const definitionPair = html`
              \n Browser support (caniuse.com):\n
              \n
              \n ${{\n any: contentPromise,\n placeholder: \"Fetching data from caniuse.com...\",\n }}\n
              `;\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 caniuse.com`;\n });\n }\n}\n\n/**\n * returns normalized `conf.caniuse` configuration\n * @param {Object} conf configuration settings\n */\nfunction getNormalizedConf(conf) {\n const DEFAULTS = { versions: 4, removeOnSave: false };\n if (typeof conf.caniuse === \"string\") {\n return { feature: conf.caniuse, ...DEFAULTS };\n }\n const caniuseConf = { ...DEFAULTS, ...conf.caniuse };\n const { browsers } = caniuseConf;\n if (Array.isArray(browsers)) {\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 return caniuseConf;\n}\n\n/**\n * @param {string} apiURL\n * @typedef {Record} ApiResponse\n * @throws {Error} on failure\n */\nasync function fetchStats(apiURL, options) {\n const { feature, versions, browsers } = options;\n const searchParams = new URLSearchParams();\n searchParams.set(\"feature\", feature);\n searchParams.set(\"versions\", versions);\n if (Array.isArray(browsers)) {\n searchParams.set(\"browsers\", browsers.join(\",\"));\n }\n searchParams.set(\"format\", \"html\");\n const url = `${apiURL}?${searchParams.toString()}`;\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 const stats = await response.text();\n return stats;\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: 3em;\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 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 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 background-color: #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://resources.whatwg.org/browser-logos/chrome.svg);\n}\n\n.mdn .edge::before,\n.mdn .edge_mobile::before {\n background-image: url(https://resources.whatwg.org/browser-logos/edge.svg);\n}\n\n.mdn .firefox::before,\n.mdn .firefox_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/firefox.png);\n}\n\n.mdn .ie::before {\n background-image: url(https://resources.whatwg.org/browser-logos/ie.png);\n}\n\n.mdn .opera::before,\n.mdn .opera_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/opera.svg);\n}\n\n.mdn .safari::before {\n background-image: url(https://resources.whatwg.org/browser-logos/safari.png);\n}\n\n.mdn .safari_ios::before {\n background-image: url(https://resources.whatwg.org/browser-logos/safari-ios.svg);\n}\n\n.mdn .samsunginternet_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/samsung.svg);\n}\n\n.mdn .webview_android::before {\n background-image: url(https://resources.whatwg.org/browser-logos/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 ie: \"Internet Explorer\",\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``;\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`
              \n MDN${engineSupport}\n ${mdnSubPath}\n ${getEngineSupport(engines)}\n ${support\n ? buildBrowserSupportTable(support)\n : html`

              No support data.

              `}\n
              `;\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`\n ${MDN_BROWSERS[browserId]}\n ${version ? version : displayStatus}\n `;\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`\n ${Object.keys(MDN_BROWSERS).map(browserId => {\n return support[browserId]\n ? createRowFromBrowserData(browserId, support[browserId])\n : createRow(browserId, \"Unknown\", \"\");\n })}\n
              `;\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} MdnSupportEntry\n * @typedef {{ name: string, title: string, slug: string, summary: string, support: MdnSupportEntry, engines: string[] }} MdnEntry\n * @typedef {Record} MdnData\n * @returns {Promise}\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} */\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``;\n }\n if (engines.length < 2) {\n return html`🚫`;\n }\n return html``;\n}\n\n/**\n * @param {MdnEntry['engines']} engines\n * @returns {HTMLParagraphElement|undefined}\n */\nfunction getEngineSupport(engines) {\n if (engines.length === 3) {\n return html`

              ${l10n.inAllEngines}

              `;\n }\n if (engines.length < 2) {\n return html`

              ${l10n.inSomeEngines}

              `;\n }\n}\n","// @ts-check\n/**\n * module: 1edtech/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 * Clone of core/exporter. This clone accepts application/cms as a mimeType\n * and will generate an HTML except suitable for Drupal or other CMS.\n */\n\nimport { removeCommentNodes, removeReSpec, showError } from \"../core/utils.js\";\nimport { expose } from \"../core/expose-modules.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { pub } from \"../core/pubsubhub.js\";\n\nconst name = \"1edtech/exporter\";\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\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 rsDocToCmsDataURL(doc = document) {\n const data = serializeHTML(doc);\n const encodedString = encodeURIComponent(data);\n return `data:text/html;charset=utf-8,${encodedString}`;\n}\n\n/**\n * Creates a dataURI of the CSS in a ReSpec document.\n *\n * @param {Document} doc document to export from.\n * @returns a stringified data-uri of stylesheet that can be saved.\n */\nexport async function rsDocToCssDataURL(doc = document) {\n const data = await serializeCSS(doc);\n const encodedString = encodeURIComponent(data);\n return `data:text/css;charset=utf-8,${encodedString}`;\n}\n\nasync function serializeCSS(doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n return await createCssExtract(cloneDoc.head);\n}\n\nfunction serializeHTML(doc) {\n // Convert image urls to data uris before\n // cloning the document. The clone does not\n // have rendered images.\n const images = doc.querySelectorAll(\"img\");\n images.forEach(img => {\n img.setAttribute(\"src\", getDataURL(img));\n });\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n createCmsExtract(cloneDoc.body);\n return cloneDoc.body.innerHTML;\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``;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n \n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/**\n * Strip content that is not allowed in Drupal or other CMS.\n *\n * @param {HTMLElement} docBody The document body element\n */\nfunction createCmsExtract(docBody) {\n let started = false;\n let finished = false;\n docBody.childNodes.forEach(node => {\n if (!started) {\n if (node.nodeName !== \"HEADER\") {\n node.remove();\n } else {\n started = true;\n }\n } else if (!finished) {\n if (node.nodeName == \"FOOTER\") {\n finished = true;\n } else if (node.nodeName == \"SCRIPT\") {\n node.remove();\n } else if (node.nodeName == \"STYLE\") {\n node.remove();\n }\n } else {\n node.remove();\n }\n });\n}\n\n/**\n * Combine all the stylesheets in the document head\n *\n * @param {HTMLElement} docHead The document body element\n * @returns A CSS stylesheet with all the styles combined\n */\nasync function createCssExtract(docHead) {\n let css = \"\";\n /** @type {NodeListOf} */\n const links = docHead.querySelectorAll(\"link[rel='stylesheet']\");\n await Promise.all(\n Array.from(links).map(async link => {\n try {\n const fetcher = await fetch(link.href);\n const data = await fetcher.text();\n css += data;\n } catch (err) {\n showError(`Cannot retrieve stylesheet ${link.href}. ${err}.`, name);\n }\n })\n );\n const styles = docHead.querySelectorAll(\"style\");\n styles.forEach(style => {\n css += style.innerText;\n });\n return css;\n}\n\n/**\n * Return a Data URL for the image. The Data URL will relace\n * the image source URL. This makes it easier to update the CMS\n * because there are no external image files to update.\n *\n * @param {HTMLImageElement} img\n */\nfunction getDataURL(img) {\n try {\n const canvas = img.ownerDocument.createElement(\"canvas\");\n canvas.width = img.width;\n canvas.height = img.height;\n const context = canvas.getContext(\"2d\");\n context.drawImage(img, 0, 0, img.width, img.height);\n return canvas.toDataURL();\n } catch (err) {\n const message = err.toString();\n if (!message.startsWith(\"SecurityError\")) {\n showError(message, name);\n }\n return img.src;\n }\n}\n\nexpose(name, { rsDocToCmsDataURL, rsDocToCssDataURL });\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 { rsDocToCmsDataURL } from \"../1edtech/exporter.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 id: \"respec-save-as-cms-extract\",\n ext: \"txt\",\n title: \"CMS EXTRACT\",\n type: \"application/cms\",\n get href() {\n return rsDocToCmsDataURL();\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` ui.closeModal()}\n >${title}`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`
              \n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n
              `;\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 \n Open Search UI in a new tab\n `;\n ui.freshModal(l10n.search_specref, specrefSearchUI, button);\n}\n","// @ts-check\n// Module ui/search-xref\n// Search xref database\nimport { lang as defaultLang } from \"../core/l10n.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 lang = defaultLang in localizationStrings ? defaultLang : \"en\";\nconst l10n = localizationStrings[lang];\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 \n Open Search UI in a new tab\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

              \n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n

              \n

              \n Documentation,\n Bugs.\n

              \n \n \n \n \n \n \n \n \n ${entries}\n \n`;\n ui.freshModal(`${l10n.about_respec} - ${window.respecVersion}`, div, button);\n}\n\nfunction perfEntryToTR({ name, duration }) {\n const moduleURL = `https://github.com/w3c/respec/blob/develop/src/${name}.js`;\n return html`\n \n ${name}\n ${duration}\n \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 */\n\nexport const name = \"core/seo\";\n\nexport function run() {\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\nexport const name = \"1edtech/seo\";\n\n/**\n * Add a canonical href\n *\n * @param {*} conf respecConfig\n *\n * Can be run before or after core/seo\n */\nexport async function run(conf) {\n const linkElem = document.createElement(\"link\");\n linkElem.setAttribute(\"rel\", \"canonical\");\n linkElem.setAttribute(\"href\", conf.thisURL);\n document.head.appendChild(linkElem);\n}\n","/*\nAdapted from Atom One Light by Daniel Gamage for ReSpec, with better color contrast\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\nbase: #fafafa\nmono-1: #383a42\nmono-2: #686b77\nmono-3: #a0a1a7\nhue-1: #0184bb\nhue-2: #4078f2\nhue-3: #a626a4\nhue-4: #50a14f\nhue-5: #e45649\nhue-5-2: #c91243\nhue-6: #986801\nhue-6-2: #c18401\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 display: block;\n overflow-x: auto;\n padding: 0.5em;\n color: #383a42;\n background: #fafafa;\n}\n\n.hljs-comment,\n.hljs-quote {\n color: #717277;\n font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n color: #a626a4;\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n color: #ca4706;\n font-weight: bold;\n}\n\n.hljs-literal {\n color: #0b76c5;\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n color: #42803c;\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n color: #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}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n color: #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 = `${value}`;\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``\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
            3. \n ${testFileName}\n ${emojiList}\n
            4. \n `;\n return testList;\n}\n\nexport function run(conf) {\n /** @type {NodeListOf} */\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
              \n tests: ${uniqueList.length}\n
                \n ${uniqueList.map(toListItem)}\n
              \n
              \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} */\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/* 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 within a section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from 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(\"section\");\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll(\"var\")].filter(\n el =>\n norm(el.textContent) === textContent && el.closest(\"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","/* dfn popup panel that list all local references to a dfn */\n/**\n * TODO: Revert changes due to https://github.com/w3c/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: small Helvetica Neue, sans-serif, Droid Sans Fallback;\n background: #fff;\n color: 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 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 top: 0;\n}\n.dfn-panel:not(.docked) > .caret::before {\n border-bottom: 9px solid #a2a9b1;\n}\n\n.dfn-panel * {\n margin: 0;\n}\n\n.dfn-panel b {\n display: block;\n color: #000;\n margin-top: 0.25em;\n}\n\n.dfn-panel ul a[href] {\n color: #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``,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf} */\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} */\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 \n \n
              \n Permalink\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n
              \n

              Referenced in:

              \n ${referencesToHTML(id, links)}\n \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`exported`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf} 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`IDL`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`
                \n
              • Not referenced in this document.
              • \n
              `;\n }\n\n /** @type {Map} */\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 => html`
            5. \n ${toLinkProps(entry).map(\n link =>\n html`${link.text}${\" \"}`\n )}\n
            6. `;\n\n return html`
                \n ${[...titleToIDs].map(listItemToHTML)}\n
              `;\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","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: #000;\n}\n\n/* actual text */\nvar[data-type]::after {\n content: attr(data-type);\n transform: translateX(-50%) translateY(-100%);\n background: #000;\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 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} */\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.assert {\n background: #eee;\n border-left: 0.5em solid #aaa;\n padding: 0.3em;\n}\n`;\n","// @ts-check\n/**\nCurrently used only for adding 'assert' class to algorithm lists\n*/\nimport css from \"../styles/algorithms.css.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(document.querySelectorAll(\"ol.algorithm li\"));\n elements\n .filter(li => li.textContent.trim().startsWith(\"Assert: \"))\n .forEach(li => li.classList.add(\"assert\"));\n if (document.querySelector(\".assert\")) {\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n }\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} */\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 \"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 \\`
              \\`.`;\n const title = \"Missing figcaption in referenced figure.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n // remove the figure's title\n const children = [...makeSafeCopy(figcaption).childNodes].filter(\n // @ts-ignore\n node => !node.classList || !node.classList.contains(\"fig-title\")\n );\n // drop an empty space at the end.\n children.pop();\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 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","// @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
                \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
              \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` (#${prNumber})`;\n return html`
            7. ${message.trim()}${pr}
            8. `;\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\nexport const name = \"1edtech/cleanBody\";\n\n/**\n * A snapshot-time body merciless script and inline css remover. Intended to\n * be used only by admins. The activators are conf.cleanBodyScripts,\n * conf.cleanBodyCSS, alternatively conf.cleanBodyAll\n *\n * @param {*} conf respecConfig\n */\nexport async function run(conf) {\n if (conf.cleanBodyAll || conf.cleanBodyScripts) {\n const scripts = document.body.querySelectorAll(\"script\");\n scripts.forEach(script => {\n script.parentNode.removeChild(script);\n });\n }\n\n if (conf.cleanBodyAll || conf.cleanBodyCSS) {\n const styleElems = document.querySelectorAll(\"*[style]\");\n styleElems.forEach(styleElem => {\n styleElem.removeAttribute(\"style\");\n });\n }\n}\n","// @ts-check\n\nexport const name = \"1edtech/title-attrs\";\n\n/**\n * Adds title attributes to internal definition references. When the\n * reader hovers over the defined term, they will see the definition.\n *\n * If the term is defined in a definition list, the definiton is pulled\n * from the definition description element. For example,\n *\n *
              \n *
              Term
              \n *
              This is my term.
              \n *
              \n *\n * If the term is defined outside of a defintion list, the definition is\n * pulled from the nearest ancestor p, td, li, div, or aside. For example,\n *\n *

              \n * This is my Term.\n *

              \n *\n * @param {*} conf respecConfig\n */\nexport async function run(conf) {\n if (conf.noTitleAttrs) {\n return;\n }\n\n // for now we deal only with a.internalDFN, whose title attr value is\n // fetched from the destination link\n\n const anchors = document.body.querySelectorAll(\"a[href].internalDFN\");\n anchors.forEach(anchor => {\n const selector = anchor.getAttribute(\"href\");\n const dfn = document.body.querySelector(selector);\n if (dfn && dfn.tagName === \"DFN\") {\n let text = \"\";\n if (hasAncestor(dfn, \"dt\")) {\n // get the text content of the dd\n const dt = dfn.closest(\"dt\");\n const dd = dt.nextElementSibling;\n if (dd && dd.tagName === \"DD\") {\n text = dd.textContent;\n }\n } else {\n // get the text content of the neareset dfn block(?) parent\n const blockishParent = dfn.closest(\"p, td, li, div, aside\");\n if (blockishParent) {\n text = blockishParent.textContent;\n }\n }\n\n if (text.length > 0) {\n // console.log(text);\n text = text.replace(/^(\\s*)|(\\s*)$/g, \"\").replace(/\\s+/g, \" \");\n const ttl = document.createAttribute(\"title\");\n ttl.value = text;\n anchor.setAttributeNode(ttl);\n }\n }\n });\n}\n\nfunction hasAncestor(element, ancestorName) {\n const anc = element.closest(ancestorName);\n return anc != null;\n}\n","// @ts-check\nexport const name = \"1edtech/scripts\";\n\n/**\n * Attach fixup script.\n *\n * @param {*} conf respecConfig\n */\nexport async function run(conf) {\n if (!conf.noSideBarTOC) {\n // 1EdTech canonical location\n let fixupURL = \"https://purl.imsglobal.org/spec/fixup.js\";\n if (conf.overrideFixupLocation) {\n fixupURL = conf.overrideFixupLocation;\n }\n attachScript(fixupURL);\n } else {\n document.body.className += \" toc-inline\";\n }\n}\n\n/**\n * Append the script to the document.\n *\n * @param {string} url the URL of the script to attach\n */\nfunction attachScript(url) {\n const script = document.createElement(\"script\");\n script.addEventListener(\n \"load\",\n () => {\n if (window.location.hash) {\n // eslint-disable-next-line\n window.location = window.location;\n }\n },\n { once: true }\n );\n script.src = url;\n document.body.appendChild(script);\n}\n","// @ts-check\n\nexport const name = \"1edtech/comments\";\n\n/**\n * Remove all comment nodes.\n */\nexport async function run() {\n const nodeIterator = document.createNodeIterator(\n document.documentElement,\n NodeFilter.SHOW_COMMENT\n );\n const comments = [];\n let currentNode;\n\n while ((currentNode = nodeIterator.nextNode())) {\n comments.push(currentNode);\n }\n\n comments.forEach(comment => {\n comment.parentElement.removeChild(comment);\n });\n}\n","/* eslint-disable prettier/prettier */\n// @ts-check\n/**\n * Module 1edtech/footers\n * \n * Add 1EdTech boilerplate back matter to the document.\n */\n\nimport footersTmpl from \"./templates/footers.js\";\n\nexport const name = \"1edtech/footers\";\n\n/**\n * @param {*} conf\n */\nexport async function run(conf) {\n\n const footer = footersTmpl(conf);\n document.body.appendChild(footer);\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\n\nexport default conf => {\n return html`

              \n
              \n

              \n 1EdTech™ Consortium, Inc. (\"1EdTech\") is publishing the\n information contained in this document (\"Specification\") for purposes of\n scientific, experimental, and scholarly collaboration only.\n

              \n

              \n 1EdTech makes no warranty or representation regarding the accuracy or\n completeness of the Specification.\n

              \n

              This material is provided on an \"As Is\" and \"As Available\" basis.

              \n

              \n The Specification is at all times subject to change and revision without\n notice.\n

              \n

              \n It is your sole responsibility to evaluate the usefulness, accuracy, and\n completeness of the Specification as it relates to you.\n

              \n

              1EdTech would appreciate receiving your comments and suggestions.

              \n

              \n Please contact 1EdTech through our website at\n www.1edtech.org.\n

              \n

              \n Please refer to Document Name: ${conf.specTitle.replace(\"
              \", \" \")}\n ${conf.specVersion}\n

              \n

              Date: ${conf.specDate}

              \n
              \n
              \n
              `;\n};\n","// @ts-check\n/**\n * Checks whether the document has `` 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 \\`\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`\\` section - \\`\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `文档只能包含一个 charset 属性为 utf-8 的 \\`\\` 标签`,\n hint: `将此行添加到文档的 \\`\\` 部分—— \\`\\` 或将 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} */\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

              .\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} */\n const elems = document.querySelectorAll(\"p:not(#back-to-top)\");\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} */\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} */\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 `

              `.\",\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 `
              `.\",\n },\n zh: {\n msg: \"所有章节(section)都必须以 `h2-6` 元素开头。\",\n hint: \"将 `h2-6` 添加到有问题的章节或使用 `
              `。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nconst hasNoHeading = ({ firstElementChild: elem }) => {\n return elem === null || /^h[1-6]$/.test(elem.localName) === false;\n};\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n const offendingElements = [...document.querySelectorAll(\"section\")].filter(\n hasNoHeading\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 * 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 ``.\",\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
              contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n *
                \n *
                  \n * ```\n * The selector does not match:\n * ``` html\n *
                    \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 * `` in this section, but excluding those in child sections.\n * @type {NodeListOf}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map} */\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 \"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} */\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
                    , 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}\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} */\nfunction importAxe() {\n const script = document.createElement(\"script\");\n script.classList.add(\"remove\");\n script.src = \"https://unpkg.com/axe-core@3/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"],"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","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","args","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","addEventListener","cacheDonePromiseForTransaction","IDBObjectStore","IDBIndex","some","c","Proxy","IDBRequest","request","promise","success","result","catch","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","async","storeName","store","index","shift","oldTraps","blocked","indexedDB","deleteDatabase","version","upgrade","blocking","terminated","open","openPromise","event","oldVersion","newVersion","db","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","esmEntry$1","exports","defaults$5","getDefaults$1","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartLists","smartypants","tokenizer","walkTokens","xhtml","defaults","getDefaults","changeDefaults","newDefaults","escapeTest","escapeReplace","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","unescapeTest","unescape$1","_","n","charAt","String","fromCharCode","parseInt","substring","caret","nonWordAndColonTest","originIndependentUrl","baseUrls","justDomain","protocol","domain","resolveUrl","base","href","rtrim$1","relativeBase","indexOf","str","invert","l","length","suffLen","currChar","substr","helpers","escape","encode","unescape","edit","regex","opt","source","obj","val","getRegex","RegExp","cleanUrl","prot","decodeURIComponent","e","encodeURI","noopTest","exec","merge","key","i","arguments","Object","hasOwnProperty","splitCells","tableRow","count","cells","match","offset","escaped","curr","split","trim","pop","splice","push","rtrim","findClosingBracket","b","level","checkSanitizeDeprecation","console","warn","repeatString","pattern","defaults$4","escape$2","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","Tokenizer_1$1","constructor","options","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","slice","join","indentCodeCompensation","heading","trimmed","depth","inline","hr","blockquote","blockTokens","list","istask","ischecked","indent","blankLine","endsWithBlankLine","line","lines","itemContents","bull","isordered","ordered","start","loose","items","itemRegex","trimLeft","search","nextBulletRegex","Math","min","task","checked","trimRight","top","t","pre","def","tag","table","item","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","linkLen","_escapes","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","nextChar","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","lastIndex","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","merge$1","block$1","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","inline$1","reflinkSearch","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Tokenizer$2","defaults$3","out","charCodeAt","random","toString","Lexer_1$1","Lexer","create","inlineQueue","static","lex","next","lastToken","cutSrc","lastParagraphClipped","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","keepPrevChar","keys","lastIndexOf","startInline","defaults$2","escape$1","Renderer_1$1","infostring","quote","slugger","slug","body","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer_1$1","Slugger_1$1","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","dryrun","Renderer$2","TextRenderer$2","Slugger$2","defaults$1","Parser_1$1","Parser","textRenderer","parse","parseInline","l2","l3","cell","itemBody","ret","renderers","parser","unshift","Lexer$1","Parser$1","Tokenizer$1","Renderer$1","TextRenderer$1","Slugger$1","marked$1","err","pending","setTimeout","message","setOptions","use","opts","childTokens","hasExtensions","pack","ext","prevRenderer","prevTokenizer","lexInline","Renderer","TextRenderer","Tokenizer","Slugger","marked","esmEntry","globalThis","global","self","module","pluralize$1","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","interpolate","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","delete","configurable","o","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","x","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","ae","oe","ue","ce","le","se","fe","he","de","ve","pe","ge","me","ye","be","concat","we","removeAttribute","nodeName","setAttributeNode","cloneNode","textContent","replaceChild","Ne","path","sparse","xe","Ee","Ce","convert","transform","Se","updates","fn","any","attribute","values","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","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","_pluralize","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","trimEnd","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","nonNormativeSelector","createResourceHint","URL","baseURI","linkElem","rel","hint","origin","corsMode","location","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","docLang","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","joinOr","norm","getIntlData","localizationStrings","resolveLanguageAlias","data","linkCSS","urls","frag","reduce","nextLink","head","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","Set","normText","dataset","child","getElementsByTagName","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","startsWith","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","msg","markAsOffending","toJSON","stack","details","showError","pluginName","pub","toMDCode","codedJoinAnd","quotes","addQuotes","docLink","strings","endsWith","linkingText","subscriptions","topic","cb","arg","JSON","stringify","postMessage","sub","once","callbacks","unsub","removeList","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","respecIsReadyWarningShown","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","filter","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","reindent","indents","leastIndent","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","Builder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","process","addElement","structure","fragment","restructure","structuredInternals","firstElementChild","processMDSections","conf","hasMDSections","isMDFormat","processedElem","rsUI","newBody","trimStart","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","ariaDecorate","ariaMap","styleElement","css","respecUI","menu","closeButton","ui","closeModal","modal","overlay","trapFocus","buttons","respecPill","toggleMenu","toggle","hidden","focusableEls","firstFocusableEl","lastFocusableEl","focus","shiftKey","activeElement","preventDefault","stopPropagation","errWarn","arr","butName","button","ol","createContextualFragment","rsErrorToHTML","li","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","ReSpec.run","hash","hasLink","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","imsDefaults","insertStyle","noReSpecCSS","attachMetaViewport","meta","delimiter","separator","toKeyValuePairs","width","overrideCSSLocation","cssURL","check","specTitle","docVersion","specDate","date","Date","langs","toLocaleString","humanDate","specNature","specType","shortName","specVersion","versionURL","thisURL","errataURL","latestURI","mainSpecURL","toHTMLNodes","string","toHTMLNode","transclude","newNodes","resolveGithubPromise","rejectGithubPromise","github","file_a_bug","participate","commit_history","ko","zh","ja","nl","es","ghURL","tempURL","repoURL","org","repo","pathname","branch","issueBase","commitHistoryURL","newProps","edDraftURI","githubToken","githubUser","atRiskBase","otherLinks","pullBase","githubAPI","hostname","excludeGithubLinks","otherLink","normalizedGHObj","apiBase","fullName","issuesURL","pullsURL","newIssuesURL","normalizedConfig","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","includables","promisesToInclude","include","includeId","response","fetch","validateInt32","Number","isInteger","validateInt64","validateNumber","renderIssue","issue","renderNote","note","renderTerm","term","parentClass","documentation","description","issues","notes","renderType","stereoType","classData","properties","showPrivacyAnnotations","property","renderPrivacyImplicationDoc","privacyDoc","cardinality","renderCardinality","privacyImplications","renderPrivacyImplication","renderPrivacyImplicationCell","renderProperty","isExtensible","renderExtensibility","dataModel","rootPath","operation","queryParameters","parameter","renderUrl","param","renderParmeterType","renderRequired","renderConfidentialityCell","renderParameter","renderRequestParameters","bodies","contentType","renderBodyType","renderRequestBody","renderRequestBodies","renderRequest","responses","flatMap","mergeResponseBodies","resp","statusCode","renderResponse","renderResponses","mergedResponses","confidentiality","renderConfidentiality","renderSuperClass","cls","getApiKey","mps","apiKey","getBaseUrl","serverUrl","getJsonSchema","allowAdditionalProperties","res","headers","ok","status","json","getModel","sessionStorage","getItem","query","model","modelByID","setItem","processClass","classModel","suffix","enumerationTemplate","generalizations","embeddedSelectionTemplate","classTemplate","thisElement","nodeValue","insertAdjacentElement","processInterface","serviceInterface","preferredId","headerId","operations","interfaceTemplate","operationSection","processOperation","processJsonSchema","schema","jsonSchemaTemplate","processJsonSchemas","modelId","packageName","jsonSchemasTemplate","classes","classSection","processOpenApiSchema","binding","getOpenApiSchema","modelData","openApiSchemaTemplate","operationTemplate","processSample","parentElem","classId","includeOptionalFields","sampleData","getDataSample","sample","processServiceModel","serviceModelId","serviceModel","services","service","serviceModelTemplate","serviceInterfaces","interfaces","interfaceId","interfaceSection","processStereoType","dataModelTemplate","typeList","types","nameA","nameB","stereoTypeTemplate","processClassDiagram","packageNames","classNames","omitProperties","hideTitle","diagram","packages","getClassDiagram","default","mermaid","import","initialize","startOnLoad","cleanedSvg","classDiagramTemplate","modelSections","models","dataModelSections","stereoTypeSections","serviceModelSections","schemaSections","classDiagramSections","processDataModel","schemaFormat","samples","ajv2019","ajv","allErrors","addFormat","addFormats","examples","schemaId","schemaDef","preText","innerText","refs","$id","compile","validate","instancePath","keyword","additionalProperty","validateExample","removeItem","mdm","privacy_section_header","privacy_implications","privacy_implications_paragraph","confidentiality_level","confidentiality_level_paragram","ACCESSIBILITY_label","ACCESSIBILITY_def","ANALYTICS_label","ANALYTICS_def","CONTAINER_label","CONTAINER_def","CREDENTIALS_label","CREDENTIALS_def","CREDENTIALSIDREF_label","CREDENTIALSIDREF_def","DEMOGRAPHICS_label","DEMOGRAPHICS_def","EXTENSION_label","EXTENSION_def","FINANCIAL_label","FINANCIAL_def","IDENTIFIER_label","IDENTIFIER_def","IDENTIFIERREF_label","IDENTIFIERREF_def","INSURANCE_label","INSURANCE_def","LEGAL_label","LEGAL_def","MEDICAL_label","MEDICAL_def","NA_label","NA_def","OTHER_label","OTHER_def","QUALIFICATION_label","QUALIFICATION_def","PERSONAL_label","PERSONAL_def","SOURCEDID_label","SOURCEDID_def","SOURCEDIDREF_label","SOURCEDIDREF_def","UNRESTRICTED_label","UNRESTRICTED_def","NORMAL_label","NORMAL_def","RESTRICTED_label","RESTRICTED_def","VERYRESTRICTED_label","VERYRESTRICTED_def","privacyImplicationsKeys","confidentialityLevelKeys","createSection","privacySection","piSection","translations","confSection","confLevelTmpl","mdOnlies","getStatusString","specStatusString","showLink","class","showLinkData","renderIpr","iprs","renderIprRow","renderIprTable","company","electionDate","necessaryClaims","renderSpecVersion","renderSpecStatus","renderVersionTable","renderDisclosure","getFullYear","headersTmpl","headings","abstract","contains","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","findConformanceSection","sectionElements","foundSection","conformance","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","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","reverse","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","reference","promisesToAdd","isInDB","put","close","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","forceUpdate","refsToFetch","onLine","oneHourFromNow","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","badrefs","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","authors","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","re","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","getNormativeText","MUST","REQUIRED","SHALL","SHOULD","RECOMMENDED","MAY","OPTIONAL","terms","skipCertGuideConformanceRef","processConformance","mainSpecTitle","mainSpecBiblioKey","getInformativeText","conformanceHeading","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","validator","associateWith","knownTypes","computeType","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","codedJoinOr","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","makeTitle","num","report","number","div","inAside","exampleTitle","editors_note","feature_at_risk","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","bgColorHex","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","makeIssueSectionSummary","issuesAndNotes","issueNumbers","fetchAndStoreGithubIssues","headElem","ednote","aside","getAdmonType","topBar","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","height","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","sections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","every","decorateTableOfFigures","imsBiblioURL","overrideIMSbiblioLocation","disableFetchIMSbiblio","mode","statusText","THIS_SPEC","getLinkProps","citeDetails","canonicalHref","relPath","linkProps","wrapInCiteEl","noExport","makeComponentFinder","findFrag","findPath","toCiteDetails","rawKey","citeFrag","citePath","citeHref","parentKey","isNormative","closestIsNormative","hasPrecedingMark","attrToRemove","promisesForBibEntries","missingBibEntries","newEntries","updateBiblio","originalKey","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","STORE_NAME","VERSION_CHECK_WAIT","getIdbCache","resolveXrefCache","queries","cachedData","lastChecked","localStorage","API_URL","lastUpdated","shouldBustCache","clearXrefData","requiredKeySet","cache","cursor","profiles","getRequestEntry","getTermFromElement","specs","dataciteElem","cites","closestSection","inlineRefs","higherPriority","uniqueSpecs","dedupeSpecContext","getSpecContext","getTypeContext","dataXrefForElem","getForContext","addDataCite","uri","shortname","normative","flat","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","showErrors","addDataCiteToTerms","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","dfns","renderItem","getLocalTermText","renderLocalTerm","createLocalTermIndex","externalTermIndex","dataSortedBySpec","specA","specB","createExternalTermIndex","contributors","useRoles","hasRoles","role","contrib","personsToTableRows","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","noToc","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","informative","BROWSERS","fetchStats","apiURL","feature","versions","browsers","caniuse","DEFAULTS","removeOnSave","caniuseConf","invalidBrowsers","browser","getNormalizedConf","fetchPromise","featureURL","headDlElem","contentPromise","stats","definitionPair","outputDoc","BASE_JSON_PATH","MDN_BROWSERS","chrome","chrome_android","edge","edge_mobile","firefox","firefox_android","ie","opera","opera_android","safari","safari_ios","samsunginternet_android","webview_android","inAllEngines","inSomeEngines","insertMDNBox","targetAncestor","targetSibling","mdnBox","attachMDNDetail","mdnSpec","summary","support","engines","mdnSubPath","engineSupport","getEngineSupportIcons","getEngineSupport","createRow","browserId","yesNoUnknown","displayStatus","createRowFromBrowserData","versionData","version_removed","versionAdded","version_added","buildBrowserSupportTable","mdnKey","mdn","getMdnKey","mdnSpecJson","mdnConf","baseJsonPath","maxAge","Request","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","toISOString","cacheResponse","Response","blob","fetchAndCache","getMdnData","findElements","mdnSpecArray","rsDocToCmsDataURL","canvas","getContext","drawImage","toDataURL","getDataURL","docBody","started","finished","createCmsExtract","serializeHTML","rsDocToCssDataURL","docHead","fetcher","createCssExtract","serializeCSS","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","publishDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","search_specref","specrefSearchUI","xrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","fetchBase","workerPromise","workerScript","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","noHighlightCSS","highlightables","promisesToHighlight","missing_test_suite_uri","tests","toListItem","emojiList","testFile","testParts","testFileName","requiresConnectionEmoji","manualPerformEmoji","toTestURLs","testSuiteURI","handleDuplicates","testURLs","toHTML","uniqueList","testables","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","loadScript","varMap","variables","currentSection","processBox","matchingElement","selfLink","copy","processFigure","figcaption","figTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","HTMLElement","props","to","connectedCallback","fetchCommits","commits","commit","prNumber","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","cleanBodyAll","cleanBodyScripts","cleanBodyCSS","styleElem","noTitleAttrs","ancestorName","hasAncestor","dd","nextElementSibling","blockishParent","ttl","noSideBarTOC","fixupURL","overrideFixupLocation","attachScript","comments","currentNode","footer","footersTmpl","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","hasNoHeading","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","filesInWPT","githubAPIBase","wptDirectory","testSuiteURL","files","getFilesInWPT","missingTest","offendingMembers","getOwnPropertyNames","DISABLED_RULES","formatHintsAsMarkdown","group","a11y","violations","otherOptions","enabled","elementRef","resultTypes","reporter","axe","onload","onerror","importAxe","getViolations","violation","groupedBySummary","nodes","failureSummary","help","helpUrl","hints"],"mappings":"uDACA,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,MAEhCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,MAEnDV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,EAOZ,SAASW,EAAOC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AgBnB,EAAK,GAAIA,EAAK,OAMjD,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,WACAzF,QAAQiF,EAAU4B,oBAEb5B,KAIT,IAAIA,GAAYF,GAAY7V,QC7fU8X,GAAU,SAASC,GAAgB,IAAIhN,EAAE,GAAG,IAAIA,EAAElR,QAAQA,QAAQ,MAAMgL,GAAGkG,EAAElR,QAAQ,SAASkR,EAAElG,GAAG,IAAIzC,EAAEyC,EAAEmT,eAAeC,EAAEpT,EAAES,eAAeH,EAAE+S,EAAEhd,UAAU,OAAOiK,EAAEgT,OAAO,SAAStT,GAAG,OAAOjJ,KAAKd,IAAI+J,WAAWA,EAAEjJ,KAAKuG,IAAIgD,EAAEhL,IAAI,SAAS0K,GAAG,OAAOjJ,KAAKd,IAAI+J,GAAGA,EAAEjJ,KAAKuG,QAAG,GAAQgD,EAAErK,IAAI,SAAS+J,GAAG,OAAOoT,EAAElc,KAAK8I,EAAEjJ,KAAKuG,IAAIgD,EAAEvK,IAAI,SAASiK,EAAEkG,GAAG,OAAO3I,EAAEyC,EAAEjJ,KAAKuG,EAAE,CAACiW,cAAa,EAAGvd,MAAMkQ,IAAInP,MAAMsc,EAAE,SAASA,EAAErT,GAAGzC,EAAExG,KAAK,I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AEA,EAAE66C,KAAEA,EAAIrkC,YAAEA,EAAWskC,QAAEA,GAAYL,EACrC79D,EAAQ,QAAQojB,MAAO66C,IAC7B,IAAK,MAAOD,EAAgBh3C,KAAa82C,EAAkB,CACzD,MAAMK,EAAQpB,GAAsBiB,GAEpCp7C,GAAY5iB,EAAOrO,GAAM,CAAE01B,QADX,OAAOuS,SAAmBukC,oBAAwBD,MAC9Bl3C,SAAAA"} \ No newline at end of file +{"version":3,"file":"respec-1edtech.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/1edtech.js","../src/core/location-hash.js","../src/core/defaults.js","../src/1edtech/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/1edtech/styles/1edtech-base.css.js","../src/1edtech/style.js","../src/1edtech/config.js","../src/1edtech/compute.js","../src/1edtech/utils.js","../src/1edtech/transclude.js","../src/core/github.js","../src/core/sections.js","../src/core/data-include.js","../src/1edtech/ajv-formats.js","../src/1edtech/templates/classDiagramTemplate.js","../src/1edtech/templates/templateUtils.js","../src/1edtech/templates/classTemplate.js","../src/1edtech/templates/dataModelTemplate.js","../src/1edtech/templates/enumerationTemplate.js","../src/1edtech/templates/interfaceTemplate.js","../src/1edtech/templates/jsonSchemaTemplate.js","../src/1edtech/templates/jsonSchemasTemplate.js","../src/1edtech/templates/openApiSchemaTemplate.js","../src/1edtech/templates/operationTemplate.js","../src/1edtech/templates/serviceModelTemplate.js","../src/1edtech/templates/stereoTypeTemplate.js","../src/1edtech/templates/embeddedSelectionTemplate.js","../src/1edtech/mps.js","../src/1edtech/privacy.js","../src/1edtech/translations/1edtech.js","../src/1edtech/templates/privacyImplicationsTemplate.js","../src/1edtech/templates/confidentialityLevelTemplate.js","../src/1edtech/post-markdown.js","../src/core/reindent.js","../src/1edtech/templates/headers.js","../src/1edtech/headers.js","../src/core/id-headers.js","../src/1edtech/abstract.js","../src/core/data-transform.js","../src/core/data-abbr.js","../src/1edtech/inlines.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/1edtech/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/1edtech/issues-notes.js","../src/core/best-practices.js","../src/core/figures.js","../src/1edtech/biblio.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/1edtech/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/styles/caniuse.css.js","../src/core/caniuse.js","../src/styles/mdn-annotation.css.js","../src/core/mdn-annotation.js","../src/1edtech/exporter.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/1edtech/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/dfn-panel.css.js","../src/core/dfn-panel.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/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/1edtech/cleanBody.js","../src/1edtech/title-attrs.js","../src/1edtech/scripts.js","../src/1edtech/comments.js","../src/1edtech/footers.js","../src/1edtech/templates/footers.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-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/core/linter-rules/privsec-section.js","../src/core/linter-rules/wpt-tests-exist.js","../src/core/linter-rules/no-http-props.js","../src/core/linter-rules/a11y.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\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 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 && /^/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 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(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 = /|$))/;\nconst html = edit('^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|\\\\n*|$)' // (4)\n + '|\\\\n*|$)' // (5)\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 + '|(?=[ \\\\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', ')|<(?: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', ')|<(?: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', ')|<(?: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]+? *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|\\\\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: /^ *\\[([^\\]]+)\\]: *]+)>?(?: +([\"(][^\\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]*?(?:(?=[\\\\\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 + '|^' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. \n + '|^' // declaration, e.g. \n + '|^') // 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]*?(?:(?=[\\\\ {\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 '
                    '\n                + (escaped ? code : escape$1(code, true))\n                + '
                    \\n';\n }\n return '
                    '\n            + (escaped ? code : escape$1(code, true))\n            + '
                    \\n';\n }\n blockquote(quote) {\n return `
                    \\n${quote}
                    \\n`;\n }\n html(html, block) {\n return html;\n }\n heading(text, level, raw) {\n // ignore IDs\n return `${text}\\n`;\n }\n hr() {\n return '
                    \\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 + '\\n';\n }\n listitem(text, task, checked) {\n return `
                  • ${text}
                  • \\n`;\n }\n checkbox(checked) {\n return '';\n }\n paragraph(text) {\n return `

                    ${text}

                    \\n`;\n }\n table(header, body) {\n if (body)\n body = `${body}`;\n return '\\n'\n + '\\n'\n + header\n + '\\n'\n + body\n + '
                    \\n';\n }\n tablerow(content) {\n return `\\n${content}\\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 + `\\n`;\n }\n /**\n * span level renderer\n */\n strong(text) {\n return `${text}`;\n }\n em(text) {\n return `${text}`;\n }\n codespan(text) {\n return `${text}`;\n }\n br() {\n return '
                    ';\n }\n del(text) {\n return `${text}`;\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 = '
                    ';\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 = `\"${text}\"`;\n 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 = '

                    An error occurred:

                    '\n                    + escape$1(e.message + '', true)\n                    + '
                    ';\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;ro;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b>>0;n\"+e+\"\",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=''+e+\"\",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

                    ',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+\">\"}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 {\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(/>} 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>} 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} 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 * `` 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}\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 `` 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 `` 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
                    ), 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 *

                    Int3.member

                    \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 Foo.Bar() 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 `
                    ` 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} */\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} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array} [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} walker\n * @return {IterableIterator}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map}\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[0]} message\n * @param {Parameters[1]} plugin\n * @param {Parameters[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[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``;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n \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} */\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 `
                    ${code}
                    `;\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(\"
                    \", `
                    `);\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      
                    \n \"${text}\"\n
                    ${title}
                    \n
                    \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 `${textContent}`;\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
                    \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} */\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} 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``;\nconst menu = html``;\nconst closeButton = html` ui.closeModal()}\n  title=\"Close\"\n>\n  ❌\n`;\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``;\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``;\n  button.addEventListener(\"click\", () => {\n    button.setAttribute(\"aria-expanded\", \"true\");\n    const ol = html`
                      `;\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``;\n const menuItem = html`
                    1. ${button}
                    2. `;\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`
                      `;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`\n ${closeButton}\n

                      ${title}

                      \n
                      ${content}
                      \n `;\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 ? `

                      (plugin: \"${err.plugin}\")

                      `\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `

                      How to fix: ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `

                      Occurred ${\n err.elements.length\n } times at:

                      \n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n
                      \\n${err.details}\\n
                      \\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/1edtech/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/1edtech/style.js\"),\n // Check configuration\n import(\"../src/1edtech/config.js\"),\n // Compute common values\n import(\"../src/1edtech/compute.js\"),\n // Process transcludes\n import(\"../src/1edtech/transclude.js\"),\n import(\"../src/core/github.js\"),\n import(\"../src/core/data-include.js\"),\n // Model Processing Service plugin\n import(\"../src/1edtech/mps.js\"),\n // Add the 1EdTech privacy appendix\n import(\"../src/1edtech/privacy.js\"),\n import(\"../src/core/markdown.js\"),\n import(\"../src/1edtech/post-markdown.js\"),\n import(\"../src/core/reindent.js\"),\n // import(\"../src/core/title.js\"),\n import(\"../src/1edtech/headers.js\"),\n import(\"../src/core/id-headers.js\"),\n import(\"../src/1edtech/abstract.js\"),\n import(\"../src/core/data-transform.js\"),\n import(\"../src/core/data-abbr.js\"),\n // Make sure markdown conformance section has an id\n import(\"../src/1edtech/inlines.js\"),\n import(\"../src/core/inlines.js\"),\n import(\"../src/1edtech/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 // Left in for legacy specs\n import(\"../src/1edtech/issues-notes.js\"),\n import(\"../src/core/best-practices.js\"),\n import(\"../src/core/figures.js\"),\n // Import 1EdTech biblio\n import(\"../src/1edtech/biblio.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/1edtech/contrib.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/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/1edtech/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/dfn-panel.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/custom-elements/index.js\"),\n // Clean up the document\n import(\"../src/1edtech/cleanBody.js\"),\n // Add title attributes to internal definition references\n import(\"../src/1edtech/title-attrs.js\"),\n // Insert 1EdTech stylesheet\n import(\"../src/1edtech/scripts.js\"),\n // Remove all comment nodes\n import(\"../src/1edtech/comments.js\"),\n // Add the 1EdTech footer\n import(\"../src/1edtech/footers.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-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/wpt-tests-exist.js\"),\n import(\"../src/core/linter-rules/no-http-props.js\"),\n import(\"../src/core/linter-rules/a11y.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 1EdTech specs\n */\nexport const name = \"1edtech/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst imsDefaults = {};\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...imsDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...imsDefaults,\n ...conf,\n lint,\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","/* 1EdTech styles and overrides */\nconst css = String.raw;\n\n// prettier-ignore\nexport default css`@charset \"UTF-8\";\n/* Base CSS for 1EdTech specifications. This builds on and in some cases\n * overrides the ReSpec and W3C/TR stylesheets:\n * - https://github.com/w3c/respec/assets/respec2.css\n * - https://www.w3.org/StyleSheets/TR/2016/base.css\n */\n@import url(https://fonts.googleapis.com/css?family=Roboto|Roboto+Condensed|Source+Code+Pro);\n/** variables ******************************************************************/\n:root {\n --fgclr1: rgba(0, 0, 0, 1);\n --fgclr2: rgba(0, 90, 156, 1);\n --fgclr3: rgba(70, 130, 180, 1);\n --fgclr4: rgba(40, 100, 150, 1);\n --gray: rgba(200, 200, 200, 0.9);\n --lightgray: rgba(240, 240, 240, 1);\n --lightestgray: rgba(250, 250, 250, 0.8);\n --darkgray: rgba(180, 180, 180, 1);\n}\n\n/** fonts **********************************************************************/\nbody {\n font-family: 'Roboto', Arial, Helvetica, sans-serif;\n}\n\npre, code, samp {\n font-family: 'Source Code Pro', monospace;\n}\n\n/** Header *********************************************************************/\nheader {\n border-bottom: 2px solid var(--gray);\n padding-bottom: 2em;\n}\n\n.header-top {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-flow: row nowrap;\n flex-flow: row nowrap;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n}\n\na#logo, a#ims-logo {\n text-decoration: none;\n border: 0;\n}\n\nh1.title {\n font-size: 200%;\n}\n\ndiv.subtitle {\n font-size: 150%;\n color: var(--fgclr2);\n}\n\n/* the copyright notice */\n#cpr {\n margin-bottom: 1.5em;\n margin-top: 2.5em;\n}\n\n#cpr p {\n margin-top: 0em;\n margin-bottom: 0em;\n}\n\n/* the vertical status bar top left */\n.statusPD {\n position: fixed;\n display: block;\n top: 0px;\n left: 0px;\n width: 300px;\n height: 30px;\n text-align: right;\n padding-top: 2px;\n padding-right: 2em;\n background-color: red;\n color: white;\n font-size: 20px;\n transform-origin: left top;\n transform: rotate(-90deg) translate(-100%, 0%);\n -ms-transform-origin: left top;\n -ms-transform: rotate(90deg);\n -webkit-transform-origin: left top;\n -webkit-transform: rotate(-90deg) translate(-100%, 0%);\n -moz-transform-origin: left top;\n -moz-transform: rotate(-90deg) translate(-100%, 0%);\n -o-transform-origin: left top;\n -o-transform: rotate(-90deg) translate(-100%, 0%);\n z-index: 12000;\n}\n\n.statusPD.final {\n background-color: blue;\n}\n\n/** Headings ******************************************************************/\nh1, h2, h3, h4, h5, h6, dt {\n page-break-after: avoid;\n page-break-inside: avoid;\n font: 100% sans-serif;\n font-family: inherit;\n line-height: 1.2;\n -webkit-hyphens: manual;\n -ms-hyphens: manual;\n hyphens: manual;\n}\n\nh2, h3, h4, h5, h6 {\n margin-top: 3rem;\n}\n\nh1, h2, h3, h4 {\n color: var(--fgclr4);\n background: transparent;\n}\n\nh1 {\n font-size: 170%;\n}\n\nh2 {\n font-size: 140%;\n}\n\nh3 {\n font-size: 120%;\n}\n\nh4 {\n font-weight: bold;\n}\n\nh5 {\n font-style: italic;\n}\n\nh6 {\n font-variant: small-caps;\n}\n\ndt {\n font-weight: bold;\n}\n\n/** Linkage ******************************************************************/\na[href].internalDFN {\n color: var(--fgclr1);\n text-decoration: none;\n border-bottom: 1px var(--fgclr2) dotted;\n}\n\na[href]:focus,\na[href]:hover {\n background: var(--lightgray);\n}\n\na[href]:active {\n color: #C00;\n border-color: #C00;\n}\n\n/** Examples *******************************************************************/\n.example {\n border: 1px solid var(--darkgray);\n counter-increment: example;\n}\n\n.example figcaption {\n background-color: var(--fgclr3);\n color: white;\n}\n\n/** Footer ******************************************************************/\nsection#revisionhistory table {\n margin-bottom: 3em;\n}\n\ndiv#endWarranty p {\n margin-top: 0.3em;\n margin-bottom: 0.3em;\n}\n\ndiv#endWarranty {\n margin-top: 6em;\n padding-top: 3em;\n border-top: 2px solid var(--gray);\n text-align: center;\n}\n\n/** tables *****************************************************************/\n/* The default table style has gray border, with th bgclr being light gray */\ntable {\n border-collapse: collapse;\n word-wrap: normal;\n overflow-wrap: normal;\n -webkit-hyphens: manual;\n -ms-hyphens: manual;\n hyphens: manual;\n width: 100%;\n margin-top: 1.5em;\n margin-bottom: 1.5em;\n max-width: 50em;\n border: 1px solid var(--gray);\n /*margin-left: 0em;*/\n}\n\ntd, th {\n padding-left: 1em;\n padding-right: 1em;\n padding-left: 1em;\n padding-right: 1em;\n text-align: left;\n text-align: start;\n vertical-align: top;\n border: 1px solid var(--gray);\n}\n\nth {\n font-weight: bold;\n background-color: var(--fgclr3);\n color: var(--lightgray);\n padding: 0.6em;\n}\n\ntd {\n padding: 0.8em;\n}\n\nth > * {\n padding: 0;\n margin: 0;\n}\n\n/* specific table styles */\ntable#version-table, table#no-cell-borders {\n border: 1px solid var(--gray);\n}\n\ntable#version-table td, table#no-cell-borders td {\n border: none;\n}\n\ntable#version-table td {\n padding: 0.2em;\n}\n\n/* For when values are extra-complex and need formatting for readability */\ntd.pre, td code {\n white-space: pre;\n overflow: scroll;\n}\n\n/** Index Tables *****************************************************/\n/* See also the data table styling section, which this effectively subclasses */\ntable.index {\n font-size: small;\n border-collapse: collapse;\n border-spacing: 0;\n text-align: left;\n margin: 1em 0;\n}\n\ntable.index td,\ntable.index th {\n padding: 0.4em;\n}\n\ntable.index tr:hover td:not([rowspan]),\ntable.index tr:hover th:not([rowspan]) {\n background: #f7f8f9;\n}\n\n/* The link in the first column in the property table (formerly a TD) */\ntable.index th:first-child a {\n font-weight: bold;\n}\n\n/** boxes *************************************************************/\n.alert {\n border: 2px solid red;\n padding: 0.3em;\n}\n\n/** inlines *************************************************************/\ndt > dfn {\n font-weight: bold;\n}\n\n/** \"Link here\" for section headings *****************************************/\na[href].hidden-reveal::before {\n content: \"›\";\n}\n\n/* w3c/respec change in how section headers are formed */\nh2 > a[href].self-link::before, h3 > a[href].self-link::before,\nh4 > a[href].self-link::before, h5 > a[href].self-link::before,\nh6 > a[href].self-link::before {\n content: \"›\";\n}\n\na[href].hidden-reveal, a[href].hidden-reveal:visited {\n text-decoration: none;\n border-bottom: none;\n}\n\n/** Admonitions for section headings *****************************************/\n.admonition {\n margin-top: 1em;\n margin-bottom: 1em;\n margin: 1em 0;\n border-left-width: .5em;\n border-left-style: solid;\n padding: 0.5em 1.2em 0.5em;\n position: relative;\n clear: both;\n}\n\n.admonition .admon-top {\n padding-right: 1em;\n min-width: 7.5em;\n color: #e05252;\n text-transform: uppercase;\n}\n\n.admonition .note-title, .admonition .ednote-title {\n color: #2b2;\n}\n\n.admonition .warning-title, .admonition .ednote-title {\n color: #f22;\n}\n\n.admonition.issue {\n border-color: #e05252;\n background: #fbe9e9;\n counter-increment: issue;\n overflow: auto;\n}\n\n.admonition.note, .admonition.ednote {\n border-color: #52e052;\n background: #e9fbe9;\n}\n\n.admonition > p:first-child {\n margin-top: 0;\n}\n\n.admonition.warning {\n border-color: #f11;\n border-width: .2em;\n border-style: solid;\n background: #fbe9e9;\n padding-top: 1em;\n}\n\n.admonition .warning-title:before {\n content: \"⚠\";\n /*U+26A0 WARNING SIGN*/\n font-size: 3em;\n float: left;\n height: 100%;\n padding-right: .3em;\n vertical-align: top;\n margin-top: -0.5em;\n}\n\n/******************************************************************************\n * Overrides to W3C/TR/2016/base.css *\n ******************************************************************************\n\n/******************************************************************************/\n/* Body */\n/******************************************************************************/\nbody {\n -webkit-hyphens: auto;\n -ms-hyphens: auto;\n hyphens: auto;\n /* Colors */\n color: var(--fgclr1);\n}\n\n/******************************************************************************/\n/* Images */\n/******************************************************************************/\nfigure, .figure, .sidefigure {\n text-align: left;\n}\n\n.figure img, .sidefigure img, figure img,\n.figure pre, .sidefigure pre, figure pre {\n display: unset;\n}\n\n.caption, figcaption, caption {\n display: block;\n padding: 0.5em 0 0.5em 0.5em;\n}\n`;\n","// @ts-check\n/**\n * Module 1edtech/style\n *\n * Inserts 1EdTech stylesheet and replaces w3c/style.\n *\n * The CSS documents are pulled from known locations so the spec documents\n * can be located anywhere. Overrides are available via respecConfig.\n *\n * CONFIGURATION\n *\n * - overrideCSSLocation: by default 1edtech-base.css will be loaded from\n * ./styles/1edtech-base.css.js.\n */\n\nimport { linkCSS, toKeyValuePairs } from \"../core/utils.js\";\nimport css from \"./styles/1edtech-base.css.js\";\n\nexport const name = \"1edtech/style\";\n\n/**\n * From w3c/style\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 attachMetaViewport() {\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 document.head.insertBefore(meta, document.head.firstChild);\n}\n\n/**\n * From w3c/style\n *\n * Ignores specStatus and always loads base.css.\n */\nfunction linkW3cCSS() {\n linkCSS(document, \"https://www.w3.org/StyleSheets/TR/2016/base.css\");\n}\n\n/**\n * @param {*} conf respecConfig\n */\nexport async function run(conf) {\n // From w3c/style\n attachMetaViewport();\n linkW3cCSS();\n\n // Link to 1EdTech stylesheet\n if (conf.overrideCSSLocation) {\n const cssURL = conf.overrideCSSLocation;\n linkCSS(document, cssURL);\n } else {\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\n }\n}\n","// @ts-check\n\n/**\n * check config and inform user if required ones are missing\n */\n\nimport { ISODate, showError } from \"../core/utils.js\";\n\nexport const name = \"1edtech/config\";\n\n/**\n * Returns true if value is not null or empty.\n *\n * @param { string } value\n */\nfunction check(value) {\n return value != undefined && value.trim().length > 0;\n}\n\n/**\n * @param {*} conf\n */\nexport async function run(conf) {\n if (!check(conf.specTitle)) {\n showError(\n \"head config must have the specTitle property set: \" +\n \"title of the document, excluding version\",\n name\n );\n conf.specTitle = \"@@@FIXME (conf.specTitle)\";\n }\n\n if (!check(conf.docVersion)) {\n showError(\n \"head config must have the docVersion property set, e.g. 'June 28, 2019'\",\n name\n );\n conf.docVersion = \"@@@FIXME (conf.docVersion)\";\n }\n\n if (!check(conf.specDate)) {\n if (conf.specStatus === \"Base Document\") {\n conf.specDate = ISODate.format(new Date());\n } else {\n showError(\n \"head config must have the specDate property set, e.g. 'June 28, 2019'\",\n name\n );\n conf.specDate = \"@@@FIXME(conf.specDate)\";\n }\n }\n\n if (!check(conf.specNature)) {\n showError(\n \"head config must have the specNature property set: one of 'normative' or 'informative'\",\n name\n );\n conf.specNature = \"informative\";\n }\n\n if (!check(conf.specType)) {\n showError(\n \"head config must have the specType property set: One of 'spec', 'cert', 'impl', 'errata', 'doc' \",\n name\n );\n conf.specType = \"spec\";\n }\n\n if (conf.specType === \"doc\" || conf.specType === \"proposal\") {\n return;\n }\n\n if (!check(conf.shortName)) {\n showError(\n \"head config must have the shortName property set: \" +\n \"list at urls-names.md#shortnames\",\n name\n );\n conf.shortName = \"FIXME\";\n }\n\n if (!check(conf.specStatus)) {\n showError(\n \"head config must have the specStatus property set to \" +\n \"one of 'Base Document', 'Candidate Final', Candidate Final Public', \" +\n \"or 'Final Release'\",\n name\n );\n conf.specStatus = \"@@@FIXME(conf.specStatus)\";\n }\n\n const statusValues = [\n \"Base Document\",\n \"Candidate Final\",\n \"Candidate Final Public\",\n \"Final Release\",\n \"Proposal\",\n ];\n if (statusValues.indexOf(conf.specStatus) == -1) {\n showError(\n \"head config must have the specStatus property set to \" +\n \"one of 'Base Document', 'Candidate Final', 'Candidate Final Public', \" +\n \"'Final Release', or 'Proposal'\",\n name\n );\n }\n\n if (!check(conf.specVersion)) {\n showError(\n \"head config must have the specVersion property set, e.g. '1.1'\",\n name\n );\n conf.specVersion = \"@@@FIXME(conf.specVersion)\";\n }\n}\n","// @ts-check\n\nexport const name = \"1edtech/compute\";\n\n/**\n * Compute misc variables used by multiple other modules and store them back in conf.\n *\n * @param {*} conf\n */\nexport async function run(conf) {\n const base = `https://www.imsglobal.org/spec/${conf.shortName}/`;\n\n // v1p2-style reformat for use in path segments\n conf.versionURL = `v${conf.specVersion}`.replace(\".\", \"p\");\n\n conf.thisURL = `${base}${conf.versionURL}/`;\n\n conf.errataURL = `${conf.thisURL}errata/`;\n\n if (conf.specType !== \"spec\") {\n conf.thisURL = `${conf.thisURL}${conf.specType}/`;\n }\n\n conf.latestURI = `${base}latest/`;\n if (conf.specType !== \"spec\") {\n conf.latestURI = `${conf.latestURI}${conf.specType}/`;\n }\n\n // needed for aux docs that need to point back to main spec\n conf.mainSpecURL = `${base}${conf.versionURL}/`;\n}\n","// @ts-check\nexport const name = \"1edtech/utils\";\n\n/**\n * Returns the first Element in the string.\n *\n * @param { string } string the HTML string to convert\n * @returns { Element } the first element in the string\n */\nexport function toHTMLElement(string) {\n const node = toHTMLNode(string);\n return node.parentElement.firstElementChild;\n}\n\nexport function toHTMLNodes(string) {\n const element = document.createElement(\"div\");\n element.innerHTML = string;\n return element.childNodes;\n}\n\nexport function toHTMLNode(string) {\n const element = document.createElement(\"div\");\n element.innerHTML = string;\n return element.childNodes[0];\n}\n","// @ts-check\n\nimport { pub } from \"../core/pubsubhub.js\";\nimport { toHTMLNodes } from \"./utils.js\";\n\nexport const name = \"1edtech/transclude\";\n\nexport async function run() {\n /*\n Filesystem transclusion is done using script elements with a class \n of 'transclude'. If the script element has a data-id attribute equal to the \n name of a string variable in global scope, then the script element is \n replaced with HTML nodes corresponding to the given variable. \n \n Each script element can declare zero, one or several string variables. In\n other words, it is possible to have one script which \n declares all transclude variables, and then src-less script elements which\n then only declares where the content should be inserted. It is equally ok\n to have each occurence of the script element in the body to bring in its own \n content via its own src. \n \n Note the use of template literals to allow easy authoring and maintenance\n of multi-line strings in the js files referenced. \n */\n\n let transclude = document.querySelector(\"script.transclude\");\n\n while (transclude !== null) {\n if (!transclude.hasAttribute(\"data-id\")) {\n pub(\"error\", \"transclude script element without data-id attribute\");\n break;\n }\n\n const str = window[transclude.getAttribute(\"data-id\")];\n\n if (str === undefined || typeof str !== \"string\") {\n pub(\n \"error\",\n `no transclude variable named '${str}' found in global scope`\n );\n break;\n }\n\n const newNodes = toHTMLNodes(str);\n\n for (let k = 0; k < newNodes.length; k++) {\n const clone = newNodes[k].cloneNode(true);\n transclude.parentNode.insertBefore(clone, transclude);\n }\n\n transclude.parentNode.removeChild(transclude);\n\n // Get the next transclude\n\n transclude = document.querySelector(\"script.transclude\");\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","/**\n * Module core/sections\n *\n * Adds
                      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} */\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","/**\n * Add formats to ajv validator. These are the formats used by 1EdTech modeling tools.\n *\n * @param {Object} ajv Instance of ajv\n */\nexport function addFormats(ajv) {\n // number formats\n ajv.addFormat(\"byte\", validateInt32);\n ajv.addFormat(\"double\", validateNumber);\n ajv.addFormat(\"float\", validateNumber);\n ajv.addFormat(\"int32\", validateInt32);\n ajv.addFormat(\"int64\", validateInt64);\n // string formats\n ajv.addFormat(\"date\", /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/);\n ajv.addFormat(\n \"date-time\",\n /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i\n );\n ajv.addFormat(\n \"uri\",\n /^(?:[a-z][a-z0-9+\\-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\-._~!$&'\"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\\-._~!$&'\"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i\n );\n ajv.addFormat(\n \"uuid\",\n /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i\n );\n}\n\nconst MIN_INT32 = -(2 ** 31);\nconst MAX_INT32 = 2 ** 31 - 1;\n\nfunction validateInt32(value) {\n return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;\n}\n\nfunction validateInt64(value) {\n return Number.isInteger(value);\n}\n\nfunction validateNumber() {\n return true;\n}\n","// @ts-check\nimport { html, mermaidModule } from \"../../core/import-maps.js\";\n\n/**\n * Render the Class diagram of an MPS Model / Package object.\n * @param {*} diagram The Class diagram in markdown format.\n * @param {string?} title The preferred title for this section.\n * @returns {Promise} An array of HTML elements.\n */\nexport default async (index, diagram, title) => {\n // dinamycally import mermaid to avoid increase of size of the library\n const { default: mermaid } = await import(mermaidModule);\n mermaid.initialize({ startOnLoad: false });\n const { svg } = await mermaid.render(`class-diagram-${index}`, diagram);\n const cleanedSvg = svg.trim().replace(/height=\"[0-9]*\"/, \"\");\n return html`

                      ${title}

                      \n ${cleanedSvg}`;\n};\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render a MPS issue as a Respec issue.\n * @param {String} issue A MPS issue (\"q:\" in a .lines file).\n * @returns The issue wrapped in a div with class=\"issue\".\n */\nexport function renderIssue(issue) {\n return html`
                      `;\n}\n\n/**\n * Render a MPS note as a Respec note.\n * @param {String} note A MPS note (\"n:\" in a .lines file).\n * @returns The note wrapped in a div with class=\"note\".\n */\nexport function renderNote(note) {\n return html`
                      ${note}
                      `;\n}\n\n/**\n * Render a MPS privacy doc as a Respec note.\n * @param {*} config The ReSpec config object.\n * @param {String} doc A MPS privacy doc (\"pd:\" in a .lines file).\n * @returns The doc wrapped in a div with class=\"note\".\n */\nexport function renderPrivacyImplicationDoc(config, doc) {\n if (config.showPrivacyAnnotations && doc) {\n return html`
                      Privacy implication: ${doc}
                      `;\n }\n}\n/**\n * Render a term as HTML.\n * @param {*} term A MPS model for a property representing an enumeration\n * or vocabulary term.\n * @returns A table row with information about the term.\n */\nexport function renderTerm(term) {\n const id = `${term.parentClass.name}.${term.name}`.toLowerCase();\n return html`\n ${term.name}\n \n ${term.documentation.description}\n ${term.documentation.issues.map(renderIssue)}\n ${term.documentation.notes.map(renderNote)}\n \n `;\n}\n\n/**\n * Return a clickable link to the type definition.\n * @param {*} type The MPS ModelClass object.\n * @returns {HTMLAnchorElement} Returns an anchor element that links to the property type definition.\n */\nexport function renderType(type) {\n let name = type.name;\n if (\n type.stereoType === \"Enumeration\" ||\n type.stereoType === \"EnumExt\"\n ) {\n name += \" Enumeration\";\n }\n name = html`${name}`;\n return name;\n}\n","// @ts-check\nimport {\n renderIssue,\n renderNote,\n renderPrivacyImplicationDoc,\n renderType\n} from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the header, description, notes, and issues, and properties of an MPS Class object.\n * @param {*} config The ReSpec config object.\n * @param {*} classData The Class object.\n * @param {string?} title The preferred title for this section.\n * @returns {HTMLElement[]} An array of HTML elements.\n */\nexport default (config, classData, title) => {\n if (classData && classData.properties) {\n title = title ?? `${classData.name}`;\n return html`

                      ${title}

                      \n

                      ${classData.documentation.description}

                      \n ${classData.documentation.issues.map(renderIssue)}\n ${classData.documentation.notes.map(renderNote)}\n \n \n \n \n \n \n \n ${config.showPrivacyAnnotations ? html`` : null}\n \n \n \n ${classData.properties.map(prop => renderProperty(config, prop))}\n ${renderExtensibility(config, classData)}\n \n
                      PropertyTypeDescriptionMultiplicityPrivacy
                      `;\n }\n};\n\n/**\n * Render text that indicates the class is extensible.\n * @param {*} config The ReSpec config object.\n * @param {*} classData The MPS Class object.\n * @returns {HTMLTableRowElement?} A table row that can be appended to the properties table.\n */\nfunction renderExtensibility(config, classData) {\n if (classData.isExtensible) {\n return html` \n \n This class can be extended with additional properties.\n \n `;\n } else {\n return html``;\n }\n}\n\n/**\n * Render property information.\n * @param {*} config The ReSpec config object.\n * @param {*} property The MPS Property object.\n * @returns {HTMLTableRowElement?} A table row with property information.\n */\nfunction renderProperty(config, property) {\n return html` \n ${property.name}\n ${renderType(property.type)}\n \n ${property.documentation.description}\n ${property.documentation.issues.map(renderIssue)}\n ${property.documentation.notes.map(renderNote)}\n ${renderPrivacyImplicationDoc(config, property.documentation.privacyDoc)}\n \n ${renderCardinality(property)}\n ${config.showPrivacyAnnotations\n ? renderPrivacyImplicationCell(property)\n : null}\n `;\n}\n\n/**\n * Return a string describing whether a property is required or not.\n * @param {*} property The MPS Property object.\n * @returns {string} A string describing whether a property is required or not.\n */\nfunction renderCardinality(property) {\n switch (property.cardinality.value) {\n case \"ONE\":\n return \"[1]\";\n case \"ZERO_OR_ONE\":\n return \"[0..1]\";\n case \"ZERO_OR_MANY\":\n return \"[0..*]\";\n case \"ONE_OR_MANY\":\n return \"[1..*]\";\n case \"TWO\":\n return \"[2]\";\n default:\n break;\n }\n}\n\n/**\n * Return a table cell with a string describing the privacy implications of a property.\n * @param {*} property The MPS Property object.\n * @returns {HTMLTableCellElement} A table cell with a string describing the privacy implications of a property.\n */\nfunction renderPrivacyImplicationCell(property) {\n return html`\n \n ${renderPrivacyImplication(property)}\n \n `;\n}\n\n/**\n * Return a string describing the privacy implications of a property.\n * @param {*} property The MPS Property object.\n * @returns {string} A string describing the privacy implications of a property.\n */\nfunction renderPrivacyImplication(property) {\n return html`${property.privacyImplications.label}`;\n}\n","// @ts-check\nimport { renderIssue, renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the header, notes, and issues for a MPS Model. This template\n * is used when the Model includes MPS DataModels.\n * @param {*} dataModel The MPS Model.\n * @param {string?} title The preferred title for this section.\n * @param {string?} id The unique header id to use so a model can appear in multiple sections.\n * @returns {HTMLElement[]} An array of HTML elements.\n */\nexport default (dataModel, title, id) => {\n if (dataModel) {\n title = title ?? `${dataModel.name} Data Model`;\n id = (id ?? dataModel.id).replace(/\\./g, \"-\");\n return html`

                      ${title}

                      \n ${dataModel.documentation.issues.map(renderIssue)}\n ${dataModel.documentation.notes.map(renderNote)}`;\n }\n};\n","// @ts-check\nimport { renderIssue, renderNote, renderTerm } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render an Enumeration, ExtEnum, or Vocabulary class.\n * @param {*} classData The MPS Class object.\n * @param {string?} title The preferred title.\n * @returns {HTMLElement[]} The entire section contents.\n */\nexport default (classData, title) => {\n if (classData && classData.properties) {\n const suffix =\n classData.stereoType === \"Vocabulary\" ? \"Vocabulary\" : \"Enumeration\";\n title = title ?? `${classData.name} ${suffix}`;\n return html`

                      ${title}

                      \n

                      ${classData.documentation.description}

                      \n ${classData.documentation.issues.map(renderIssue)}\n ${classData.documentation.notes.map(renderNote)}\n \n \n \n \n \n \n \n \n ${classData.properties.map(renderTerm)}\n ${classData.stereoType === \"EnumExt\"\n ? html`\n \n `\n : html``}\n \n
                      TermDescription
                      \n This enumeration can be extended with new, proprietary terms.\n The new terms must start with the substring 'ext:'.\n
                      `;\n }\n};\n","// @ts-check\nimport { renderIssue, renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the header, description, notes, and issues for a MPS RestInterface object.\n * @param {*} serviceInterface The RestInterface object.\n * @param {string?} title Optional title for the section. By default it will be the operation name.\n * @param {string?} headerId The preferred header id.\n * @returns {HTMLElement[]} The rendered content.\n */\nexport default (serviceInterface, title, headerId) => {\n if (serviceInterface && serviceInterface.operations) {\n title = title ?? `${serviceInterface.name}`;\n headerId = (headerId ?? serviceInterface.id).replace(/\\./g, \"-\");\n return html`

                      ${title}

                      \n

                      ${serviceInterface.documentation?.description}

                      \n ${serviceInterface.documentation?.issues.map(renderIssue)}\n ${serviceInterface.documentation?.notes.map(renderNote)}`;\n }\n};\n","// @ts-check\nimport { renderIssue, renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the JSON Schema of an MPS Class object.\n * @param {*} classData The Class object.\n * @param {*} schema The Class' JSON Schema.\n * @param {string?} title The preferred title for this section.\n * @returns {HTMLElement[]} An array of HTML elements.\n */\nexport default (classData, schema, title) => {\n if (classData) {\n title = title ?? `${classData.name}`;\n return html`

                      ${title}

                      \n

                      ${classData.documentation.description}

                      \n ${classData.documentation.issues.map(renderIssue)}\n ${classData.documentation.notes.map(renderNote)}\n
                      ${JSON.stringify(schema, null, 2)}
                      `;\n }\n};\n","// @ts-check\nimport { renderIssue, renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the header, notes, and issues for a MPS Model. This template\n * is used when the section contains JSON Schemas.\n * @param {*} dataModel The MPS Model.\n * @param {string?} title The preferred title for this section.\n * @param {string?} id The unique header id to use so a model can appear in multiple sections.\n * @returns {HTMLElement[]} An array of HTML elements.\n */\nexport default (dataModel, title, id) => {\n if (dataModel) {\n title = title ?? `${dataModel.name} JSON Schema`;\n id = (id ?? dataModel.id).replace(/\\./g, \"-\");\n return html`

                      ${title}

                      \n ${dataModel.documentation.issues.map(renderIssue)}\n ${dataModel.documentation.notes.map(renderNote)}`;\n }\n};\n","// @ts-check\nimport { renderIssue, renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the OpenAPI Schema of an MPS Model object.\n * @param {*} modelData The Model object.\n * @param {*} schema The Model's OpenAPI Schema (YAML or JSON).\n * @param {string?} title The preferred title for this section.\n * @returns {HTMLElement[]} An array of HTML elements.\n */\nexport default (modelData, schema, title) => {\n if (modelData) {\n title = title ?? `${modelData.name}`;\n return html`

                      ${title}

                      \n

                      ${modelData.documentation.description}

                      \n ${modelData.documentation.issues.map(renderIssue)}\n ${modelData.documentation.notes.map(renderNote)}\n
                      ${schema}
                      `;\n }\n};\n","// @ts-check\nimport { renderIssue, renderNote as renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the header, description, notes, and issues for a MPS RestOperation object.\n * @param {*} config The ReSpec config object.\n * @param {string} rootPath The root path for the service definition. For example, \"ims/clr/v2p0\".\n * @param {*} operation The RestOperation object from MPS.\n * @param {string?} title Optional title for the section. By default it will be the operation name.\n * @returns {HTMLElement[]} Information about the operation.\n */\nexport default (config, rootPath, operation, title) => {\n if (operation) {\n title = title ?? `${operation.name}`;\n return html`

                      ${title}

                      \n

                      ${operation.documentation.description}

                      \n ${operation.documentation.issues.map(renderIssue)}\n ${operation.documentation.notes.map(renderNote)}\n ${renderRequest(config, rootPath, operation)}\n ${renderResponses(config, operation)}`;\n }\n};\n\n/**\n * Render the operation request.\n * @param {*} config The ReSpec config object.\n * @param {string} rootPath The root path for the service definition. For example, \"ims/clr/v2p0\".\n * @param {*} operation The operation object from CDM/MPS.\n * @returns {HTMLElement[]} The rendered request as HTML elements.\n */\nfunction renderRequest(config, rootPath, operation) {\n return html`
                      Request
                      \n ${renderUrl(rootPath, operation)}\n ${renderRequestParameters(config, operation)}\n ${renderRequestBodies(config, operation)}`;\n}\n\n/**\n * Render the request URL.\n * @param {string} rootPath The root path for the service definition. For example, \"ims/clr/v2p0\".\n * @param {*} operation The operation object from CDM/MPS.\n * @returns {HTMLParagraphElement} The rendered URL.\n */\nfunction renderUrl(rootPath, operation) {\n let url = `${operation.method} ${rootPath}${operation.request.path}`;\n const queryParameters = operation.request.parameters.filter(\n parameter => parameter.type === \"QUERY\"\n );\n if (queryParameters) {\n for (let index = 0; index < queryParameters.length; index++) {\n const parameter = queryParameters[index];\n url += index == 0 ? \"?\" : \"&\";\n url += `${parameter.name}={${parameter.name}}`;\n }\n }\n return html`

                      ${url}

                      `;\n}\n\n/**\n * Render the operation request parameters.\n * @param {*} config The ReSpec config object.\n * @param {*} operation The operation object from CDM/MPS.\n * @returns {HTMLTableElement} A table of information about the request parameters.\n */\nfunction renderRequestParameters(config, operation) {\n if (Array.from(operation.request.parameters).length > 0) {\n return html`\n \n \n \n \n \n \n \n \n ${config.showPrivacyAnnotations\n ? html``\n : null}\n \n \n \n ${operation.request.parameters.map(param =>\n renderParameter(config, param)\n )}\n \n
                      \n Request header, path, and query parameters\n
                      ParameterParameter TypeDescriptionRequiredConfidentiality Level
                      \n `;\n }\n}\n\n/**\n * Render the operation request bodies (if any).\n * @param {*} config The ReSpec config object.\n * @param {*} operation The operation object from CDM/MPS.\n * @returns {HTMLTableElement} A table of information about the request bodies.\n */\nfunction renderRequestBodies(config, operation) {\n if (Array.from(operation.request.bodies).length > 0) {\n return html`\n \n \n \n \n \n \n \n \n ${config.showPrivacyAnnotations\n ? html``\n : null}\n \n \n \n ${operation.request.bodies.map(body =>\n renderRequestBody(config, body)\n )}\n \n
                      \n Allowed request content types\n
                      Content-Type HeaderContent TypeContent DescriptionContent RequiredConfidentiality Level
                      \n `;\n }\n}\n\n/**\n * Render a single request body.\n * @param {*} config The ReSpec config object.\n * @param {*} body The body object from CDM/MPS.\n * @returns {HTMLTableRowElement} A table row with information about the request body.\n */\nfunction renderRequestBody(config, body) {\n return html`\n ${body.contentType}\n ${renderBodyType(body)}\n \n ${body.documentation?.description}\n ${body.documentation?.issues.map(renderIssue)}\n ${body.documentation?.notes.map(renderNote)}\n \n ${renderRequired(body)}\n ${config.showPrivacyAnnotations ? renderConfidentialityCell(body) : null}\n `;\n}\n\nfunction renderParameter(config, parameter) {\n return html` \n \n ${parameter.name}\n
                      (${parameter.type.toLowerCase()})
                      \n \n ${renderParmeterType(parameter)}\n \n ${parameter.documentation.description}\n ${parameter.documentation.issues.map(renderIssue)}\n ${parameter.documentation.notes.map(renderNote)}\n \n ${renderRequired(parameter)}\n ${config.showPrivacyAnnotations\n ? renderConfidentialityCell(parameter)\n : null}\n `;\n}\n\nfunction renderResponses(config, operation) {\n const responses = operation.responses.flatMap(mergeResponseBodies);\n return html`
                      Responses
                      \n \n \n \n \n \n \n \n \n \n ${config.showPrivacyAnnotations\n ? html``\n : null}\n \n \n \n ${responses.map(resp => renderResponse(config, resp))}\n \n
                      \n Allowed response codes and content types\n
                      Status CodeContent-Type HeaderContent TypeContent DescriptionContent RequiredConfidentiality Level
                      `;\n}\n\nfunction renderResponse(config, response) {\n return html`\n ${response.statusCode}\n ${response.body?.contentType}\n ${renderBodyType(response.body)}\n \n ${response.documentation?.description}\n ${response.body?.documentation?.description}\n ${response.body?.documentation?.issues.map(renderIssue)}\n ${response.body?.documentation?.notes.map(renderNote)}\n \n ${renderRequired(response.body)}\n ${config.showPrivacyAnnotations\n ? renderConfidentialityCell(response.body)\n : null}\n `;\n}\n\nfunction mergeResponseBodies(response) {\n const bodies = Array.from(response.bodies);\n if (bodies.length == 0) {\n return response;\n } else {\n const mergedResponses = new Array();\n for (let index = 0; index < bodies.length; index++) {\n const body = bodies[index];\n mergedResponses.push({\n ...response,\n body,\n });\n }\n return mergedResponses;\n }\n}\n\nfunction renderRequired(value) {\n if (value?.cardinality)\n return value.cardinality.value.includes(\"ZERO\") ? \"Optional\" : \"Required\";\n}\n\n/**\n * Return a table cell with a string describing the privacy implications of a property.\n * @param {*} value The value object from CDM/MPS.\n * @returns {HTMLTableCellElement} A table cell with a string describing the privacy implications of a property.\n */\nfunction renderConfidentialityCell(value) {\n if (value?.confidentiality) {\n return html`\n \n ${renderConfidentiality(value)}\n \n `;\n }\n}\nfunction renderConfidentiality(value) {\n if (value?.confidentiality) {\n return value.confidentiality.label;\n }\n}\n\nfunction renderParmeterType(parameter) {\n let name = parameter.value.name;\n if (parameter.cardinality.value.includes(\"MANY\")) {\n name += \"[]\";\n }\n if (\n parameter.value.stereoType === \"Enumeration\" ||\n parameter.value.stereoType === \"EnumExt\"\n ) {\n name += \" Enumeration\";\n }\n name = html`${name}`;\n return name;\n}\n\nfunction renderBodyType(body) {\n if (body?.type) {\n let name = body.type.name;\n if (body.cardinality.value.includes(\"MANY\")) {\n name += \"[]\";\n }\n if (\n body.type.stereoType === \"Enumeration\" ||\n body.type.stereoType === \"EnumExt\"\n ) {\n name += \" Enumeration\";\n }\n name = html`${name}`;\n return name;\n }\n}\n","// @ts-check\nimport { renderIssue, renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render the header, description, notes, and issues for a MPS RestService object.\n * @param {*} serviceModel The ServiceModel object.\n * @param {string?} title The preferred title for this section.\n * @param {string?} headerId The unique header id to use so a data model can appear in multiple sections.\n * @returns {HTMLElement[]} An array of HTML elements.\n */\nexport default (serviceModel, title, headerId) => {\n if (serviceModel) {\n title = title ?? `${serviceModel.name} Service Model`;\n headerId = (headerId ?? serviceModel.id).replace(/\\./g, \"-\");\n return html`

                      ${title}

                      \n ${serviceModel.documentation.issues.map(renderIssue)}\n ${serviceModel.documentation.notes.map(renderNote)}`;\n }\n};\n","// @ts-check\nimport { renderIssue, renderNote } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render a table of types with the same stereotype.\n * @param {*} dataModel An array of Derived or Primitive types.\n * @param {*} stereoType The MPS StereoType to list. For example, DerivedType or PrimitiveType.\n * @returns {HTMLElement[]} An array of HTML elements.\n */\nexport default (dataModel, stereoType) => {\n const types = dataModel.classes\n .filter(classData => classData.stereoType === stereoType)\n .sort((a, b) => {\n const nameA = a.name.toUpperCase();\n const nameB = b.name.toUpperCase();\n if (nameA < nameB) {\n return -1;\n }\n if (nameA > nameB) {\n return 1;\n }\n return 0;\n });\n if (types.length > 0) {\n return html` \n \n \n \n \n \n \n \n ${types.map(renderType)}\n \n
                      TypeDescription
                      `;\n }\n};\n\n/**\n * Render type information.\n * @param {*} type The MPS Class object for a DerivedType or PrimitiveType.\n * @returns {HTMLTableRowElement?} A table row with property information.\n */\nfunction renderType(type) {\n return html` \n ${type.name}\n \n ${type.documentation.description}\n ${type.documentation.issues.map(renderIssue)}\n ${type.documentation.notes.map(renderNote)}\n \n `;\n}\n","// @ts-check\nimport { renderIssue, renderNote, renderType } from \"./templateUtils.js\";\nimport { html } from \"../../core/import-maps.js\";\n\n/**\n * Render an EmbeddedSelection class.\n * @param {*} classData The MPS Class object.\n * @param {string?} title The preferred title.\n * @returns {HTMLElement[]} The entire section contents.\n */\nexport default (classData, title) => {\n if (classData && classData.generalizations) {\n title = title ?? `${classData.name}`;\n return html`

                      ${title}

                      \n

                      ${classData.documentation.description}

                      \n ${classData.documentation.issues.map(renderIssue)}\n ${classData.documentation.notes.map(renderNote)}\n

                      The ultimate representation of this class is a choice of exactly one of the classes in the following set:

                      \n \n \n \n \n \n \n \n \n ${classData.generalizations.map(renderSuperClass)}\n \n
                      TypeDescription
                      `;\n }\n};\n\n/**\n * Render superclass information.\n * @param {*} cls The MPS ModelClass object.\n * @returns {HTMLTableRowElement?} A table row with property information.\n */\nfunction renderSuperClass(cls) {\n return html` \n ${renderType(cls)}\n \n ${cls.documentation.description}\n ${cls.documentation.issues.map(renderIssue)}\n ${cls.documentation.notes.map(renderNote)}\n \n `;\n}\n","// @ts-nocheck\n\n/**\n * Module 1edtech/mps\n * Handles the optional Model Processing Service.\n */\nimport { addFormats } from \"./ajv-formats.js\";\nimport classDiagramTemplate from \"./templates/classDiagramTemplate.js\";\nimport classTemplate from \"./templates/classTemplate.js\";\nimport dataModelTemplate from \"./templates/dataModelTemplate.js\";\nimport enumerationTemplate from \"./templates/enumerationTemplate.js\";\nimport { html } from \"../core/import-maps.js\";\nimport interfaceTemplate from \"./templates/interfaceTemplate.js\";\nimport jsonSchemaTemplate from \"./templates/jsonSchemaTemplate.js\";\nimport jsonSchemasTemplate from \"./templates/jsonSchemasTemplate.js\";\nimport openApiSchemaTemplate from \"./templates/openApiSchemaTemplate.js\";\nimport operationTemplate from \"./templates/operationTemplate.js\";\nimport serviceModelTemplate from \"./templates/serviceModelTemplate.js\";\nimport { showError } from \"../core/utils.js\";\nimport stereoTypeTemplate from \"./templates/stereoTypeTemplate.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nimport embeddedSelectionTemplate from \"./templates/embeddedSelectionTemplate.js\";\n\nexport const name = \"1edtech/mps\";\n\n/**\n * Get the MPS API KEY from the configuration.\n *\n * @param {object} config The respecConfig\n * @returns {string} The MPS API KEY.\n */\nfunction getApiKey(config) {\n if (config.mps.apiKey) {\n return config.mps.apiKey;\n }\n throw \"No MPS API KEY found\";\n}\n\n/**\n * Get the MPS server URL from the configuration.\n *\n * @param {object} config The respecConfig\n * @returns {string} The MPS server URL.\n */\nfunction getBaseUrl(config) {\n if (config.mps.serverUrl) {\n return config.mps.serverUrl;\n }\n throw \"No MPS server URL found\";\n}\n\n/**\n * Async function that returns a sample JSON object for a single MPS Class.\n *\n * @param {object} config The respecConfig.\n * @param {string} id MPS Class id.\n * @param {boolean} includeOptionalFields True if the sample should include all optional fields (the default is false).\n * @returns {object} The sample JSON object.\n */\nasync function getDataSample(config, id, includeOptionalFields = false) {\n try {\n const res = await fetch(\n `${getBaseUrl(\n config\n )}/sample/${id}?includeOptionalFields=${includeOptionalFields}`,\n {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Api-Key\": getApiKey(config),\n },\n }\n );\n if (!res.ok) {\n showError(`Could not get sampledata for ${id}: ${res.status}`, name);\n return null;\n }\n const data = await res.json();\n return data;\n } catch (error) {\n showError(`Could not get sample data for ${id}: ${error}`, name);\n return null;\n }\n}\n\n/**\n * Async function that returns the JSON Schema for an MPS Class.\n *\n * @param {object} config The respecConfig.\n * @param {string} id MPS Class id.\n * @param {boolean} allowAdditionalProperties If true or omitted, the generated schema will reflect the MPS model. If false, the generated schema will never allow additional properties. Use false to check examples for typos.\n * @returns {object} The JSON Schema object.\n */\nasync function getJsonSchema(config, id, allowAdditionalProperties = true) {\n try {\n const res = await fetch(\n `${getBaseUrl(\n config\n )}/jsonschema/${id}?allowAdditionalProperties=${allowAdditionalProperties}`,\n {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Api-Key\": getApiKey(config),\n },\n }\n );\n if (!res.ok) {\n showError(`Could not get the schema for ${id}: ${res.status}`, name);\n return null;\n }\n const data = await res.json();\n return data;\n } catch (error) {\n showError(`Could not get the schema for ${id}: ${error}`, name);\n return null;\n }\n}\n\n// execute the API to retrieve the MPS class diagram (/classdiagram/{id})\nasync function getClassDiagram(\n config,\n id,\n omitProperties = false,\n hideTitle = false,\n title = null,\n packages = null,\n classes = null\n) {\n try {\n // create a query string from all the parameters\n let query = `?omitProperties=${omitProperties}&hideTitle=${hideTitle}`;\n if (title) query += `&title=${title}`;\n if (packages) query += `&packageNames=${packages}`;\n if (classes) query += `&classNames=${classes}`;\n\n // execute the API call\n const res = await fetch(\n `${getBaseUrl(config)}/classdiagram/${id}${query}`,\n {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"text/markdown\",\n \"X-Api-Key\": getApiKey(config),\n },\n }\n );\n if (!res.ok) {\n showError(\n `Could not get the class diagram for ${id}: ${res.status}`,\n name\n );\n return null;\n }\n const data = await res.text();\n return data;\n } catch (error) {\n showError(`Could not get the class diagram for ${id}: ${error}`, name);\n return null;\n }\n}\n\n/**\n * Execute the API call to retrieve MPS Model Classes and Services.\n *\n * @param {object} config The respecConfig.\n * @param {string} source The source (CORE or SANDBOX) of the Model.\n * @param {string} id The id of the MPS Model to retrieve.\n * @returns {object} The model as an object.\n */\nasync function getModel(config, source, id) {\n const key = `${source}-${id}`;\n const json = sessionStorage.getItem(key);\n if (json) return JSON.parse(json);\n const query = JSON.stringify({\n query: `\n {\n modelByID(id: \"${id}\", source: ${source ?? \"CORE\"}) {\n id\n id\n name\n documentation {\n description\n notes\n issues\n }\n classes {\n id\n name\n stereoType\n documentation {\n description\n notes\n issues\n packageName\n }\n properties {\n name\n type {\n id\n name\n stereoType\n }\n cardinality {\n value\n }\n documentation {\n description\n notes\n issues\n privacyDoc\n }\n privacyImplications {\n label\n value\n }\n parentClass {\n id\n name\n }\n\n }\n isExtensible\n generalizations {\n id\n name\n documentation {\n description\n notes\n issues\n }\n }\n }\n services {\n ... on RestService {\n id\n type\n documentation {\n description\n notes\n issues\n }\n rootPath\n interfaces {\n id\n name\n documentation {\n description\n notes\n issues\n }\n operations {\n id\n name\n documentation {\n description\n notes\n issues\n }\n method\n request {\n id\n documentation {\n description\n notes\n issues\n }\n path\n bodies {\n documentation {\n description\n notes\n issues\n }\n type {\n id\n name\n }\n cardinality {\n value\n }\n confidentiality {\n label\n value\n }\n contentType\n }\n parameters {\n id\n name\n documentation {\n description\n notes\n issues\n }\n type\n cardinality {\n value\n }\n confidentiality {\n label\n value\n }\n value {\n id\n name\n stereoType\n }\n }\n }\n responses {\n id\n documentation {\n description\n notes\n issues\n }\n statusCode\n bodies {\n documentation {\n description\n notes\n issues\n }\n type {\n id\n name\n stereoType\n }\n confidentiality {\n label\n value\n }\n cardinality {\n value\n }\n contentType\n }\n parameters {\n id\n name\n documentation {\n description\n notes\n issues\n }\n type\n cardinality {\n value\n }\n value {\n id\n name\n stereoType\n }\n }\n }\n }\n }\n }\n }\n }\n }\n `,\n });\n\n try {\n const res = await fetch(`${getBaseUrl(config)}/graphql`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Api-Key\": getApiKey(config),\n },\n body: query,\n });\n if (!res.ok) {\n showError(\n `Could not get MPS model for ${id}. Please see the developer console for details.`,\n name\n );\n return null;\n }\n const data = await res.json();\n const model = data.data.modelByID;\n if (!model) {\n showError(\n `Unknown model ${id} at ${getBaseUrl(config)}, source: ${\n config.mps.source ?? \"CORE\"\n }`,\n name\n );\n return null;\n }\n sessionStorage.setItem(key, JSON.stringify(model));\n return model;\n } catch (error) {\n showError(`Could not get MPS model for ${id}: ${error}`, name);\n return null;\n }\n}\n\n/**\n * Async function that returns the OpenAPI Schema for an MPS Model.\n *\n * @param {object} config The respecConfig.\n * @param {string} id MPS Model id.\n * @param {string} binding The OpenAPI Schema file format (YAML or JSON).\n * @returns {object} The OpenAPI Schema text.\n */\nasync function getOpenApiSchema(config, id, binding) {\n binding = binding ?? \"yaml\";\n try {\n const res = await fetch(\n `${getBaseUrl(\n config\n )}/openapischema/${id}?binding=${binding.toLowerCase()}`,\n {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Api-Key\": getApiKey(config),\n },\n }\n );\n if (!res.ok) {\n showError(\n `Could not get the OpenAPI schema for ${id}: ${res.status}`,\n name\n );\n return null;\n }\n const data = await res.text();\n return data;\n } catch (error) {\n showError(`Could not get the OpenAPI schema for ${id}: ${error}`, name);\n return null;\n }\n}\n/**\n * Process a single MPS Class model.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The class section element.\n * @param {object} classModel The MPS Class object.\n */\nasync function processClass(config, section, classModel) {\n section.setAttribute(\"id\", classModel.id);\n const title = section.getAttribute(\"title\");\n let wrapper;\n switch (classModel.stereoType) {\n case \"Enum\":\n case \"EnumeratedList\":\n case \"Enumeration\":\n case \"EnumExt\":\n case \"Vocabulary\":\n wrapper = enumerationTemplate(classModel, title);\n break;\n case \"EmbeddedSelection\":\n wrapper = embeddedSelectionTemplate(classModel, title);\n break;\n default:\n wrapper = classTemplate(config, classModel, title);\n break;\n }\n\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n}\n\n/**\n * Process a single data model section. A model can be split across multiple sections (e.g. one section\n * in the main content and one in the appendices). The data-package attribute, if present, acts as a\n * filter for the section. Only classes in the named package will be expected or generated.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The model section element.\n * @param {string} modelId The MPS Model id.\n */\nasync function processDataModel(config, section, modelId) {\n // The MPS/MPS source (CORE|SANDBOX)\n const source = section.getAttribute(\"data-source\") ?? config.mps.source;\n if (source !== \"CORE\" && source !== \"SANDBOX\") {\n showError(`Invalid source ${source} for model ${modelId}`);\n return;\n }\n\n // The preferred section title\n const title = section.getAttribute(\"title\");\n\n // The section's unique id (used to calculate a unique header id)\n const id = section.getAttribute(\"id\");\n\n // The package name filter, if any\n const packageName = section.getAttribute(\"data-package\") ?? \"\";\n\n const dataModel = await getModel(config, source, modelId);\n if (dataModel) {\n const wrapper = dataModelTemplate(dataModel, title, id);\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n\n let classes = Array.from(dataModel.classes).filter(\n classModel =>\n classModel.stereoType !== \"PrimitiveType\" &&\n classModel.stereoType !== \"DerivedType\"\n );\n\n if (packageName !== \"\") {\n classes = classes.filter(\n classModel => classModel.documentation.packageName === packageName\n );\n }\n\n classes.forEach(async classModel => {\n let classSection = section.querySelector(\n `section[data-class=\"${classModel.id}\"]`\n );\n if (classSection) {\n processClass(config, classSection, classModel);\n } else {\n // Auto-generate the class definition\n classSection = html`
                      `;\n processClass(config, classSection, classModel);\n section.insertAdjacentElement(\"beforeend\", classSection);\n }\n });\n } else {\n // If there is no data model, add a header to satisfy Respec\n section.insertAdjacentElement(\"afterbegin\", html`

                      ${modelId}

                      `);\n }\n}\n\n/**\n * Process a single service interface model.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The service interface section element.\n * @param {object} serviceInterface The MPS Interface object.\n */\nasync function processInterface(config, section, serviceInterface) {\n const preferredId = section.getAttribute(\"id\");\n section.setAttribute(\"id\", serviceInterface.id);\n const title = section.getAttribute(\"title\");\n const wrapper = interfaceTemplate(serviceInterface, title, preferredId);\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n\n const operations = Array.from(serviceInterface.operations);\n operations.forEach(async operation => {\n let operationSection = section.querySelector(\n `section[data-operation=\"${operation.id}\"]`\n );\n if (operationSection) {\n processOperation(\n config,\n operationSection,\n serviceInterface.rootPath,\n operation\n );\n } else {\n // Auto-generate the operation section\n operationSection = html`
                      `;\n processOperation(\n config,\n operationSection,\n serviceInterface.rootPath,\n operation\n );\n section.insertAdjacentElement(\"beforeend\", operationSection);\n }\n });\n }\n}\n\n/**\n * Process the JSON Schema for single MPS Class model.\n *\n * @param {HTMLElement} section The class section element.\n * @param {object} classModel The MPS Class object.\n */\nasync function processJsonSchema(config, section, classModel) {\n section.setAttribute(\"id\", `${classModel.id}-schema`);\n const title = section.getAttribute(\"title\");\n const schema = await getJsonSchema(config, classModel.id);\n const wrapper = jsonSchemaTemplate(classModel, schema, title);\n if (schema && wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n}\n\n/**\n * Process a JSON Schemas schemas section. Schemas can be split across multiple sections (e.g. one section\n * in the main content and one in the appendices). The data-package attribute, if present, acts as a\n * filter for the section. Only classes in the named package will be expected or generated.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The schema section element.\n * @param {string} modelId The MPS Model id.\n */\nasync function processJsonSchemas(config, section, modelId) {\n // The MPS/MPS source (CORE|SANDBOX)\n const source = section.getAttribute(\"data-source\") ?? config.mps.source;\n if (source !== \"CORE\" && source !== \"SANDBOX\") {\n showError(`Invalid source ${source} for model ${modelId}`);\n return;\n }\n\n // The preferred section title\n const title = section.getAttribute(\"title\");\n\n // The section's unique id (used to calculate a unique header id)\n const id = section.getAttribute(\"id\");\n\n // The package name filter, if any\n const packageName = section.getAttribute(\"data-package\") ?? \"\";\n\n const dataModel = await getModel(config, source, modelId);\n if (dataModel) {\n const wrapper = jsonSchemasTemplate(dataModel, title, id);\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n\n let classes = Array.from(dataModel.classes).filter(\n classModel =>\n classModel.stereoType !== \"PrimitiveType\" &&\n classModel.stereoType !== \"DerivedType\"\n );\n\n if (packageName !== \"\") {\n classes = classes.filter(\n classModel => classModel.documentation.packageName === packageName\n );\n }\n\n classes.forEach(async classModel => {\n let classSection = section.querySelector(\n `section[data-class=\"${classModel.id}\"]`\n );\n if (classSection) {\n processJsonSchema(config, classSection, classModel);\n } else {\n // Auto-generate the class definition\n classSection = html`
                      `;\n processJsonSchema(config, classSection, classModel);\n section.insertAdjacentElement(\"beforeend\", classSection);\n }\n });\n } else {\n // If there is no data model, add a header to satisfy Respec\n section.insertAdjacentElement(\"afterbegin\", html`

                      ${modelId}

                      `);\n }\n}\n\n/**\n * Process an OpenAPI Schema section.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The schema section element.\n * @param {string} modelId The MPS Model id.\n */\nasync function processOpenApiSchema(config, section, modelId) {\n // The MPS/MPS source (CORE|SANDBOX)\n const source = section.getAttribute(\"data-source\") ?? config.mps.source;\n if (source !== \"CORE\" && source !== \"SANDBOX\") {\n showError(`Invalid source ${source} for model ${modelId}`);\n return;\n }\n\n // The preferred section title\n const title = section.getAttribute(\"title\");\n\n // The section's unique id (used to calculate a unique header id)\n const id = section.getAttribute(\"id\");\n\n // The preferred schema binding\n const binding = section.getAttribute(\"data-binding\");\n\n const dataModel = await getModel(config, source, modelId);\n\n const schema = await getOpenApiSchema(config, modelId, binding);\n\n if (dataModel && schema) {\n const wrapper = openApiSchemaTemplate(dataModel, schema, title, id);\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n } else {\n // If there is no schema, add a header to satisfy Respec\n section.insertAdjacentElement(\"afterbegin\", html`

                      ${modelId}

                      `);\n }\n}\n\n/**\n * Process a single MPS Operation model.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The operation section element.\n * @param {string} rootPath The services root path.\n * @param {object} operation The MPS Operation object.\n */\nasync function processOperation(config, section, rootPath, operation) {\n section.setAttribute(\"id\", operation.id);\n const title = section.getAttribute(\"title\");\n const wrapper = operationTemplate(config, rootPath, operation, title);\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n}\n\n/**\n * Generate a sample. The schema is identified by the data-sample attribute.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} parentElem The element that will contain the generated sample.\n */\nasync function processSample(config, parentElem) {\n const classId = parentElem.getAttribute(\"data-sample\");\n if (classId === \"\") {\n showError(\"Example is missing a schema id\", name);\n return;\n }\n const id = parentElem.getAttribute(\"id\") ?? `example-${classId}`;\n parentElem.setAttribute(\"id\", id);\n parentElem.removeAttribute(\"data-sample\");\n const includeOptionalFields =\n parentElem.getAttribute(\"data-include-optional-fields\") ?? \"false\";\n const sampleData = await getDataSample(\n config,\n classId,\n includeOptionalFields\n );\n if (sampleData) {\n // eslint-disable-next-line prettier/prettier\n const sample = html`\n
                      \n${JSON.stringify(sampleData, null, 2)}\n
                      `;\n parentElem.append(sample);\n } else {\n parentElem.append(\n html`

                      Could not get sample data. See developer console for details.

                      `\n );\n }\n}\n\n/**\n * Process a single ServiceModel section. A ServiceModel can be split\n * across multiple sections (e.g. one section in the main content\n * and one in the appendices). The data-interface-filter attribute, if\n * present, acts as a filter for the section. Only operations in\n * the identified interface will be generated.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The model section element.\n * @param {string?} preferredId The preferred id for this section. This be moved to the header.\n */\nasync function processServiceModel(config, section, preferredId) {\n const modelId = section.getAttribute(\"data-model\");\n const serviceModelId = section.getAttribute(\"data-service-model\");\n const source = section.getAttribute(\"data-source\") ?? config.mps.source;\n if (source !== \"CORE\" && source !== \"SANDBOX\") {\n showError(`Invalid source ${source} for model ${modelId}`);\n return;\n }\n\n // The preferred section title\n const title = section.getAttribute(\"title\");\n\n const serviceModels = await getModel(config, source, modelId);\n const serviceModel = serviceModels.services.find(\n service => service.id === serviceModelId\n );\n if (serviceModel) {\n const wrapper = serviceModelTemplate(serviceModel, title, preferredId);\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n\n // Merge service rootPath property into each interface for convenience\n let serviceInterfaces = [];\n serviceModel.interfaces.forEach(serviceInterface => {\n serviceInterface.rootPath = serviceModel.rootPath;\n serviceInterfaces.push(serviceInterface);\n });\n\n // The interface filter, if any\n const interfaceId = section.getAttribute(\"data-interface-filter\") ?? \"\";\n if (interfaceId !== \"\") {\n serviceInterfaces = serviceInterfaces.filter(\n serviceInterface => serviceInterface.id === interfaceId\n );\n }\n\n // Process each interface\n serviceInterfaces.forEach(async serviceInterface => {\n let interfaceSection = section.querySelector(\n `section[data-interface=\"${serviceInterface.id}\"]`\n );\n if (interfaceSection) {\n processInterface(config, interfaceSection, serviceInterface);\n } else {\n // Auto-generate the service definition\n interfaceSection = html`\n
                      \n `;\n processInterface(config, interfaceSection, serviceInterface);\n section.insertAdjacentElement(\"beforeend\", interfaceSection);\n }\n });\n } else {\n // If there is no data model, add a header to satisfy Respec\n section.insertAdjacentElement(\"afterbegin\", html`

                      ${modelId}

                      `);\n }\n}\n\n/**\n * Process classes with a particular stereotype. Only the name and documentation of each class will be listed in a table.\n * Typically used to render the DerivedTypes and PrimitiveTypes.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The model section element.\n * @param {string} The MPS Model id.\n * @param {string} The MPS StereoType.\n */\nasync function processStereoType(config, section, modelId, stereoType) {\n // The MPS/MPS source (CORE|SANDBOX)\n const source = section.getAttribute(\"data-source\") ?? config.mps.source;\n if (source !== \"CORE\" && source !== \"SANDBOX\") {\n showError(`Invalid source ${source} for model ${modelId}`);\n return;\n }\n\n // The preferred section title\n const title = section.getAttribute(\"title\");\n\n // The section's unique id (used to calculate a unique header id)\n const id = section.getAttribute(\"id\");\n\n const dataModel = await getModel(config, source, modelId);\n if (dataModel) {\n const wrapper = dataModelTemplate(dataModel, title, id);\n if (wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n const typeList = stereoTypeTemplate(dataModel, stereoType);\n if (typeList) {\n section.insertAdjacentElement(\"beforeend\", typeList);\n }\n } else {\n // If there is no data model, add a header to satisfy Respec\n section.insertAdjacentElement(\"afterbegin\", html`

                      ${modelId}

                      `);\n }\n}\n\n/**\n * Validate the JSON in a
                       element. The schema is identified\n * by a data-schema attribute.\n *\n * @param {object} config The respecConfig.\n * @param {Object} ajv An instance of ajv2019.\n * @param {HTMLPreElement} pre The 
                       element that contains the JSON to be validated.\n */\nasync function validateExample(config, ajv, pre) {\n  const schemaId = pre.getAttribute(\"data-schema\");\n  const allowAdditionalProperties =\n    pre.getAttribute(\"data-allowAdditionalProperties\") ?? true;\n  if (schemaId === \"\") {\n    showError(\"Example is missing a schema id\", name);\n    return;\n  }\n  const schemaDef = await getJsonSchema(\n    config,\n    schemaId,\n    allowAdditionalProperties\n  );\n  if (schemaDef === null) return;\n  try {\n    // Remove comments from example\n    let preText = pre.innerText;\n    preText = preText.replace(/\\/\\/ .*$/gm, \"\");\n    const data = JSON.parse(preText);\n    if (ajv.refs[schemaDef.$id] === undefined) {\n      ajv.compile(schemaDef);\n    }\n    const validate = ajv.refs[schemaDef.$id].validate;\n    const valid = validate(data);\n    if (!valid) {\n      pre.insertAdjacentElement(\n        \"beforebegin\",\n        html`
                      \n

                      NOTE: This example contains invalid JSON for ${schemaId}.

                      \n
                        \n ${validate.errors.map(error => {\n if (error.instancePath === \"\") error.instancePath = \"class\";\n let message = `${error.instancePath}: ${error.message}`;\n switch (error.keyword) {\n case \"additionalProperties\":\n message += ` (additional property: \"${error.params.additionalProperty})\"`;\n break;\n }\n return `
                      • ${message}
                      • `;\n })}\n
                      \n
                      `\n );\n showError(`Invalid example JSON for ${schemaId}.`, name);\n }\n } catch (error) {\n showError(`Cannot parse example JSON for ${schemaId}: ${error}`, name);\n return;\n }\n}\n\n/**\n * Process a Class diagram section. Diagrams can be split across multiple sections (e.g. one section\n * in the main content and one in the appendices). The data-package, data-classes attributes, if present, act as a\n * filter for the section. Only classes in the named package will be expected or generated.\n *\n * The data-class-diagram-omit-properties attribute, if present, will cause the diagram to omit properties and display only class names.\n * The data-class-diagram-hide-title attribute, if present, will cause the diagram to omit the title.\n *\n * @param {object} config The respecConfig.\n * @param {HTMLElement} section The schema section element.\n * @param {string} modelId The MPS Model id.\n * @param {number} index The index of the diagram.\n */\nasync function processClassDiagram(config, section, modelId, index) {\n section.setAttribute(\"id\", `${modelId}-class-diagram`);\n const title = section.getAttribute(\"title\");\n const packageNames = section.getAttribute(\"data-package\");\n const classNames = section.getAttribute(\"data-classes\");\n const omitProperties = section.hasAttribute(\n \"data-class-diagram-omit-properties\"\n );\n const hideTitle = section.hasAttribute(\"data-class-diagram-hide-title\");\n const diagram = await getClassDiagram(\n config,\n modelId,\n omitProperties,\n hideTitle,\n title,\n packageNames,\n classNames\n );\n\n const wrapper = await classDiagramTemplate(index, diagram, title);\n if (diagram && wrapper) {\n let target = null;\n Array.from(wrapper.childNodes).forEach(element => {\n if (element.nodeName !== \"#comment\") {\n let thisElement = element;\n if (element.nodeName === \"#text\") {\n thisElement = document.createElement(\"text\");\n thisElement.innerHTML = element.nodeValue;\n }\n if (target) {\n target.insertAdjacentElement(\"afterend\", thisElement);\n } else {\n section.insertAdjacentElement(\"afterbegin\", thisElement);\n }\n target = thisElement;\n }\n });\n }\n}\n\n/**\n * Render Model Processing Service objects.\n *\n * @param {object} config respecConfig.\n */\nexport async function run(config) {\n let promises = new Array();\n let index = 0;\n\n // Find all unique Model sections.\n const modelSections = Array.from(\n document.querySelectorAll(\"section[data-model]\")\n );\n if (modelSections.length === 0) return;\n\n // Preload the models so later async threads don't need to\n const models = modelSections\n .map(section => {\n const modelId = section.getAttribute(\"data-model\");\n const source = section.getAttribute(\"data-source\") ?? config.mps.source;\n return `${source}-${modelId}`;\n })\n .filter((value, index, self) => self.indexOf(value) === index);\n promises.push(\n ...Array.from(\n models.map(model => {\n const params = model.split(\"-\");\n return getModel(config, params[0], params[1]);\n })\n )\n );\n await Promise.all(promises);\n promises = new Array();\n\n // Divide the Model sections into DataModel sections, ServiceModel sections\n // and simple type lists.\n const dataModelSections = modelSections.filter(\n elem =>\n !elem.getAttribute(\"data-service-model\") &&\n !elem.getAttribute(\"data-stereotype\") &&\n !elem.getAttribute(\"data-schema-format\") &&\n !elem.hasAttribute(\"data-class-diagram\")\n );\n const stereoTypeSections = modelSections.filter(elem =>\n elem.getAttribute(\"data-stereotype\")\n );\n const serviceModelSections = modelSections.filter(elem =>\n elem.getAttribute(\"data-service-model\")\n );\n const schemaSections = modelSections.filter(elem =>\n elem.getAttribute(\"data-schema-format\")\n );\n const classDiagramSections = modelSections.filter(elem =>\n elem.hasAttribute(\"data-class-diagram\")\n );\n\n // Process the DataModel sections.\n if (dataModelSections.length > 0) {\n promises.push(\n ...Array.from(dataModelSections).map(async section => {\n const modelId = section.getAttribute(\"data-model\") ?? \"\";\n if (modelId === \"\") {\n section.insertAdjacentElement(\n \"afterbegin\",\n html`

                      Missing Model id

                      `\n );\n showError(\n \"Cannot process DataModel sections without the Model id\",\n name,\n { elements: [section] }\n );\n } else {\n section.setAttribute(\"id\", `${modelId}.${index}`);\n index++;\n try {\n await processDataModel(config, section, modelId);\n } catch (error) {\n showError(`Cannot process DataModel ${modelId}: ${error}`, name);\n }\n }\n })\n );\n }\n\n // Process the StereoType sections.\n if (stereoTypeSections.length > 0) {\n promises.push(\n ...Array.from(stereoTypeSections).map(async section => {\n const modelId = section.getAttribute(\"data-model\") ?? \"\";\n const stereoType = section.getAttribute(\"data-stereotype\") ?? \"\";\n if (modelId === \"\") {\n section.insertAdjacentElement(\n \"afterbegin\",\n html`

                      Missing Model id

                      `\n );\n showError(\n \"Cannot process SteroType sections without the Model id\",\n name,\n { elements: [section] }\n );\n } else if (stereoType === \"\") {\n section.insertAdjacentElement(\n \"afterbegin\",\n html`

                      Missing StereoType

                      `\n );\n showError(\n \"Cannot process SteroType sections without the StereoType\",\n name,\n { elements: [section] }\n );\n } else {\n section.setAttribute(\"id\", `${modelId}.${index}`);\n index++;\n try {\n await processStereoType(config, section, modelId, stereoType);\n } catch (error) {\n showError(\n `Cannot process StereoType ${modelId} ${stereoType}: ${error}`,\n name\n );\n }\n }\n })\n );\n }\n\n // Process the Schema sections.\n if (schemaSections.length > 0) {\n promises.push(\n ...Array.from(schemaSections).map(async section => {\n const modelId = section.getAttribute(\"data-model\") ?? \"\";\n const schemaFormat =\n section.getAttribute(\"data-schema-format\")?.toLowerCase() ?? \"\";\n if (modelId === \"\") {\n section.insertAdjacentElement(\n \"afterbegin\",\n html`

                      Missing Model id

                      `\n );\n showError(\n \"Cannot process Schema sections without the Model id\",\n name,\n { elements: [section] }\n );\n } else {\n section.setAttribute(\"id\", `${modelId}.${index}`);\n index++;\n try {\n if (schemaFormat === \"\" || schemaFormat === \"json\") {\n await processJsonSchemas(config, section, modelId);\n } else {\n await processOpenApiSchema(config, section, modelId);\n }\n } catch (error) {\n showError(`Cannot process Schema for ${modelId}: ${error}`, name);\n }\n }\n })\n );\n }\n\n // Process the ServiceModel sections.\n if (serviceModelSections.length > 0) {\n promises.push(\n ...Array.from(serviceModelSections).map(async section => {\n const modelId = section.getAttribute(\"data-model\") ?? \"\";\n const serviceModelId = section.getAttribute(\"data-service-model\") ?? \"\";\n if (modelId === \"\") {\n section.insertAdjacentElement(\n \"afterbegin\",\n html`

                      Missing Model id

                      `\n );\n showError(\n \"Cannot process ServiceModel section without the Model id\",\n name,\n { elements: [section] }\n );\n } else if (serviceModelId === \"\") {\n section.insertAdjacentElement(\n \"afterbegin\",\n html`

                      Missing ServiceModel id

                      `\n );\n showError(\n \"Cannot process ServiceModel section without the ServiceModel id\",\n name,\n { elements: [section] }\n );\n } else {\n const preferredId = section.getAttribute(\"id\");\n section.setAttribute(\"id\", `${modelId}.${index}`);\n index++;\n try {\n await processServiceModel(config, section, preferredId);\n } catch (error) {\n showError(`Cannot process ServiceModel ${modelId}: ${error}`, name);\n }\n }\n })\n );\n }\n\n // Process the ClassDiagram sections.\n if (classDiagramSections.length > 0) {\n promises.push(\n ...Array.from(classDiagramSections).map(async section => {\n const modelId = section.getAttribute(\"data-model\") ?? \"\";\n if (modelId === \"\") {\n section.insertAdjacentElement(\n \"afterbegin\",\n html`

                      Missing Model id

                      `\n );\n showError(\n \"Cannot process ClassDiagram section without the Model id\",\n name,\n { elements: [section] }\n );\n } else {\n section.setAttribute(\"id\", `${modelId}.${index}`);\n index++;\n try {\n await processClassDiagram(config, section, modelId, index);\n } catch (error) {\n showError(`Cannot process ClassDiagram ${modelId}: ${error}`, name);\n }\n }\n })\n );\n }\n\n const samples = document.querySelectorAll(\"[data-sample]\");\n if (samples) {\n promises.push(\n ...Array.from(samples).map(async sample => {\n const classId = sample.getAttribute(\"data-sample\");\n try {\n await processSample(config, sample);\n } catch (error) {\n showError(`Cannot generate sample ${classId}: ${error}`, name);\n }\n })\n );\n }\n\n if (typeof window.ajv2019 === \"function\") {\n const ajv = new window.ajv2019({\n allErrors: true,\n });\n addFormats(ajv);\n const examples = document.querySelectorAll(\"pre[data-schema]\");\n if (examples) {\n promises.push(\n ...Array.from(examples).map(async example => {\n const classId = example.getAttribute(\"data-schema\");\n try {\n await validateExample(config, ajv, example);\n } catch (error) {\n showError(`Cannot validate example ${classId}: ${error}`, name);\n }\n })\n );\n }\n }\n\n await Promise.all(promises);\n\n // Clear the data model cache\n Array.from(document.querySelectorAll(\"section[data-model]\"))\n .map(\n section => `${config.mps.source}-${section.getAttribute(\"data-model\")}`\n )\n .forEach(key => {\n sessionStorage.removeItem(key);\n });\n\n // Remove MPS config from initialUserConfig so API_KEY is not exposed\n sub(\"end-all\", () => {\n const script = document.getElementById(\"initialUserConfig\");\n const userConfig = JSON.parse(script.innerHTML);\n if (\"mps\" in userConfig) {\n delete userConfig.mdm;\n script.innerHTML = JSON.stringify(userConfig, null, 2);\n }\n });\n}\n","// @ts-check\n// Module 1edtech/privacy\n// Handle the privacy section properly.\nimport confLevelTmpl from \"./templates/confidentialityLevelTemplate.js\";\nimport { getIntlData } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport localizationStrings from \"./translations/1edtech.js\";\nimport privacyTmpl from \"./templates/privacyImplicationsTemplate.js\";\n\nexport const name = \"1edtech/privacy\";\n\nconst l10n = getIntlData(localizationStrings);\nconst privacyImplicationsKeys = [\n \"ACCESSIBILITY\",\n \"ANALYTICS\",\n \"CONTAINER\",\n \"CREDENTIALS\",\n \"CREDENTIALSIDREF\",\n \"DEMOGRAPHICS\",\n \"EXTENSION\",\n \"FINANCIAL\",\n \"IDENTIFIER\",\n \"IDENTIFIERREF\",\n \"INSURANCE\",\n \"LEGAL\",\n \"MEDICAL\",\n \"NA\",\n \"OTHER\",\n \"QUALIFICATION\",\n \"PERSONAL\",\n \"SOURCEDID\",\n \"SOURCEDIDREF\",\n];\n\nconst confidentialityLevelKeys = [\n \"UNRESTRICTED\",\n \"NORMAL\",\n \"RESTRICTED\",\n \"VERYRESTRICTED\",\n];\n\n/**\n * @param {string} title\n * @returns {HTMLElement}\n */\nfunction createSection(title, header) {\n return html`
                      \n

                      ${title}

                      \n

                      ${header}

                      \n
                      `;\n}\n\n/**\n * Handles checking for the abstract, and inserts a temp one if not present.\n */\nexport async function run(conf) {\n /** @type {HTMLElement} */\n if (!conf.showPrivacyAnnotations) {\n return;\n }\n\n const privacySection =\n document.querySelector(\"section#privacy-appendix\") ||\n html`
                      `;\n\n if (!document.querySelector(\"section#privacy-appendix > h2\")) {\n privacySection.prepend(html`

                      ${l10n.privacy_section_header}

                      `);\n }\n\n privacySection.classList.add(\"appendix\");\n\n const piSection = createSection(\n l10n.privacy_implications,\n l10n.privacy_implications_paragraph\n );\n piSection.appendChild(privacyTmpl(privacyImplicationsKeys, l10n));\n privacySection.appendChild(piSection);\n\n const confSection = createSection(\n l10n.confidentiality_level,\n l10n.confidentiality_level_paragram\n );\n confSection.appendChild(confLevelTmpl(confidentialityLevelKeys, l10n));\n privacySection.appendChild(confSection);\n\n document.body.appendChild(privacySection);\n}\n","export default {\n en: {\n privacy_section_header: \"Privacy\",\n privacy_implications: \"Privacy Implications\",\n privacy_implications_paragraph:\n \"All of the privacy implications contained within this Information Model are described in this Section. All of the corresponding concepts and methods for these privacy annotations are defined in the Privacy Framework.\",\n confidentiality_level: \"Confidentiality Level\",\n confidentiality_level_paragram:\n \"All of the privacy classification of the exchanged payloads are described in this Section.\",\n ACCESSIBILITY_label: \"Accessibility\",\n ACCESSIBILITY_def:\n \"denotes information about the accessibility personal needs and preferences of the user\",\n ANALYTICS_label: \"Analytics\",\n ANALYTICS_def:\n \"denotes information that will be used to support the creation of learning analytics\",\n CONTAINER_label: \"Container\",\n CONTAINER_def:\n \"denotes that the child attributes have privacy-sensitive information\",\n CREDENTIALS_label: \"Credentials\",\n CREDENTIALS_def:\n \"denotes access control information for the use e.g. password, private key, etc.\",\n CREDENTIALSIDREF_label: \"CredentialsIdRef\",\n CREDENTIALSIDREF_def:\n \"denotes reference to/use of an identifier to credentials information for the user\",\n DEMOGRAPHICS_label: \"Demographics\",\n DEMOGRAPHICS_def:\n \"denotes information about the demographics of the user e.g. ethnicity, gender, etc.\",\n EXTENSION_label: \"Extension\",\n EXTENSION_def:\n \"denotes that proprietary information can be included and so this MAY contain privacy-sensitive information\",\n FINANCIAL_label: \"Financial\",\n FINANCIAL_def:\n \"denotes that the information is of a financial nature e.g. bank account, financial aid status, etc.\",\n IDENTIFIER_label: \"Identifier\",\n IDENTIFIER_def:\n \"denotes a unique identifier that has been assigned, by some third party, to the user e.g. passport number, social security number, etc.\",\n IDENTIFIERREF_label: \"IdentifierRef\",\n IDENTIFIERREF_def:\n \"denotes reference to/use of a unique identifier that has been assigned, by some third party, to the user\",\n INSURANCE_label: \"Insurance/Assurance\",\n INSURANCE_def:\n \"denotes that the information is about the insurance life-assurance nature, e.g. type of insurance, etc.\",\n LEGAL_label: \"Legal\",\n LEGAL_def:\n \"denotes that the information is of a legal or judicial nature e.g. Will, prison record, etc.\",\n MEDICAL_label: \"Medical/Healthcare\",\n MEDICAL_def:\n \"denotes that the information is of a medical, or healthcare-related nature e.g. allergies, blood-type, mobility needs, etc.\",\n NA_label: \"N/A\",\n NA_def:\n \"denotes that there are NO PRIVACY IMPLICATIONS for this attribute (this is the default setting)\",\n OTHER_label: \"Other\",\n OTHER_def:\n \"denotes privacy sensitive information that is NOT covered by one of the other categories\",\n QUALIFICATION_label: \"Qualification/Certification\",\n QUALIFICATION_def:\n \"denotes that the information is about education qualifications, skill-set certifications, microcredentials, etc.\",\n PERSONAL_label: \"Personal\",\n PERSONAL_def:\n \"denotes personal information about the user e.g. name, address, etc.\",\n SOURCEDID_label: \"SourcedId\",\n SOURCEDID_def:\n \"denotes the interoperability unique identifier that has been assigned and MUST be present for the correct usage of the corresponding 1EdTech specification\",\n SOURCEDIDREF_label: \"SourcedIdRef\",\n SOURCEDIDREF_def:\n \"denotes reference to/use of the interoperability unique identifier, sourcedId, to link/point to an associated 1EdTech object\",\n UNRESTRICTED_label: \"unrestricted\",\n UNRESTRICTED_def:\n \"there are no privacy concerns (this is the default value).\",\n NORMAL_label: \"normal\",\n NORMAL_def:\n \"denotes that privacy sensitive data could be included and so all best practices to secure this data should be used.\",\n RESTRICTED_label: \"restricted\",\n RESTRICTED_def:\n \"denotes that some of the data is more sensitive than usual or that many attributes information that when used together create increased vulnerability for identification of the associated individual or group.\",\n VERYRESTRICTED_label: \"veryrestricted\",\n VERYRESTRICTED_def:\n \"denotes that the request could contain very sensitive privacy data. Depending on the capabilities of the Provider this very sensitive data may be obfuscated or may not even be present.\",\n },\n};\n","/* eslint-disable prefer-template */\n// @ts-check\nimport { html } from \"../../core/import-maps.js\";\n\nexport default (keys, translations) => {\n return html`
                      \n ${keys.map(\n key => html`
                      \n \n ${translations[key + \"_label\"]}\n \n
                      \n
                      ${translations[key + \"_def\"]}
                      `\n )}\n
                      `;\n};\n","/* eslint-disable prefer-template */\n// @ts-check\nimport { html } from \"../../core/import-maps.js\";\n\nexport default (keys, translations) => {\n return html`
                      \n ${keys.map(\n key => html`
                      \n \n ${translations[key + \"_label\"]}\n \n
                      \n
                      ${translations[key + \"_def\"]}
                      `\n )}\n
                      `;\n};\n","// @ts-check\nexport const name = \"1edtech/post-markdown\";\n\n/**\n * Post processing of markdown transcludes. Run after markdown.\n *\n * @param {*} conf respecConfig\n */\nexport async function run(conf) {\n if (conf.format !== \"markdown\") return;\n\n // remove elements\n const mdOnlies = document.body.querySelectorAll(\"md-only\");\n for (let i = 0; i < mdOnlies.length; i++) {\n mdOnlies[i].parentNode.removeChild(mdOnlies[i]);\n }\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
                       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","/* eslint-disable prettier/prettier */\n// @ts-check\nimport { html } from \"../../core/import-maps.js\";\nimport { showWarning } from \"../../core/utils.js\";\n\nconst name = \"1edtech/templates/headers\";\n\n/**\n * @param {*} conf\n */\nfunction getStatusString(conf) {\n  // specStatusString: an override of the default descriptions\n  if (conf.specStatusString) {\n    return conf.specStatusString;\n  }\n  // for generic docs, have a generic desc\n  if (conf.specType === \"doc\") {\n    return \"This is an informative 1EdTech document that may be revised at any time.\";\n  }\n  if (conf.specType === \"proposal\") {\n    return \"This is a proposal that may be revised at any time.\";\n  }\n  // specStatus: See 1edtech/config.js for known values\n  switch (conf.specStatus) {\n    case \"Proposal\":\n      return \"This document is for review and comment by 1EdTech Contributing Members.\";\n    case \"Base Document\":\n      return \"This document is for review and comment by 1EdTech Contributing Members.\";\n    case \"Candidate Final\":\n      return \"This document is for review and adoption by the 1EdTech membership.\";\n    case \"Candidate Final Public\":\n      return \"This document is for review and adoption by the 1EdTech membership.\";\n    case \"Final Release\":\n      return \"This document is made available for adoption by the public community at large.\";\n    default:\n      // 1edtech/config.js will issue error for unknown values\n      return `Unknown specStatus: \"${conf.specStatus}\"`;\n  }\n}\n\nfunction 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    return;\n  }\n  return html`\n    \n      ${link.key}\n      \n        \n          \n            ${link.data ? link.data.map(showLinkData) : showLinkData(link)}\n          \n        
                      \n \n \n `;\n}\n\nfunction showLinkData(data) {\n return html` \n ${data.href\n ? html`${data.value || data.href}`\n : data.value}\n `;\n}\n\nfunction renderSpecVersion(conf) {\n if (conf.specType !== \"doc\" && conf.specType !== \"proposal\") {\n return html`
                      \n ${conf.specStatus}
                      Spec Version ${conf.specVersion}\n
                      `;\n }\n}\n\nfunction renderSpecStatus(conf) {\n if (conf.specType !== \"doc\" && conf.specType !== \"proposal\") {\n return html`${conf.specStatus}`;\n }\n}\n\nfunction renderVersionTable(conf) {\n if (conf.specType !== \"doc\" && conf.specType !== \"proposal\") {\n return html`\n \n \n Document Version:\n ${conf.docVersion}\n \n \n Date Issued:\n ${conf.specDate}\n \n \n Status:\n ${getStatusString(conf)}\n \n \n This version:\n ${conf.thisURL}\n \n ${conf.specNature === \"normative\"\n ? html`\n Latest version:\n ${conf.latestURI}\n \n \n Errata:\n ${conf.errataURL}\n `\n : null\n }\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n \n `;\n } else {\n return html`\n \n \n Date Issued:\n ${conf.specDate}\n \n \n Status:\n ${getStatusString(conf)}\n \n \n `;\n }\n}\n\nfunction renderCopyright() {\n return html`
                      \n

                      \n © ${new Date().getFullYear()} 1EdTech™ Consortium, Inc. All Rights Reserved.\n

                      \n

                      \n Trademark information:\n http://www.imsglobal.org/copyright.html\n \n

                      \n
                      `;\n}\n\nfunction renderDisclosure(conf) {\n if (conf.specType === \"proposal\") {\n return html`
                      \n

                      Proposals

                      \n

                      \n Proposals are made available for the purposes of Project Group / Task\n Force only and should not be distributed outside of the 1EdTech Contributing\n Membership without the express written consent of 1EdTech. Provision of\n any work documents outside of the project group/ task force will revoke\n all privileges as an Invited Guest. Any documents provided\n non-participants will be done by 1EdTech only on the 1EdTech public\n website when the documents become publicly available.\n

                      \n
                      `;\n } else {\n return html``;\n }\n}\n\nfunction renderIpr(conf) {\n return html`
                      \n

                      IPR and Distribution Notice

                      \n

                      \n Recipients of this document are requested to submit, with their\n comments, notification of any relevant patent claims or other\n intellectual property rights of which they may be aware that might be\n infringed by any implementation of the specification set forth in this\n document, and to provide supporting documentation.\n

                      \n

                      \n 1EdTech takes no position regarding the validity or scope of any\n intellectual property or other rights that might be claimed to pertain\n implementation or use of the technology described in this document or\n the extent to which any license under such rights might or might not be\n available; neither does it represent that it has made any effort to\n identify any such rights. Information on 1EdTech's procedures with respect\n to rights in 1EdTech specifications can be found at the 1EdTech Intellectual\n Property Rights webpage:\n \n http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf .\n

                      \n
                      \n ${renderIprTable(conf)}`;\n}\n\nfunction renderIprTable(conf) {\n if (conf.iprs) {\n return html`

                      \n The following participating organizations have made explicit license\n commitments to this specification:\n

                      \n \n \n \n \n \n \n \n \n \n \n ${conf.iprs.map(renderIprRow)}\n \n
                      Org nameDate election madeNecessary claimsType
                      `;\n }\n}\n\nfunction renderIprRow(element) {\n return html`\n ${element.company}\n ${element.electionDate}\n ${element.necessaryClaims}\n ${element.type}\n `;\n}\n\nexport default conf => {\n return html`
                      \n \n ${renderSpecVersion(conf)} ${renderSpecStatus(conf)}\n ${renderVersionTable(conf)} ${renderIpr(conf)} ${renderDisclosure(conf)}\n ${renderCopyright()}\n
                      `;\n};\n","// @ts-check\n/**\n * Module 1edtech/headers\n * Add 1EdTech boilerplate front matter to the document.\n */\nimport headersTmpl from \"./templates/headers.js\";\n\nexport const name = \"1edtech/headers\";\n\n/**\n * @param {*} conf\n */\nexport async function run(conf) {\n document.title = `${conf.specTitle} ${conf.specVersion ?? \"\"} \n ${conf.specStatus ?? \"\"}`;\n\n const body = document.body;\n const header = headersTmpl(conf);\n\n if (body.firstChild) {\n body.insertBefore(header, body.firstChild);\n } else {\n body.appendChild(header);\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} */\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`
                      `;\n h.replaceWith(wrapper);\n const selfLink = html``;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module 1edtech/abstract\n// Handle the abstract section properly.\nimport { html } from \"../core/import-maps.js\";\nimport { showWarning } from \"../core/utils.js\";\nexport const name = \"1edtech/abstract\";\n\n/**\n * Handles checking for the abstract, and inserts a temp one if not present.\n */\nexport async function run() {\n let abstract = document.getElementById(\"abstract\");\n if (!abstract) {\n showWarning(\"Document should have one element with 'abstract'\", name);\n // insert a temp abstract\n abstract = html`
                      \n

                      To be removed

                      \n
                      `;\n document.body.prepend(abstract);\n }\n\n if (abstract.tagName.startsWith(\"H\")) {\n abstract.removeAttribute(\"id\");\n abstract = abstract.parentElement;\n abstract.id = \"abstract\";\n }\n if (abstract.tagName === \"SECTION\") {\n if (!abstract.classList.contains(\"introductory\")) {\n abstract.classList.add(\"introductory\");\n }\n }\n\n let abstractHeading = document.querySelector(\"#abstract>h2\");\n if (abstractHeading) {\n return;\n }\n abstractHeading = document.createElement(\"h2\");\n abstractHeading.textContent = \"Abstract\";\n abstract.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} */\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} */\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 textContent to remove spaces, tabs, new lines.\n const fullForm = dfn.textContent.replace(/\\s\\s+/g, \" \").trim();\n dfn.insertAdjacentHTML(\n \"afterend\",\n ` (${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//\n// Ensure the conformance section has an id.\n//\n// core/inlines determines whether a document is informative by the\n// presence or absence of a section with id='conformance'. If the conformance\n// section is in Markddown, it will not have an id. This module will assign the\n// id to a section if the first header in the section is 'conformance' or\n// 'conformance statements' (ignoring case). For example,\n//\n// Note: Run after core/markdown and before core/inlines\n\nimport { addId } from \"../core/utils.js\";\n\nexport const name = \"1edtech/inlines\";\n\n/**\n * Find the Conformance section in parent and assign an id.\n *\n * @param {Element | HTMLElement} parent\n */\nfunction findConformanceSection(parent) {\n /** @type {NodeListOf} */\n const sectionElements = parent.querySelectorAll(\":scope > section\");\n for (const section of sectionElements) {\n if (!section.children.length) {\n continue;\n }\n\n if (!section.id) {\n const header = section.children[0];\n const title = header.textContent;\n if (\n title.toLowerCase() == \"conformance\" ||\n title.toLowerCase() == \"conformance statements\"\n ) {\n addId(section, null, \"conformance\");\n return section;\n }\n }\n\n const foundSection = findConformanceSection(section);\n if (foundSection) {\n return foundSection;\n }\n }\n\n return null;\n}\n\n/**\n * @param {*} conf\n */\nexport async function run(conf) {\n // No conformance section in 1EdTech Errata documents\n if (conf.specType == \"errata\") {\n return;\n }\n\n let conformance = document.querySelector(\"section#conformance\");\n if (!conformance) {\n conformance = findConformanceSection(document.body);\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`${identifier + (nullable ? \"?\" : \"\")}`;\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 ? \".\" : \"\"}[[${identifier}]]${argsHtml}`;\n return element;\n}\n\nfunction htmlArgMapper(str, i, array) {\n if (i < array.length - 1) return html`${str}`;\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}${arg}`;\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 ? \".\" : \"\"}${identifier}`;\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 ? \".\" : \"\"}${text || identifier}${!text || textArgs ? html`(${argsText})` : \"\"}`;\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`\"${enumValue}\"`;\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`\"${identifier}\"`;\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`${identifier + (nullable ? \"?\" : \"\")}`;\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`{{ ${str} }}`;\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}\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>}\n */\nasync function openIdb() {\n /** @type {import(\"idb\").IDBPDatabase} */\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} 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} 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} 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} 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} 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} 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} */\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}\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`
                      `;\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`

                      ${l10n.references}

                      `);\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`
                      \n

                      ${title}

                      \n
                      ${refsToShow.map(showRef)}
                      \n
                      `;\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} 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} */\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`${text}`;\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
                      [${ref}]
                      \n
                      \n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`${l10n.reference_not_found}`}\n
                      \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 = `${ref.title}`;\n\n output = ref.href ? `${output}. ` : `${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: ${ref.href}`;\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} */\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 / 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 (?:]+\\??)?\\|\\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`${textContent}`;\n}\n\n/**\n * @param {string} matched\n * @return {HTMLElement}\n */\nfunction inlineRFC2119Matches(matched) {\n const value = norm(matched);\n const nodeElement = html`${value}`;\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``;\n }\n return html``;\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, 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\");\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}\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} abbrMap\n */\nfunction inlineAbbrMatches(matched, txt, abbrMap) {\n return txt.parentElement.tagName === \"ABBR\"\n ? matched\n : html`${matched}`;\n}\n\n/**\n * @example |varName: type| => varName\n * @example |varName| => varName\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`${varName}`;\n}\n\n/**\n * @example [= foo =] => foo\n * @example [= bar/foo =] => foo\n * @example [= `foo` =] => foo\n * @example [= foo|bar =] => bar\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`${processedContent}`;\n}\n\nfunction inlineCodeMatches(matched) {\n const clean = matched.slice(1, -1); // Chop ` and `\n return html`${clean}`;\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} */\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 1edtech/conformance\n//\n// Based on w3c/conformance with following differences:\n//\n// 1EdTech version:\n// - Skip if specType == 'Errata' (1EdTech Errata documents do not have a conformance section).\n// - Use slightly modified conformance text.\n//\n// Note: Run after inlines so the conformance section has an id and NormativeReferences is available.\nimport { htmlJoinAnd, showError, 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\";\n\nexport const name = \"1edtech/conformance\";\n\n/**\n * core/inlines will count the actual occurances of each term and\n * both w3c/conformance and 1edtech/conformance will only list the terms\n * that are in rfc2119Usage. But the current version of the normative\n * text refers to all the keywords, so this stuffs the list with all\n * the keywords.\n */\nfunction stuffRfc299Usage() {\n rfc2119Usage.MUST = true;\n rfc2119Usage[\"MUST NOT\"] = true;\n rfc2119Usage.REQUIRED = true;\n rfc2119Usage.SHALL = true;\n rfc2119Usage[\"SHALL NOT\"] = true;\n rfc2119Usage.SHOULD = true;\n rfc2119Usage[\"SHOULD NOT\"] = true;\n rfc2119Usage.RECOMMENDED = true;\n rfc2119Usage.MAY = true;\n rfc2119Usage.OPTIONAL = true;\n}\n\n/**\n * @param {*} conf\n */\nfunction getNormativeText(conf) {\n // Make sure all the terms referenced in the text below are included.\n // Remove this step if you only want to list the terms that are actually\n // used in this document.\n stuffRfc299Usage();\n\n // Build the HTML\n const terms = [...Object.keys(rfc2119Usage)];\n const keywords = htmlJoinAnd(\n terms.sort(),\n item => html`${item}`\n );\n const plural = terms.length > 1;\n\n const content = html`

                      \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

                      \n ${terms.length\n ? html`\n

                      \n The key word${plural ? \"s\" : \"\"} ${[keywords]} in this document\n ${plural ? \"are\" : \"is\"} to be interpreted as described in\n ${renderInlineCitation(\"RFC2119\")}.\n

                      \n `\n : null}\n

                      \n An implementation of this specification that fails to implement a\n MUST/REQUIRED/SHALL requirement or fails to abide by a MUST NOT/SHALL NOT\n prohibition is considered nonconformant. SHOULD/SHOULD NOT/RECOMMENDED\n statements constitute a best practice. Ignoring a best practice does not\n violate conformance but a decision to disregard such guidance should be\n carefully considered. MAY/OPTIONAL statements indicate that implementers\n are entirely free to choose whether or not to implement the option.\n

                      `;\n\n if (conf.skipCertGuideConformanceRef || conf.specType == \"cert\") {\n return content;\n }\n\n return html`${content}\n

                      \n The Conformance and Certification Guide\n for this specification may introduce greater normative constraints than\n those defined here for specific service or implementation categories.\n

                      `;\n}\n\n/**\n * @param {*} conf\n */\nfunction getInformativeText(conf) {\n if (!conf.mainSpecTitle) {\n showWarning(\"No mainSpecTitle property found in config')\", name);\n }\n\n if (!conf.mainSpecBiblioKey) {\n showWarning(\"No mainSpecBiblioKey property found in config')\", name);\n }\n\n return html`

                      \n This document is an informative resource in the Document Set of the\n ${conf.mainSpecTitle ? conf.mainSpecTitle : \"\"} specification\n ${conf.mainSpecBiblioKey\n ? renderInlineCitation(conf.mainSpecBiblioKey)\n : \"\"}.\n As such, it does not include any normative requirements. Occurrences in this\n document of terms such as MAY, MUST, MUST NOT, SHOULD or RECOMMENDED have no\n impact on the conformance criteria for implementors of this specification.\n

                      `;\n}\n\n/**\n * @param {Element} conformance\n * @param {*} conf\n */\nfunction processConformance(conformance, conf) {\n // Add RFC2119 to the bibliography\n conf.normativeReferences.add(\"RFC2119\");\n\n // Get the appropriate text\n let content;\n\n if (conf.specNature === \"normative\") {\n content = getNormativeText(conf);\n } else if (conf.specNature === \"informative\") {\n content = getInformativeText(conf);\n }\n\n if (conformance.tagName === \"SECTION\") {\n conformance.prepend(...content.childNodes);\n } else {\n conformance.parentNode.parentNode.append(...content.childNodes);\n }\n}\n\n/**\n * @param {*} conf\n */\nexport function run(conf) {\n // No conformance section in 1EdTech Errata documents\n if (conf.specType === \"errata\") {\n return;\n }\n\n let conformance = document.querySelector(\"section#conformance\");\n if (!conformance)\n conformance = document.querySelector(\"section#conformance-0\");\n if (!conformance) {\n if (conf.specType === \"doc\") {\n // Conformance is optional for generic documents\n return;\n }\n // Otherwise, the conformance section is required\n showError(\"No section found with id 'conformance'\", name);\n return;\n }\n\n // Use 1EdTech specNature to determine conformance text\n if (!conf.specNature) {\n showError(\"Document must have config.specNature set\", name);\n }\n\n // 1EdTech standard is to have a Conformance heading\n if (conformance.tagName === \"SECTION\") {\n const conformanceHeading = conformance.querySelector(\n \"h1, h2, h3, h4, h5, h6\"\n );\n if (!conformanceHeading) {\n showWarning(\"No heading found in the conformance section\", name);\n } else {\n // Insert conformation text after heading\n conformance = conformanceHeading;\n }\n }\n\n // Insert the conformance text\n processConformance(conformance, conf);\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>} */\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 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} */\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., \")\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} */\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} */\n const links = new Set();\n /** @type {NodeListOf} */\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} */\n const dfnTexts = new Set();\n /** @type {NodeListOf} */\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`: ${report.title}`\n : \"\";\n return html``;\n}\n\nexport function run() {\n /** @type {NodeListOf} */\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``,\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`
                      \n ${exampleTitle} ${example.cloneNode(true)}\n
                      `;\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} 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`
                      `;\n const title = document.createElement(\"span\");\n const className = `${type}-title marker`;\n // prettier-ignore\n const titleParent = html`
                      ${title}
                      `;\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`
                      `;\n } else if (isFeatureAtRisk && conf.atRiskBase) {\n return html``;\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`: ${report.title}`\n : \"\";\n return html`
                    3. ${issueNumberText}${title}
                    4. `;\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`

                      ${l10n.no_issues_in_spec}

                      `);\n if (\n !heading ||\n (heading && heading !== issueSummaryElement.firstElementChild)\n ) {\n issueSummaryElement.insertAdjacentHTML(\n \"afterbegin\",\n `

                      ${l10n.issue_summary}

                      `\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`: ${title}${labelsGroup}`;\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` ${name}`;\n}\n\n/**\n * @returns {Promise>}\n */\nasync function fetchAndStoreGithubIssues(github) {\n if (!github || !github.apiBase) {\n return new Map();\n }\n\n /** @type {NodeListOf} */\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} */\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``,\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\nimport { addId } from \"../core/utils.js\";\nimport { pub } from \"../core/pubsubhub.js\";\nimport { toHTMLElement } from \"./utils.js\";\n\nexport const name = \"1edtech/issues-notes\";\n\n/**\n * NOTE: No longer required. core/issues-notes.js handles note|warning|issue\n * just fine even if no github connection. Leaving this in the ims-default\n * profile to support existing markup.\n *\n * Handles admonitions, adding a top bar and a11y attrs\n * Types currently supported:\n * aside.note\n * aside.ednote\n * aside.warning\n * aside.issue (will yield error if status is final, warning if CF)\n *\n * Alternate syntax is div.aside.note|warning|issue\n *\n * This replaces core/issues-notes.js, which has github features we can't utilize\n * because of our non-open repos.\n *\n * @param {*} conf respecConfig\n */\nexport async function run(conf) {\n // check and warn for issue admons in late process stages\n const issues = document.body.querySelectorAll(\"aside.issue, div.aside.issue\");\n if (issues.length > 0) {\n if (conf.specStatus == \"Final Release\") {\n pub(\n \"error\",\n \"Issue asides must not be present when the status is 'Final Release'\"\n );\n } else if (conf.specStatus == \"Candidate Final\") {\n pub(\n \"warn\",\n \"Issue asides should not be present when the status is 'Candidate Final'\"\n );\n }\n }\n\n // prep the output element\n /** @type {NodeListOf} */\n const admons = document.body.querySelectorAll(\n \"aside.note, aside.ednote, aside.warning, aside.issue, \" +\n \" div.aside.note, div.aside.ednote div.aside.warning, div.aside.issue\"\n );\n\n admons.forEach(aside => {\n const type = getAdmonType(aside);\n aside.setAttribute(\"role\", \"note\");\n aside.classList.add(\"admonition\");\n if (!aside.hasAttribute(\"id\")) {\n addId(aside);\n }\n const topBar = toHTMLElement(`
                      ${type}
                      `);\n topBar.classList.add(`${type}-title`);\n aside.insertAdjacentElement(\"afterbegin\", topBar);\n });\n}\n\n/**\n * Returns the admonition type as a string based on the classList.\n * The three known types are \"note\", \"warning\", and \"issue\". If none\n * of those are present, returns \"info\".\n *\n * @param { * } aside the element to inspect\n * @returns { string } the admonition type as a string\n */\nfunction getAdmonType(aside) {\n if (aside.classList.contains(\"note\")) {\n return \"note\";\n } else if (aside.classList.contains(\"warning\")) {\n return \"warning\";\n } else if (aside.classList.contains(\"issue\")) {\n return \"issue\";\n }\n return \"info\";\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} */\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`${l10n.best_practice}${num + 1}
                      `;\n\n // Make the summary items, if we have a summary\n if (summaryItems) {\n const li = html`
                    5. ${localizedBpName}: ${makeSafeCopy(bp)}
                    6. `;\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`

                      Best Practices Summary

                      `);\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`

                      ${l10n.list_of_figures}

                      `,\n html`
                        \n ${tof}\n
                      `\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 `
                      ` without a `
                      `.\";\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``);\n caption.prepend(\n html`${l10n.fig}${i + 1}`,\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`
                    7. \n ${tofCaption.childNodes}\n
                    8. `;\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 * Fetch the online ims-biblio json and append the data to conf.localBiblio.\n * This approach allows us to reuse the W3C biblio logic & implementation untouched.\n * The effect is that we have three levels of sources for biblio entries:\n * - localBiblio\n * - ims-biblio on purl.imsglobal.org\n * - specref.org\n *\n * Note: Run before core/biblio\n */\n\nimport { showWarning } from \"../core/utils.js\";\n\nexport const name = \"1edtech/biblio\";\n\n/**\n * @param {*} conf\n */\nexport async function run(conf) {\n let imsBiblioURL = \"https://purl.imsglobal.org/spec/ims-biblio.json\";\n if (conf.overrideIMSbiblioLocation) {\n imsBiblioURL = conf.overrideIMSbiblioLocation;\n }\n\n if (!conf.disableFetchIMSbiblio) {\n // console.log(\"fetching ims biblio...\");\n try {\n const response = await fetch(imsBiblioURL, { mode: \"cors\" });\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n const json = await response.json();\n // TODO invalid json should be caught here\n // JSON.stringify(conf.localBiblio) --> throws error?\n // TODO we might want to worry about dupes and precedence\n conf.localBiblio = Object.assign(conf.localBiblio || {}, json);\n } catch (error) {\n showWarning(\"Failed to fetch IMS biblio data: \" + error.toString(), name);\n }\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} 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} */\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 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} */\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>>} */\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>} */\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 definitions to take precedence over\n // definitions from WebIDL. WebIDL definitions wind\n // up as s instead of .\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 for given anchor.\n * @param {HTMLAnchorElement} anchor\n * @param {ReturnType} 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} 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 .\n if (dfn.childNodes.length !== 1) {\n return false;\n }\n const [first] = /** @type {NodeListOf} */ (dfn.childNodes);\n return first.localName === \"code\";\n}\n\n/**\n * Wrap links by .\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 \\`\\` element with text \"${elem.textContent}\" but no matching \\`\\``;\n const title = \"Linking error: not matching ``\";\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} */\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} */\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} 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} 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} */\n const links = document.querySelectorAll(\n \":is(a,dfn)[data-cite]:not([data-cite=''],[data-cite*='#'])\"\n );\n /** @type {NodeListOf} */\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} */\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>}\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>}\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} 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 const { pathname: citePath } = url;\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 `
                      ` 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 ``.\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`

                      ${l10n.heading}

                      `);\n }\n\n const localTermIndex = html`
                      \n

                      ${l10n.headlingLocal}

                      \n ${createLocalTermIndex()}\n
                      `;\n index.append(localTermIndex);\n\n const externalTermIndex = html`
                      \n

                      ${l10n.headingExternal}

                      \n ${createExternalTermIndex()}\n
                      `;\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`
                        \n ${dataSortedByTerm.map(([term, dfns]) => renderLocalTerm(term, dfns))}\n
                      `;\n}\n\nfunction collectLocalTerms() {\n /** @type {Map} */\n const data = new Map();\n /** @type {NodeListOf} */\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`
                    9. \n ${{ html: text }} ${suffix\n ? { html: suffix }\n : \"\"}\n
                    10. `;\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`
                    11. \n ${term}\n
                        \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
                      \n
                    12. `;\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 = `${text}`;\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 ${parent}`;\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 ${parent}`;\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 ${parent}`;\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`${secNum}`;\n };\n\n /** @type {NodeListOf} */\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`
                        \n ${dataSortedBySpec.map(([spec, entries]) => {\n return html`
                      • \n ${renderInlineCitation(spec)} defines the following:\n
                          \n ${entries\n .sort((a, b) => a.term.localeCompare(b.term))\n .map(renderExternalTermEntry)}\n
                        \n
                      • `;\n })}\n
                      `;\n}\n\nfunction collectExternalTerms() {\n /** @type {Set} */\n const uniqueReferences = new Set();\n /** @type {Map} spec => entry[] */\n const data = new Map();\n\n /** @type {NodeListOf} */\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; // \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`
                    13. \n ${{ html: text }}\n
                    14. `;\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 = `${text}`;\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 = `${linkForText}`;\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\nimport { toHTMLNode } from \"./utils.js\";\n\nexport const name = \"1edtech/contrib\";\n\nexport async function run(conf) {\n if (!conf.contributors) return;\n\n if (conf.specType !== \"errata\") {\n const useRoles = hasRoles(conf.contributors);\n const contrib = toHTMLNode(`
                      \n

                      List of Contributors

                      \n

                      The following individuals contributed to the development of this document:

                      \n \n \n \n \n ${useRoles ? `` : ``}\n \n \n ${personsToTableRows(conf.contributors, useRoles)}\n \n
                      NameOrganizationRole
                      \n
                      `);\n document.body.appendChild(contrib);\n }\n}\n\nfunction personsToTableRows(arr, useRoles) {\n // use incoming sort\n let ret = \"\";\n arr.forEach(entry => {\n ret += `${entry.name}`;\n ret += \"\";\n if (entry.company) ret += entry.company;\n ret += \"\";\n if (useRoles) {\n ret += \"\";\n if (entry.role) ret += entry.role;\n ret += \"\";\n }\n ret += \"\";\n });\n return ret;\n}\n\nfunction hasRoles(arr) {\n let hasRoles = false;\n arr.forEach(entry => {\n if (entry.role && entry.role.trim().length > 0) {\n hasRoles = true;\n }\n });\n return hasRoles;\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`
                        `;\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`${secno} `);\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} */\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``;\n anchor.append(...header.cloneNode(true).childNodes);\n filterHeader(anchor);\n return html`
                      1. ${anchor}
                      2. `;\n}\n\n/**\n * Replaces any child
                        and with .\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} */\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``;\n const h2 = html`

                        ${l10n.toc}

                        `;\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`

                        \n \n

                        `;\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`

                        ${l10n.informative}

                        `);\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`\n ${css}\n `\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`
                        Browser support:
                        \n
                        \n ${{\n any: contentPromise,\n placeholder: \"Fetching data from caniuse.com...\",\n }}\n
                        `;\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 caniuse.com`;\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`caniuse.com`;\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`
                        \n
                        ${arr}
                        \n
                        ${key}
                        \n
                        `\n );\n out.push(\n html`More info`\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
                        \n ${textVersion}\n
                        \n `;\n groups.get(type).push(result);\n return groups;\n };\n}\n\n/**\n * @typedef {Record} 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``;\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`
                        \n MDN${engineSupport}\n ${mdnSubPath}\n ${getEngineSupport(engines)}\n ${support\n ? buildBrowserSupportTable(support)\n : html`

                        No support data.

                        `}\n
                        `;\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`\n ${MDN_BROWSERS[browserId]}\n ${version ? version : displayStatus}\n `;\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`\n ${Object.keys(MDN_BROWSERS).map(browserId => {\n return support[browserId]\n ? createRowFromBrowserData(browserId, support[browserId])\n : createRow(browserId, \"Unknown\", \"\");\n })}\n
                        `;\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} MdnSupportEntry\n * @typedef {{ name: string, title: string, slug: string, summary: string, support: MdnSupportEntry, engines: string[] }} MdnEntry\n * @typedef {Record} MdnData\n * @returns {Promise}\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} */\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``;\n }\n if (engines.length < 2) {\n return html`🚫`;\n }\n return html``;\n}\n\n/**\n * @param {MdnEntry['engines']} engines\n * @returns {HTMLParagraphElement|undefined}\n */\nfunction getEngineSupport(engines) {\n if (engines.length === 3) {\n return html`

                        ${l10n.inAllEngines}

                        `;\n }\n if (engines.length < 2) {\n return html`

                        ${l10n.inSomeEngines}

                        `;\n }\n}\n","// @ts-check\n/**\n * module: 1edtech/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 * Clone of core/exporter. This clone accepts application/cms as a mimeType\n * and will generate an HTML except suitable for Drupal or other CMS.\n */\n\nimport { removeCommentNodes, removeReSpec, showError } from \"../core/utils.js\";\nimport { expose } from \"../core/expose-modules.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { pub } from \"../core/pubsubhub.js\";\n\nconst name = \"1edtech/exporter\";\n\n/**\n * Creates a dataURI from a ReSpec document. It also cleans up the document\n * removing various things.\n *\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 rsDocToCmsDataURL(doc = document) {\n const data = serializeHTML(doc);\n const encodedString = encodeURIComponent(data);\n return `data:text/html;charset=utf-8,${encodedString}`;\n}\n\n/**\n * Creates a dataURI of the CSS in a ReSpec document.\n *\n * @param {Document} doc document to export from.\n * @returns a stringified data-uri of stylesheet that can be saved.\n */\nexport async function rsDocToCssDataURL(doc = document) {\n const data = await serializeCSS(doc);\n const encodedString = encodeURIComponent(data);\n return `data:text/css;charset=utf-8,${encodedString}`;\n}\n\nasync function serializeCSS(doc) {\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n return await createCssExtract(cloneDoc.head);\n}\n\nfunction serializeHTML(doc) {\n // Convert image urls to data uris before\n // cloning the document. The clone does not\n // have rendered images.\n const images = doc.querySelectorAll(\"img\");\n images.forEach(img => {\n img.setAttribute(\"src\", getDataURL(img));\n });\n const cloneDoc = doc.cloneNode(true);\n cleanup(cloneDoc);\n createCmsExtract(cloneDoc.body);\n return cloneDoc.body.innerHTML;\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``;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n \n `;\n\n insertions.appendChild(metaGenerator);\n head.prepend(insertions);\n pub(\"beforesave\", documentElement);\n}\n\n/**\n * Strip content that is not allowed in Drupal or other CMS.\n *\n * @param {HTMLElement} docBody The document body element\n */\nfunction createCmsExtract(docBody) {\n let started = false;\n let finished = false;\n docBody.childNodes.forEach(node => {\n if (!started) {\n if (node.nodeName !== \"HEADER\") {\n node.remove();\n } else {\n started = true;\n }\n } else if (!finished) {\n if (node.nodeName == \"FOOTER\") {\n finished = true;\n } else if (node.nodeName == \"SCRIPT\") {\n node.remove();\n } else if (node.nodeName == \"STYLE\") {\n node.remove();\n }\n } else {\n node.remove();\n }\n });\n}\n\n/**\n * Combine all the stylesheets in the document head\n *\n * @param {HTMLElement} docHead The document body element\n * @returns A CSS stylesheet with all the styles combined\n */\nasync function createCssExtract(docHead) {\n let css = \"\";\n /** @type {NodeListOf} */\n const links = docHead.querySelectorAll(\"link[rel='stylesheet']\");\n await Promise.all(\n Array.from(links).map(async link => {\n try {\n const fetcher = await fetch(link.href);\n const data = await fetcher.text();\n css += data;\n } catch (err) {\n showError(`Cannot retrieve stylesheet ${link.href}. ${err}.`, name);\n }\n })\n );\n const styles = docHead.querySelectorAll(\"style\");\n styles.forEach(style => {\n css += style.innerText;\n });\n return css;\n}\n\n/**\n * Return a Data URL for the image. The Data URL will relace\n * the image source URL. This makes it easier to update the CMS\n * because there are no external image files to update.\n *\n * @param {HTMLImageElement} img\n */\nfunction getDataURL(img) {\n try {\n const canvas = img.ownerDocument.createElement(\"canvas\");\n canvas.width = img.width;\n canvas.height = img.height;\n const context = canvas.getContext(\"2d\");\n context.drawImage(img, 0, 0, img.width, img.height);\n return canvas.toDataURL();\n } catch (err) {\n const message = err.toString();\n if (!message.startsWith(\"SecurityError\")) {\n showError(message, name);\n }\n return img.src;\n }\n}\n\nexpose(name, { rsDocToCmsDataURL, rsDocToCssDataURL });\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 { rsDocToCmsDataURL } from \"../1edtech/exporter.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 id: \"respec-save-as-cms-extract\",\n ext: \"txt\",\n title: \"CMS EXTRACT\",\n type: \"application/cms\",\n get href() {\n return rsDocToCmsDataURL();\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` ui.closeModal()}\n >${title}`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`
                        \n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n
                        `;\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 \n Open Search UI in a new tab\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 \n Open Search UI in a new tab\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

                        \n ReSpec is a document production toolchain, with a notable focus on W3C specifications.\n

                        \n

                        \n Documentation,\n Bugs.\n

                        \n \n \n \n \n \n \n \n \n ${entries}\n \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 \n ${name}\n ${duration}\n \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``;\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\nexport const name = \"1edtech/seo\";\n\n/**\n * Add a canonical href\n *\n * @param {*} conf respecConfig\n *\n * Can be run before or after core/seo\n */\nexport async function run(conf) {\n const linkElem = document.createElement(\"link\");\n linkElem.setAttribute(\"rel\", \"canonical\");\n linkElem.setAttribute(\"href\", conf.thisURL);\n document.head.appendChild(linkElem);\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 = `${value}`;\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``\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
                      3. \n ${testFileName}\n ${emojiList}\n
                      4. \n `;\n return testList;\n}\n\nexport function run(conf) {\n /** @type {NodeListOf} */\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
                        \n tests: ${uniqueList.length}\n
                          \n ${uniqueList.map(toListItem)}\n
                        \n
                        \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} */\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 within the algorithm or the encompassing section on click.\n * Set `conf.highlightVars = true` to enable.\n * Removes highlights from 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","/* 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``,\n document.querySelector(\"link\")\n );\n\n /** @type {NodeListOf} */\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} */\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 \n \n
                        \n Permalink\n ${dfnExportedMarker(dfn)} ${idlMarker(dfn, links)}\n
                        \n

                        Referenced in:

                        \n ${referencesToHTML(id, links)}\n \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`exported`;\n}\n\n/**\n * @param {HTMLElement} dfn\n * @param {NodeListOf} 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`IDL`;\n }\n }\n return null;\n}\n\n/**\n * @param {string} id dfn id\n * @param {NodeListOf} links\n * @returns {HTMLUListElement}\n */\nfunction referencesToHTML(id, links) {\n if (!links.length) {\n return html`
                          \n
                        • Not referenced in this document.
                        • \n
                        `;\n }\n\n /** @type {Map} */\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`
                      5. \n ${toLinkProps(entry).map(link => {\n return html`${link.text}${\" \"}`;\n })}\n
                      6. `;\n };\n\n return html`
                          \n ${[...titleToIDs].map(listItemToHTML)}\n
                        `;\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","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 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} */\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} */ (\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`
                        Assert`,\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} */\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 \\`
                        \\`.`;\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 \\`\\`.`;\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","// @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
                          \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
                        \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` (#${prNumber})`;\n return html`
                      7. ${message.trim()}${pr}
                      8. `;\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\nexport const name = \"1edtech/cleanBody\";\n\n/**\n * A snapshot-time body merciless script and inline css remover. Intended to\n * be used only by admins. The activators are conf.cleanBodyScripts,\n * conf.cleanBodyCSS, alternatively conf.cleanBodyAll\n *\n * @param {*} conf respecConfig\n */\nexport async function run(conf) {\n if (conf.cleanBodyAll || conf.cleanBodyScripts) {\n const scripts = document.body.querySelectorAll(\"script\");\n scripts.forEach(script => {\n script.parentNode.removeChild(script);\n });\n }\n\n if (conf.cleanBodyAll || conf.cleanBodyCSS) {\n const styleElems = document.querySelectorAll(\"*[style]\");\n styleElems.forEach(styleElem => {\n styleElem.removeAttribute(\"style\");\n });\n }\n}\n","// @ts-check\n\nexport const name = \"1edtech/title-attrs\";\n\n/**\n * Adds title attributes to internal definition references. When the\n * reader hovers over the defined term, they will see the definition.\n *\n * If the term is defined in a definition list, the definiton is pulled\n * from the definition description element. For example,\n *\n *
                        \n *
                        Term
                        \n *
                        This is my term.
                        \n *
                        \n *\n * If the term is defined outside of a defintion list, the definition is\n * pulled from the nearest ancestor p, td, li, div, or aside. For example,\n *\n *

                        \n * This is my Term.\n *

                        \n *\n * @param {*} conf respecConfig\n */\nexport async function run(conf) {\n if (conf.noTitleAttrs) {\n return;\n }\n\n // for now we deal only with a.internalDFN, whose title attr value is\n // fetched from the destination link\n\n const anchors = document.body.querySelectorAll(\"a[href].internalDFN\");\n anchors.forEach(anchor => {\n const selector = anchor.getAttribute(\"href\");\n const dfn = document.body.querySelector(selector);\n if (dfn && dfn.tagName === \"DFN\") {\n let text = \"\";\n if (hasAncestor(dfn, \"dt\")) {\n // get the text content of the dd\n const dt = dfn.closest(\"dt\");\n const dd = dt.nextElementSibling;\n if (dd && dd.tagName === \"DD\") {\n text = dd.textContent;\n }\n } else {\n // get the text content of the neareset dfn block(?) parent\n const blockishParent = dfn.closest(\"p, td, li, div, aside\");\n if (blockishParent) {\n text = blockishParent.textContent;\n }\n }\n\n if (text.length > 0) {\n // console.log(text);\n text = text.replace(/^(\\s*)|(\\s*)$/g, \"\").replace(/\\s+/g, \" \");\n const ttl = document.createAttribute(\"title\");\n ttl.value = text;\n anchor.setAttributeNode(ttl);\n }\n }\n });\n}\n\nfunction hasAncestor(element, ancestorName) {\n const anc = element.closest(ancestorName);\n return anc != null;\n}\n","// @ts-check\nexport const name = \"1edtech/scripts\";\n\n/**\n * Attach fixup script.\n *\n * @param {*} conf respecConfig\n */\nexport async function run(conf) {\n if (!conf.noSideBarTOC) {\n // 1EdTech canonical location\n let fixupURL = \"https://purl.imsglobal.org/spec/fixup.js\";\n if (conf.overrideFixupLocation) {\n fixupURL = conf.overrideFixupLocation;\n }\n attachScript(fixupURL);\n } else {\n document.body.className += \" toc-inline\";\n }\n}\n\n/**\n * Append the script to the document.\n *\n * @param {string} url the URL of the script to attach\n */\nfunction attachScript(url) {\n const script = document.createElement(\"script\");\n script.addEventListener(\n \"load\",\n () => {\n if (window.location.hash) {\n // eslint-disable-next-line\n window.location = window.location;\n }\n },\n { once: true }\n );\n script.src = url;\n document.body.appendChild(script);\n}\n","// @ts-check\n\nexport const name = \"1edtech/comments\";\n\n/**\n * Remove all comment nodes.\n */\nexport async function run() {\n const nodeIterator = document.createNodeIterator(\n document.documentElement,\n NodeFilter.SHOW_COMMENT\n );\n const comments = [];\n let currentNode;\n\n while ((currentNode = nodeIterator.nextNode())) {\n comments.push(currentNode);\n }\n\n comments.forEach(comment => {\n comment.parentElement.removeChild(comment);\n });\n}\n","/* eslint-disable prettier/prettier */\n// @ts-check\n/**\n * Module 1edtech/footers\n * \n * Add 1EdTech boilerplate back matter to the document.\n */\n\nimport footersTmpl from \"./templates/footers.js\";\n\nexport const name = \"1edtech/footers\";\n\n/**\n * @param {*} conf\n */\nexport async function run(conf) {\n\n const footer = footersTmpl(conf);\n document.body.appendChild(footer);\n}\n","// @ts-check\nimport { html } from \"../../core/import-maps.js\";\n\nexport default conf => {\n return html`

                        \n
                        \n

                        \n 1EdTech™ Consortium, Inc. (\"1EdTech\") is publishing the\n information contained in this document (\"Specification\") for purposes of\n scientific, experimental, and scholarly collaboration only.\n

                        \n

                        \n 1EdTech makes no warranty or representation regarding the accuracy or\n completeness of the Specification.\n

                        \n

                        This material is provided on an \"As Is\" and \"As Available\" basis.

                        \n

                        \n The Specification is at all times subject to change and revision without\n notice.\n

                        \n

                        \n It is your sole responsibility to evaluate the usefulness, accuracy, and\n completeness of the Specification as it relates to you.\n

                        \n

                        1EdTech would appreciate receiving your comments and suggestions.

                        \n

                        \n Please contact 1EdTech through our website at\n www.1edtech.org.\n

                        \n

                        \n Please refer to Document Name: ${conf.specTitle.replace(\"
                        \", \" \")}\n ${conf.specVersion}\n

                        \n

                        Date: ${conf.specDate}

                        \n
                        \n
                        \n
                        `;\n};\n","// @ts-check\n/**\n * Checks whether the document has `` 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 \\`\\` tag with charset set to 'utf-8'`,\n hint: `Add this line in your document \\`\\` section - \\`\\` or set charset to \"utf-8\" if not set already.`,\n },\n zh: {\n msg: `文档只能包含一个 charset 属性为 utf-8 的 \\`\\` 标签`,\n hint: `将此行添加到文档的 \\`\\` 部分—— \\`\\` 或将 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} */\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

                        .\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} */\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} */\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} */\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 `

                        `.\",\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 `
                        `.\",\n },\n zh: {\n msg: \"所有章节(section)都必须以 `h2-6` 元素开头。\",\n hint: \"将 `h2-6` 添加到有问题的章节或使用 `
                        `。\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf} */\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 ``.\",\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
                        contains a `\".algorithm\"`\n *\n * The selector matches:\n * ``` html\n *
                          \n *
                            \n * ```\n * The selector does not match:\n * ``` html\n *
                              \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 * `` in this section, but excluding those in child sections.\n * @type {NodeListOf}\n */\n const varElems = section.querySelectorAll(\":scope > :not(section) var\");\n if (!varElems.length) continue;\n\n /** @type {Map} */\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 \"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} */\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
                              , 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}\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} */\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"],"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","joinOr","xmlEscape","norm","getIntlData","localizationStrings","data","getIntlDataForKey","linkCSS","urls","frag","reduce","nextLink","head","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","codedJoinAnd","quotes","addQuotes","docLink","strings","reindent","endsWith","linkingText","lines","indents","leastIndent","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","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$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","indentation","workaroundBlockLevelMarkdown","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$t","style$1","compute","transclude","github$1","dataInclude","mps","privacy","postMarkdown","idHeaders","abstract","dataTransform","dataAbbr","inlines$1","inlines","conformance","examples","issuesNotes$1","issuesNotes","bestPractices","figures","biblio","biblio$2","linkToDfn","xref","dataCite","renderBiblio","dfnIndex","contrib","fixHeaders","structure","informative","caniuse","mdnAnnotation","saveHtml","searchSpecref","searchXref","aboutRespec","seo$1","seo","highlight","dataTests","listSorter","highlightVars$1","dfnPanel","dataType","algorithms","anchorExpander","cleanBody","titleAttrs","scripts","comments","footers","checkCharset","checkPunctuation","checkInternalSlots","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","wptTestsExist","noHttpProps","a11y","ReSpec.run","hash","newHash","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","imsDefaults","css$n","noReSpecCSS","css$l","attachMetaViewport","meta","delimiter","separator","toKeyValuePairs","width","overrideCSSLocation","cssURL","check","specTitle","docVersion","specDate","Date","specNature","specType","shortName","specVersion","base","versionURL","thisURL","errataURL","latestURI","mainSpecURL","toHTMLNodes","string","toHTMLNode","newNodes","resolveGithubPromise","rejectGithubPromise","github","file_a_bug","participate","commit_history","ko","zh","ja","nl","es","ghURL","tempURL","repoURL","org","repo","pathname","branch","issueBase","commitHistoryURL","newProps","edDraftURI","githubToken","githubUser","atRiskBase","otherLinks","pullBase","githubAPI","hostname","excludeGithubLinks","otherLink","normalizedGHObj","apiBase","fullName","issuesURL","pullsURL","newIssuesURL","normalizedConfig","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","fillWithText","includeFormat","fill","structuredInternals","restructure","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","rawData","oninclude","includeReplace","attr","removeIncludeAttributes","processResponse","MIN_INT32","MAX_INT32","validateInt32","Number","isInteger","validateInt64","validateNumber","classDiagramTemplate","diagram","default","mermaid","import","initialize","startOnLoad","cleanedSvg","renderIssue","issue","renderNote","note","renderTerm","term","parentClass","documentation","description","issues","notes","renderType","stereoType","classTemplate","classData","properties","showPrivacyAnnotations","property","renderPrivacyImplicationDoc","privacyDoc","cardinality","renderCardinality","privacyImplications","renderPrivacyImplication","renderPrivacyImplicationCell","renderProperty","isExtensible","renderExtensibility","dataModelTemplate","dataModel","enumerationTemplate","suffix","interfaceTemplate","serviceInterface","headerId","operations","jsonSchemaTemplate","schema","jsonSchemasTemplate","openApiSchemaTemplate","modelData","operationTemplate","rootPath","operation","queryParameters","parameter","renderUrl","param","renderParmeterType","renderRequired","renderConfidentialityCell","renderParameter","renderRequestParameters","bodies","contentType","renderBodyType","renderRequestBody","renderRequestBodies","renderRequest","responses","flatMap","mergeResponseBodies","resp","statusCode","renderResponse","renderResponses","mergedResponses","confidentiality","renderConfidentiality","serviceModelTemplate","serviceModel","stereoTypeTemplate","types","classes","nameA","nameB","embeddedSelectionTemplate","generalizations","renderSuperClass","cls","getApiKey","apiKey","getBaseUrl","serverUrl","getJsonSchema","allowAdditionalProperties","res","ok","status","json","getModel","sessionStorage","getItem","query","model","modelByID","setItem","processClass","classModel","thisElement","nodeValue","insertAdjacentElement","processInterface","preferredId","operationSection","processOperation","processJsonSchema","processOpenApiSchema","modelId","binding","getOpenApiSchema","processSample","parentElem","classId","includeOptionalFields","sampleData","getDataSample","sample","processClassDiagram","packageNames","classNames","omitProperties","hideTitle","packages","getClassDiagram","modelSections","models","dataModelSections","stereoTypeSections","serviceModelSections","schemaSections","classDiagramSections","packageName","classSection","processDataModel","typeList","processStereoType","schemaFormat","processJsonSchemas","serviceModelId","services","service","serviceInterfaces","interfaces","interfaceId","interfaceSection","processServiceModel","samples","ajv2019","ajv","allErrors","addFormat","addFormats","schemaId","schemaDef","preText","innerText","refs","$id","compile","validate","instancePath","keyword","additionalProperty","validateExample","removeItem","mdm","privacy_section_header","privacy_implications","privacy_implications_paragraph","confidentiality_level","confidentiality_level_paragram","ACCESSIBILITY_label","ACCESSIBILITY_def","ANALYTICS_label","ANALYTICS_def","CONTAINER_label","CONTAINER_def","CREDENTIALS_label","CREDENTIALS_def","CREDENTIALSIDREF_label","CREDENTIALSIDREF_def","DEMOGRAPHICS_label","DEMOGRAPHICS_def","EXTENSION_label","EXTENSION_def","FINANCIAL_label","FINANCIAL_def","IDENTIFIER_label","IDENTIFIER_def","IDENTIFIERREF_label","IDENTIFIERREF_def","INSURANCE_label","INSURANCE_def","LEGAL_label","LEGAL_def","MEDICAL_label","MEDICAL_def","NA_label","NA_def","OTHER_label","OTHER_def","QUALIFICATION_label","QUALIFICATION_def","PERSONAL_label","PERSONAL_def","SOURCEDID_label","SOURCEDID_def","SOURCEDIDREF_label","SOURCEDIDREF_def","UNRESTRICTED_label","UNRESTRICTED_def","NORMAL_label","NORMAL_def","RESTRICTED_label","RESTRICTED_def","VERYRESTRICTED_label","VERYRESTRICTED_def","privacyImplicationsKeys","confidentialityLevelKeys","createSection","privacySection","piSection","translations","confSection","confLevelTmpl","mdOnlies","getStatusString","specStatusString","showLink","class","showLinkData","renderIpr","iprs","renderIprRow","renderIprTable","company","electionDate","necessaryClaims","headersTmpl","renderSpecVersion","renderSpecStatus","renderVersionTable","renderDisclosure","getFullYear","permalinkLabel","sectionType","sectionNumber","headings","selfLink","contains","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","findConformanceSection","sectionElements","foundSection","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","isInDB","put","close","clear","storeNames","stores","clearStorePromises","bibrefsURL","doneResolver","updateFromNetwork","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","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","getNormativeText","MUST","REQUIRED","SHALL","SHOULD","RECOMMENDED","MAY","OPTIONAL","terms","skipCertGuideConformanceRef","processConformance","mainSpecTitle","mainSpecBiblioKey","getInformativeText","conformanceHeading","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","codedJoinOr","processAsInternalSlot","closestType","computeExport","export","titles","pluralizeDfn","dfnTexts","dfns","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$j","makeTitle","num","report","number","div","inAside","exampleTitle","css$h","editors_note","feature_at_risk","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","hasChildNodes","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","issueNumbers","fetchAndStoreGithubIssues","headElem","ednote","aside","getAdmonType","topBar","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","sections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","every","decorateTableOfFigures","imsBiblioURL","overrideIMSbiblioLocation","disableFetchIMSbiblio","mode","statusText","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","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","STORE_NAME","VERSION_CHECK_WAIT","getIdbCache","resolveXrefCache","queries","cachedData","lastChecked","localStorage","API_URL","lastUpdated","shouldBustCache","clearXrefData","requiredKeySet","cache","profiles","informativeRefsInNormative","getRequestEntry","getTermFromElement","specs","dataciteElem","cites","closestSection","inlineRefs","uniqueSpecContext","higherPriority","uniqueSpecs","dedupeSpecContext","getSpecContext","getTypeContext","dataXrefForElem","getForContext","addDataCite","uri","shortname","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","getLocalTermText","renderLocalTerm","createLocalTermIndex","externalTermIndex","dataSortedBySpec","specA","specB","createExternalTermIndex","contributors","useRoles","hasRoles","role","personsToTableRows","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","noToc","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","css$d","BROWSERS","statToText","defaultBrowsers","DEFAULTS","removeOnSave","browsers","feature","normalizeCaniuseConf","invalidBrowsers","browser","validateBrowsers","featureURL","headDlElem","contentPromise","apiURL","fetchStats","groups","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","maxAge","Request","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","toISOString","cacheResponse","Response","blob","fetchAndCache","getMdnData","findElements","mdnSpecArray","rsDocToCmsDataURL","images","img","canvas","height","getContext","drawImage","toDataURL","getDataURL","docBody","started","finished","createCmsExtract","serializeHTML","rsDocToCssDataURL","docHead","fetcher","createCssExtract","serializeCSS","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","publishDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","search_specref","specrefSearchUI","xrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","gitRevision","metaElem","firstParagraph","css$9","fetchBase","_documentCurrentScript","workerPromise","workerScript","respecWorker$1","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","noHighlightCSS","highlightables","promisesToHighlight","missing_test_suite_uri","tests","toListItem","emojiList","testFile","testParts","testFileName","requiresConnectionEmoji","manualPerformEmoji","toTestURLs","testSuiteURI","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","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","css$3","varMap","variables","currentSection","css$1","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","props","to","connectedCallback","fetchCommits","commits","commit","prNumber","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","cleanBodyAll","cleanBodyScripts","cleanBodyCSS","styleElem","noTitleAttrs","ancestorName","anc","hasAncestor","dd","nextElementSibling","blockishParent","ttl","noSideBarTOC","fixupURL","overrideFixupLocation","attachScript","currentNode","footer","footersTmpl","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","filesInWPT","githubAPIBase","wptDirectory","testSuiteURL","files","getFilesInWPT","missingTest","offendingMembers","getOwnPropertyNames","DISABLED_RULES","formatHintsAsMarkdown","group","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,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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H,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,GAAYC,SCjgBGkC,GAAU,SAASC,GAAgB,IAAI/P,EAAE,CAAE,EAAC,I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S4f,iBAAiB,wBAClC/hB,KACC6qC,GAAW,GAAGpoC,EAAOs/B,IAAIr3B,UAAUmgC,EAAQ3kB,aAAa,kBAEzDlO,SAAQyX,IACPqjB,eAAe0E,WAAW/nB,EAAI,IAIlC9tB,EAAI,WAAW,KACb,MAAM24B,EAASn4B,SAASuxB,eAAe,qBACjCyG,EAAa94B,KAAKsY,MAAM2gB,EAAO3V,WACjC,QAASwV,WACJA,EAAWsd,IAClBnd,EAAO3V,UAAYtjB,KAAKC,UAAU64B,EAAY,KAAM,GACrD,GAEL,ICn2CO,MAED33B,GAAOyvB,GCXE,CACbvvB,GAAI,CACFg1C,uBAAwB,UACxBC,qBAAsB,uBACtBC,+BACE,2NACFC,sBAAuB,wBACvBC,+BACE,6FACFC,oBAAqB,gBACrBC,kBACE,yFACFC,gBAAiB,YACjBC,cACE,sFACFC,gBAAiB,YACjBC,cACE,uEACFC,kBAAmB,cACnBC,gBACE,kFACFC,uBAAwB,mBACxBC,qBACE,oFACFC,mBAAoB,eACpBC,iBACE,sFACFC,gBAAiB,YACjBC,cACE,6GACFC,gBAAiB,YACjBC,cACE,sGACFC,iBAAkB,aAClBC,eACE,0IACFC,oBAAqB,gBACrBC,kBACE,2GACFC,gBAAiB,sBACjBC,cACE,0GACFC,YAAa,QACbC,UACE,+FACFC,cAAe,qBACfC,YACE,8HACFC,SAAU,MACVC,OACE,kGACFC,YAAa,QACbC,UACE,2FACFC,oBAAqB,8BACrBC,kBACE,mHACFC,eAAgB,WAChBC,aACE,uEACFC,gBAAiB,YACjBC,cACE,6JACFC,mBAAoB,eACpBC,iBACE,+HACFC,mBAAoB,eACpBC,iBACE,6DACFC,aAAc,SACdC,WACE,sHACFC,iBAAkB,aAClBC,eACE,kNACFC,qBAAsB,iBACtBC,mBACE,8LDjEAC,GAA0B,CAC9B,gBACA,YACA,YACA,cACA,mBACA,eACA,YACA,YACA,aACA,gBACA,YACA,QACA,UACA,KACA,QACA,gBACA,WACA,YACA,gBAGIC,GAA2B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